cancel
Showing results for 
Search instead for 
Did you mean: 

Load Reports Failed - Windows App

Former Member
0 Kudos

Hello-

I have a windows app that is getting an error "Load Reports Failed". The inner exception is "Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.".

This only happens when the application is launched WITHOUT command line arguments. When the app is launched WITH comand arguments, the app form never shows and the "exporting of the reports to PDF happen in batch form. The Loading of the report actually happens in a seperate DLL and whether the app is launched with command line arguments or not, so the code that gets me from app start to report load is the exact same.

This also only seems to happen on Windows Server 2003 SP2. It works fine on Windows 2008 or Windows 7.

This machine is 32-bit

My App is built in Visual Studio 2010 and we are build on the .Net Framework 4.0. I've just applied the SP2 for Crystal Reports RunTime 13. (CRRuntime_32bit_13_0_2.msi).

Accepted Solutions (1)

Accepted Solutions (1)

former_member188030
Active Contributor
0 Kudos

Hi,

As mentioned, "This only happens when the application is launched WITHOUT command line arguments". I suppose the command line argument is the path or nme of the report, right? The application is likely to throw the error when it cant find the report.

Take a look at below articles which address this issue.,

[1603477 - Error: A document processed by the JRC engine cannot be opened in the C++ stack |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333633303333333433373337%7D.do]

[http://forums.sdn.sap.com/thread.jspa?threadID=2031409|http://forums.sdn.sap.com/thread.jspa?threadID=2031409]

- Bhushan.

Former Member
0 Kudos

Hi Brushan-

Unfortunately, this isn't the issue. The commandline argument is actually an "Institution" number which pertains to a "Bank". If there are multiple banks configured, they can have their set of reports to be "batch exported".

In this example, there is only 1 bank. I've configured the batch process to export EVERY report (65 in total) and that runs just fine. However, when i manually launch the app, manually select the institution, select any one of the reports that previously exported in "batch mode" and it fails.

I don't see anyway to attach screenshots or I would show the path of the report. Here are some debug logging that I added in the program...


 ActivityLog.Write("debug 3: " + reportPath, MessageType.Error);

ActivityLog.Write("debug 4:  Does Path exist? " + File.Exists(reportPath).ToString(), MessageType.Error);
_crystalReport.Load(reportPath, OpenReportMethod.OpenReportByTempCopy);

Here are the database logs that result from that when i run the program

debug 3: C:\Program Files\JHA\Check21\CrystalReports\Adjustments.rpt

debug 4: Does Path exist? True

Former Member
0 Kudos

Anyone have any idea what is going on with this?

former_member183750
Active Contributor
0 Kudos

Take the error explanation in the KBase provided by Bhushan as correct (1603477 - Error: A document processed by the JRC engine cannot be opened in the C++ stack).

Now, consider what may lead to the engine not finding the report path. Permissions? Incorrect path? Incorrect report name?

The [Process Monitor|http://technet.microsoft.com/en-ca/sysinternals/bb896645.aspx] utility may help. See what is happening with the report as it is loaded, saved to a temp dir and used from there. (Remember, once the report is loaded, it is "decompiled" and saved to c:\windows\temp (or %tem%) and thus you need read / write permissions on this directory - at minimum (this goes back to permissions). E.g.; the path to the report may be corerct, the report name may be correct, but if the temp folder does nto have correct permissions, it will fail

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Former Member
0 Kudos

I will take a look at this. I was able to find another server running Windows Server 2003 and that seemed to work just fine. But what baffles me is that it works if the apps form isn't showing, but doesn't work with the apps form is showing. The only difference that I can see in the code is instead of calling Application.Run() with the form object and then when the user clicks the "export button" which calls my "export method", the command-argument driven version calls that export method directly.

I will dive into process monitor and see if I can pinpoint the problem. '

I appreciate your input.

former_member183750
Active Contributor
0 Kudos

If it works on one box and not another, it more than likely is not the code. It is either the runtime, runtime dependencies, permissions or other environmental variable(s).

Process Monitor may really prove to be just the thing you need.

- Ludek

Former Member
0 Kudos

I've narrowed it down to a permission issue. In the app.config file, we do set an impersonation user (optional). In the working machine, that user was not set. On the machine that isn't working it was set. I validated that user info was correct. Trying to figure out this "temp" folder location. I temporarily removed the impersonation fromt he app.config and it worked.

Now, putting it back, I'm not quite figured out all the spots I need the permission set.

I set that user to full permissions on C:\Windows\Temp and also the %temp% folder (which resolves to C:\Documents and Settings\Administrator\Local Settings\Temp\2) in addition to my input (.rpt file folder) and the output folder (where the pdf will get created at).

However, still not working. I don't see any activity in those folders as to a temp .rpt or something. Can you think of any other folder this needs to be set on?

Former Member
0 Kudos

Ok. Upon further validation, it is the %temp% folder where the temp files are being written to which resolves to C:\Documents and Settings\Administrator\Local Settings\Temp\2

added full permission for my impersonated user, but still giving me a denial. my impoersonated user is named "c21service_local", so it is different than administrator.

Former Member
0 Kudos

Upon numerous tests, I've come to the conclusion that my "impersonated user" has to to be part of the local admin group. Otherwise, there is something somewhere that doesn't like it and won't create the temp files.

I've tried giving user full control to the c:\ drive and still doesn't work. Maybe there is a registry write that a local user cannot perform.

Answers (0)