cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to load database information. Error in {GUID}.rpt

Former Member
0 Kudos

Hi

I have a C# windows service that load a rpt file and export it to PDF

I am required to use XML as data source for the rpt file, and in the IDE of CR 2013 it always works fine via local XML file, and also I create a http/https pages which returns a XML stream, it still works,  preview fine.

And then I debug into my unit test project, load the rpt file, set the necessary parameters, and at last call the ReportDocument.Export(), the PDF was generated successfully.

But when I deploy the windows service in my local machine, it always throw out an exception with the error message of “Failed to load database information. Error in {GUID}.rpt” at ReportDocument.Export().

Here is the environment of my local machine:

    Windows 7 (64 bit)

    NET framework 4.0 / VS2010 build with “Any CPU”

    CR2013 with the latest run-time packages for VS

    I also have crdb_xml.dll in both of the following paths:

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86

I doubt that I missed something in my environment, is there any suggestions? Thanks a lot!

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

I would change the build away from "Any CPU" and specifically target either 32-bit or 64-bit platform.

Also, I suspect that your service is running under the "local services" account which may not have access to the .xml file.  For testing purposes on your local machine, I would change the configuration of the installed service so that it runs under your credentials.  When you install the service on the server, you will need a network "services" account in order to have access to the file.

-Dell

Former Member
0 Kudos

Thank you for the response.

We tried but failed.

Actually, the problem we met is “We can set HTTPS mode as XML data source with report preview and unit test, but it always throws ‘failed to load database info’ in report service with CrystalDecisions.CrystalReports.Engine.dll”

former_member183750
Active Contributor
0 Kudos

How did you deploy the crdb_xml driver? You do not want to copy is from your dev computer. You want to use the the crdbxml9.MSI file from here:

Also, see if the search results for 'XML failed load crystal' bring up of any use to you. Search box is in the top right corner.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Thank you for your advice!

I have deployed the crdb_xml driver as the steps mentioned in your links, it resolved previous error. Thanks a lot!

But now I encountered another problem, ok, here is my work flow:

  1. 1. I create two separate .net pages which return xml stream for my report file, one for main report and the other for the sub report. And these pages need to pass parameters.
  2. 2. I create http/https URL xml data source for both the main report and sub report, also I added the parameters in the end of my creation by @prompt function.
  3. 3. Then I preview my report, enter the necessary parameters in the pop-up window, and click “OK”, the xml data returned from my URL and displayed correctly in my report.
  4. 4. Then I test into my windows service:
  5. 1) Create an object of CrystalDecisions.CrystalReports.Engine.ReportDocument() named rptDoc to load my report file.
  6. 2) Set parameters to rptDoc via the function of rptDoc.SetParameterValue()
  7. 3) Apply my logonInfo and attributes information
  8. 4) rptDoc.Export().

Then I got my problem, the parameters did not send to my .net pages all the while, but it is worked fine if I previewed the report in CR 2013 design tool.

Is it the problem that I missed some settings in my .net code or any way CrystalReport.Engine did not support to pass parameters to a report with http/https xml data source?

I am blocked by this issue, any suggestion? Thanks!

For your reference, here is the .net page which is trying to catch the parameters

foreach (var item in Request.Params)

                {

paramsList.Add(item.ToString());

                }

                ExceptionManager.InsertException(new Exception(string.Join(",", paramsList)));

                BrokerEntity broker = null;

                string ifpPSID = Params.ReplaceNullWith(Request["@IFPPSID"], Null.NullString).ToString();

When preview the report in CR 2013 design tool, we get following string for “Request.Params”

“@IFPPSID,ASP.NET_SessionId,ALL_HTTP,ALL_RAW,APPL_MD_PATH,APPL_PHYSICAL_PATH,AUTH_TYPE,AUTH_USER,AUTH_PASSWORD,LOGON_USER,REMOTE_USER,CERT_COOKIE,CERT_FLAGS,CERT_ISSUER,CERT_KEYSIZE,CERT_SECRETKEYSIZE,CERT_SERIALNUMBER,CERT_SERVER_ISSUER,CERT_SERVER_SUBJECT,CERT_SUBJECT,CONTENT_LENGTH,CONTENT_TYPE,GATEWAY_INTERFACE,HTTPS,HTTPS_KEYSIZE,HTTPS_SECRETKEYSIZE,HTTPS_SERVER_ISSUER,HTTPS_SERVER_SUBJECT,INSTANCE_ID,INSTANCE_META_PATH,LOCAL_ADDR,PATH_INFO,PATH_TRANSLATED,QUERY_STRING,REMOTE_ADDR,REMOTE_HOST,REMOTE_PORT,REQUEST_METHOD,SCRIPT_NAME,SERVER_NAME,SERVER_PORT,SERVER_PORT_SECURE,SERVER_PROTOCOL,SERVER_SOFTWARE,URL,HTTP_CONNECTION,HTTP_ACCEPT,HTTP_HOST,HTTP_USER_AGENT,HTTP_FRONT_END_HTTPS”

When run in windows service, we get following string without parameters “@IFPPSID”

“ASP.NET_SessionId,ALL_HTTP,ALL_RAW,APPL_MD_PATH,APPL_PHYSICAL_PATH,AUTH_TYPE,AUTH_USER,AUTH_PASSWORD,LOGON_USER,REMOTE_USER,CERT_COOKIE,CERT_FLAGS,CERT_ISSUER,CERT_KEYSIZE,CERT_SECRETKEYSIZE,CERT_SERIALNUMBER,CERT_SERVER_ISSUER,CERT_SERVER_SUBJECT,CERT_SUBJECT,CONTENT_LENGTH,CONTENT_TYPE,GATEWAY_INTERFACE,HTTPS,HTTPS_KEYSIZE,HTTPS_SECRETKEYSIZE,HTTPS_SERVER_ISSUER,HTTPS_SERVER_SUBJECT,INSTANCE_ID,INSTANCE_META_PATH,LOCAL_ADDR,PATH_INFO,PATH_TRANSLATED,QUERY_STRING,REMOTE_ADDR,REMOTE_HOST,REMOTE_PORT,REQUEST_METHOD,SCRIPT_NAME,SERVER_NAME,SERVER_PORT,SERVER_PORT_SECURE,SERVER_PROTOCOL,SERVER_SOFTWARE,URL,HTTP_CONNECTION,HTTP_ACCEPT,HTTP_HOST,HTTP_USER_AGENT,HTTP_FRONT_END_HTTPS”

former_member183750
Active Contributor
0 Kudos

I believe it is the parameter code that is not quite correct. It would be very interesting to see the same code in a simple win app that views the report as opposed to exporting - btw, what format are you exporting to?

Anyhow, my suggestion would be to copy and paste the code into a win app, add a CR viewer (you will need to use the full 4.0 framework) and send the report to the viewer. I find you bet better errors, etc., like this.

- Ludek

Former Member
0 Kudos

I export the report to PDF format.

The parameters I created were HTTP parameters at the end of  XML data source creation. See the screenshot below:

I tried to print the HTTP parameters on my report, unfortunately there is nothing displayed, but when I manually create a general parameter and then set value via rptDoc.SetParameterValue() in my code and print it on my report, then it displayed correctly, that means rptDoc.SetParameterValue() could not pass HTTP parameters to crystal report.

So, how could I pass the HTTP parameters to my report in CrystalDecisions.CrystalReports.Engine? I am required to work out the job under a C# windows service…


Thanks!

former_member183750
Active Contributor
0 Kudos

Hmmm. I kinda got lost here:

  string ifpPSID = Params.ReplaceNullWith(Request["@IFPPSID"], Null.NullString).ToString();


So I went around seeing if I could get a bit of help around here. Best answer I got (which in some way mirrored my confusion) was:


I’m not sure what is supposed to happen with “Params.ReplaceNullWith()… “

I could not find any reference to that method,  Should he not be using paramlist instead?


Former Member
0 Kudos

that code is included in my .net page to get the parameters from HTTP URL which was set as the data source in my report file,  the "Request['@IFPPSID']" should not be null if the parameter was passed into my .net page as I expected, but now that is truely null which blocked me.

the method Params.ReplaceNullWith() is a custom-method but not a system method, it will transform a null value to a empty string, so please ignore the reference of this method.

former_member183750
Active Contributor
0 Kudos

My suggestion is always to start small, see how things work, then move on to things like custom methods. E.g.; see how the CR engine handles NULL. If you enter the a search string like 'NULL Crystal parameter net' into the search box at the top right corner, you will get a number of KBAs and other resources that would be good to have a look at. Get the NULL "stuff" working in simple proof of concept snippets, then move on to things like custom functions.

- Ludek

Answers (0)