on 06-05-2012 5:39 PM
Hi All,
I have a problem where I can execute a report in my WCF 4 REST service when I run the project in Visual Studio's built in web server, but it fails when I deploy the application to my local IIS server (or run the project using IIS from Visual Studio) with the following error:
Failed to load database information.
Error in File property_summary {7FFAB7ED-31BD-4E7F-94FA-10B0BB55B111}.rpt:
Here is the software installed on my machine:
Here is a snippet of my code:
ReportDocument rptDoc = new ReportDocument();
rptDoc.Load(pathToRptFile);
SetReportParameters(rptDoc, reportParameters);
rptDoc.SetDatabaseLogon(credential.Username, credential.Password);
ExportFormatType rptExportFormat = GetRptFormatType(queryParameters, ExportFormatType.PortableDocFormat);
Stream resultStream = rptDoc.ExportToStream(rptExportFormat);
Message resultMessage = WebOperationContext.Current.CreateStreamResponse(resultStream, ReportExportTypeToMimeType(rptExportFormat));
return resultMessage;
Here is detailed error message with stack trace:
2012-06-05 09:55:49,529 ERROR MyNamspace.ReportService (GetReport(), line:50) - Failed to load database information.
Error in File property_summary {7FFAB7ED-31BD-4E7F-94FA-10B0BB55B111}.rpt:
Failed to load database information.
CrystalDecisions.CrystalReports.Engine.DataSourceException: Failed to load database information.
Error in File property_summary {7FFAB7ED-31BD-4E7F-94FA-10B0BB55B111}.rpt:
Failed to load database information. ---> System.Runtime.InteropServices.COMException: Failed to load database information.
Error in File property_summary {7FFAB7ED-31BD-4E7F-94FA-10B0BB55B111}.rpt:
Failed to load database information.
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
--- End of inner exception stack trace ---
at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType)
at MyNamspace.ReportService.GetReport() in C:\projects\MyProject\ReportService.cs:line 50
I've seen discussions which talk about issues with 64 bit ODBC drivers (need to use 32 bit drivers - http://scn.sap.com/thread/1984779) and some issue with MS changing the way SQL Server connects in .NET 4, but those issues don't seem applicable to my case.
Does anyone have any suggestions?
Thanks in advance,
Carl
Switch these lines:
SetReportParameters(rptDoc, reportParameters);
rptDoc.SetDatabaseLogon(credential.Username, credential.Password);
to:
rptDoc.SetDatabaseLogon(credential.Username, credential.Password);
SetReportParameters(rptDoc, reportParameters);
If that does not help, use the search at the top right corner of this page (select "All of SAP"). The search string "Failed load database information crystal net" will return a number of KBs and more. Typically, the error means that the process does not have necessary permissions. Could be a CR missing database driver, but I don't think this is the case here.
- Ludek
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ludek,
Thanks for your suggestions and help. So far, I'm still stuck. Here's what I've tried:
Running as (WindowsIdentity.GetCurrent().Name): IIS APPPOOL\DefaultAppPool
and granted read, read and execute, and list contents for IIS APPPOOL\DefaultAppPool to my Oracle client installation (C:\oracle). There permissions don't inherit all the way down to tnsnames.ora, so I had to grant the user to C:\oracle\product\11.2.0\client_32bit. Those permissions did inherit all the way down to tnsnames.ora. However, this didn't solve the problem.
Running as (WindowsIdentity.GetCurrent().Name): PENBAYMEDIA\ctrapani
but I still get the same error:
2012-06-06 14:21:12,716 DEBUG MyNamspace.ReportService (GetReport(), line:71) - About to call ReportDocument.ExportToStream(PortableDocFormat)
2012-06-06 14:21:13,803 ERROR MyNamspace.ReportService (GetReport(), line:72) - Failed to load database information.
Error in File property_summary {77DFCD2D-2B84-4FD0-A4E1-681A9BDD04FE}.rpt:
Failed to load database information.
CrystalDecisions.CrystalReports.Engine.DataSourceException: Failed to load database information.
Error in File property_summary {77DFCD2D-2B84-4FD0-A4E1-681A9BDD04FE}.rpt:
Failed to load database information. ---> System.Runtime.InteropServices.COMException: Failed to load database information.
Error in File property_summary {77DFCD2D-2B84-4FD0-A4E1-681A9BDD04FE}.rpt:
Failed to load database information.
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
--- End of inner exception stack trace ---
at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType)
at MyNamspace.ReportService.GetReport() in C:\projects\MyNamspace\MyNamspace\services\ReportService.cs:line 72
So, I'm pretty sure this isn't a permissions issue.
I think it is something relating to 32 vs 64 bit, but I'm really not sure.
I have a couple questions:
On my development machine, C:\Windows\assembly\CrystalDecisions.CrystalReports.Engine shows 13.0.2000.0 as well as on the deployment server.
Just to re-iterate, the report connects to the db server and renders fresh, database data perfectly when I run the service using the build in Visual Studio web server. It fails when I run it under my local IIS server or deploy it to a server where it is hosted in IIS (both are IIS 7.5).
Any help would be very much appreciated. We have purchased Crystal Report designer. Is there any support via that?
Carl
Hello Jon:
Even though I'm developing on and deploying to 64 bit operating systems (Win 7 Pro and Win 2008 R2 and IIS 7.5), I still need to install and use the 32 bit Oracle client for rpt files authored with Crystal Reports 2011 and Crystal for VS2010 (v13.0.2), right?
- It's the "bitness" of the application that defines if we need 32 or 64 bit Oracle client. E.g.; 32 bit app = 32 bit Oracle client, 64 bit app = 64 bit client. Only caveat here is that you do not want to build the app as "Any CPU". If you do, a 64 bit OS assumes that the app will be run as 64 bit, thus requiring a 64 bit CR runtime and 64 bit Oracle client.
On my deployment server (Win 2008 R2, 64bit) which Crystal runtime do I need to install, the 64 bit one?
- depends - if the app is compiled as 32 bit, then 32 bit CR runtime. If the app is compiled as 64 bit, then 64 bit runtime. If the app is compiled as "ANY CPU", see the caveat above.
On my development machine, there is only one install, Crystal for Visual Studio 2010 SP3. Do I need to install the runtime on my development server too?
- No you do not.
Any help would be very much appreciated. We have purchased Crystal Report designer. Is there any support via that?
- Support for both CR 2011 and CRVS2010 is available. See the following link:
Couple more suggestions:
Make sure that the %TEMP% directory has read / write permissions. CR needs this to be able to write temp files and if those permissions are missing, you will get a "Load report failed" errors.
See if Process Monitor gives you any indication as to what is going on. Search the logs for "Access Denied", look for temp files created and used.
- Ludek
Hi Ludek,
Thanks again for your suggestions and help.
My application needs to be 32 bit because the Oracle drivers where the service will ultimately be hosted must be 32 bit.
I changed my VS 2010 project build settings to Debug and set the Platform to x86. I also set the IIS application pool -> Advanced settings -> Enable 32-Bit Applications to True. The application pool Identity is ApplicationPoolIdentity which results in the (virtual?) user: IIS APPPOOL\MyProductAppPool Windows identity at runtime.
This configuration works on my local machine hosted on IIS :-)!!! which is configured now a little differently than when I started out:
I left the 64 bit runtime components on my local machine for potential future use since I don't think my application is using or requires them now. I'm guessing that the 32 bit Crystal components are included with CR for VS2010.
Unfortunately, when I deploy the application to my DEV server (Win 2008 R2), I'm getting the same error :-(. Here is the software configuration on the DEV server:
I ran the Process Monitor, filtered it to show only w3wp.exe process and found the following items of note when I tried to request my service:
Date & Time: 6/8/2012 9:25:40 AM
Event Class: Registry
Operation: RegCreateKey
Result: ACCESS DENIED
Path: HKLM\Software\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0
TID: 820
Duration: 0.0000189
Desired Access: Read/Write
This entry exists in the registry and has many sub-keys in it when I look using regedit. In addition to that Access Denied error (that appears multiple times), I also get NAME NOT FOUND for Read requests on multiple keys:
Path: HKU\.DEFAULT\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0
Path: HKU\.DEFAULT\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0
Path: HKU\S-1-5-82-678431378-3525683969-487396034-911280204-2518497837_Classes
Path: HKCR\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
Path: HKCR\Wow6432Node\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
Path: HKU\S-1-5-82-678431378-3525683969-487396034-911280204-2518497837_Classes
Path: HKCR\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
Path: HKCR\Wow6432Node\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
Path: HKU\S-1-5-82-678431378-3525683969-487396034-911280204-2518497837_Classes
Path: HKCR\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
Path: HKCR\Wow6432Node\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
Path: HKU\.DEFAULT\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0
Path: HKU\.DEFAULT\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Locale
Path: HKU\.DEFAULT\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database
Path: HKLM\Software\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database
Path: HKU\.DEFAULT\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database\QueryBuilder\JoinBuilder
Path: HKLM\Software\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database\QueryBuilder\JoinBuilder
Path: HKU\S-1-5-82-678431378-3525683969-487396034-911280204-2518497837
Path: HKU\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\Windows
Path: HKU\S-1-5-82-678431378-3525683969-487396034-911280204-2518497837
I changed the AppPoolIdentity to run as me (my domain account) which is part of the local Administrator group, but still I get the same error (Failed to load database information). The Access Denied errors are gone in ProcMon, but I still get a lot of NOT FOUND:
HKCU\Software\Classes\Wow6432Node\CLSID\{0A29FF9E-7F9C-4437-8B11-F424491E3931}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{0A29FF9E-7F9C-4437-8B11-F424491E3931}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{0A29FF9E-7F9C-4437-8B11-F424491E3931}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{0A29FF9E-7F9C-4437-8B11-F424491E3931}\Server
HKCU\Software\Classes\Wow6432Node\CLSID\{0A29FF9E-7F9C-4437-8B11-F424491E3931}\Server
HKCU\Software\Classes\Wow6432Node\CLSID\{0A29FF9E-7F9C-4437-8B11-F424491E3931}\Server
HKCU\Software\Classes\Wow6432Node\CLSID\{F734A321-8381-4FFD-A614-139E8906DC83}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{F734A321-8381-4FFD-A614-139E8906DC83}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{F734A321-8381-4FFD-A614-139E8906DC83}\InprocServer32
HKCU\Software\Classes\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCR\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCU\Software\Classes\Wow6432Node\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCR\Wow6432Node\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCU\Software\Classes\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCR\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCU\Software\Classes\Wow6432Node\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCR\Wow6432Node\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCU\Software\Classes\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCR\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCU\Software\Classes\Wow6432Node\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCR\Wow6432Node\CLSID\{C016CDD4-42F0-4C37-BAEA-31EA6CAF442B}
HKCU\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Locale
HKCU\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database
HKLM\Software\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database
HKCU\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database\QueryBuilder\JoinBuilder
HKLM\Software\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database\QueryBuilder\JoinBuilder
HKCU\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Locale
HKCU\Software\Classes\Wow6432Node\CLSID\{28B4D5F6-C147-4897-B7A1-E615CB6C86C9}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{28B4D5F6-C147-4897-B7A1-E615CB6C86C9}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{28B4D5F6-C147-4897-B7A1-E615CB6C86C9}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{FB13415D-7F5B-4315-87BF-1A19DB016338}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{FB13415D-7F5B-4315-87BF-1A19DB016338}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{FB13415D-7F5B-4315-87BF-1A19DB016338}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{EC75982C-37CF-4F20-8736-92901B9FCAD7}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{EC75982C-37CF-4F20-8736-92901B9FCAD7}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{EC75982C-37CF-4F20-8736-92901B9FCAD7}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{BCAEDADC-7B32-4A0D-B01F-D220B34B7EA9}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{BCAEDADC-7B32-4A0D-B01F-D220B34B7EA9}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{BCAEDADC-7B32-4A0D-B01F-D220B34B7EA9}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{DE663703-0A3B-4A9E-85C1-785C3FD8C61A}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{DE663703-0A3B-4A9E-85C1-785C3FD8C61A}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{DE663703-0A3B-4A9E-85C1-785C3FD8C61A}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{DE663703-0A3B-4A9E-85C1-785C3FD8C61A}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{DE663703-0A3B-4A9E-85C1-785C3FD8C61A}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{DE663703-0A3B-4A9E-85C1-785C3FD8C61A}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{DE663703-0A3B-4A9E-85C1-785C3FD8C61A}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{DE663703-0A3B-4A9E-85C1-785C3FD8C61A}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{DE663703-0A3B-4A9E-85C1-785C3FD8C61A}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{8530807D-64EC-4136-9647-9ECCB1253B02}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{8530807D-64EC-4136-9647-9ECCB1253B02}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{8530807D-64EC-4136-9647-9ECCB1253B02}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{9DD0F8A8-54A8-4FC0-A63C-E2AA31C4C575}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{9DD0F8A8-54A8-4FC0-A63C-E2AA31C4C575}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{9DD0F8A8-54A8-4FC0-A63C-E2AA31C4C575}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{28B4D5F6-C147-4897-B7A1-E615CB6C86C9}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{28B4D5F6-C147-4897-B7A1-E615CB6C86C9}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{28B4D5F6-C147-4897-B7A1-E615CB6C86C9}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{FB13415D-7F5B-4315-87BF-1A19DB016338}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{FB13415D-7F5B-4315-87BF-1A19DB016338}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{FB13415D-7F5B-4315-87BF-1A19DB016338}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{3F62AE5D-3042-4D61-B973-E394CF10DB58}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{3F62AE5D-3042-4D61-B973-E394CF10DB58}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{3F62AE5D-3042-4D61-B973-E394CF10DB58}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{4D3211B6-EE39-4B37-80BB-A3C794F73BD3}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{4D3211B6-EE39-4B37-80BB-A3C794F73BD3}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{4D3211B6-EE39-4B37-80BB-A3C794F73BD3}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{FE66B46F-2C2C-493D-8801-72B869F2D810}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{FE66B46F-2C2C-493D-8801-72B869F2D810}\InprocServer32
HKCU\Software\Classes\Wow6432Node\CLSID\{FE66B46F-2C2C-493D-8801-72B869F2D810}\InprocServer32
I try and un-install and re-install just the 32 bit runtime components.
Any other suggestions?
Thanks,
Carl
Hi Ludek,
Well, if you mean by 32 bit that "Enable 32-Bit Applications" is True, then yes it is:
I discovered today that the service and report WORKS with the Oracle 11.2.0.1 32-bit client (Admin install type) and the Crystal Reports runtime engine for .NET Framework 4 (32-bit) . It does NOT work with the Oracle 10.2.0.3 32-bit client.
However, on another Win 2008 R2 server with the Oracle 10.2.0.3 32 bit client and Crystal Reports 2011 (desktop/designer product), I can use Crystal desktop to preview and render the report file, I can connect, specify parameters, refresh with data and export it as a PDF.
Do you know if there is a way to submit a bug report for Crystal Reports runtime engine for .NET Framework 4 (32-bit)? Is there a way to tell if Othe racle 10.2.0.3, 32-bit, is a supported client for the runtime components?
Thanks,
Carl Trapani
Hi Don,
I checked and the first entry in the path is the oracle_home\bin directory:
C:\oracle\product\10.2.0\client_1_32bit\bin
I changed the identity of the app pool where my service is running to my domain account which is a member of the local Administrators group which has Full control permissions on the ORACLE_HOME directory and those permissions inherit all the way down to TNSNAMES.ORA, but I still get the error:
Failed to load database information. Error in File property_summary {5A04F4D3-FFA5-42E3-ABED-C46653A08B49}.rpt: Failed to load database information
Again, this seems to be a problem with the Crystal Runtime components for .NET 4 (32-bit) and the Oracle 10.2.0.3 client (32 bit). The Crystal runtime and the Oracle 11.2.0.1 client (both 32 bit) work fine. Is it possible that there is a missing DLL in the Crystal runtime component installer that would allow connections using the Oracle 10.2.0.3 client?
Carl
Hi Carl,
mmmm. If it works on your DEV PC then it should work on a stand alone PC.
In your code can you add in the ReplaceConnection Method to update the reports to the current Client?
Lou wrote kbase on that method based on my code, you may want to also run the app that generates the code for your report, makes it easier to port over.
I'm thinking possibly the report is trying to connect to a DB drvier that doesn't exist.
See this kbase article to enable DB logging also:
1553469 - How to enable Database logging in Crystal Reports for Visual Studio 2010
It should tell us what part is failing.
Don
A few more things coming out of a discussion I had with Don:
1) Compare the runtime when it works and where it fails. Use Modules for that.
2) The ReplaceConenction menthod is discussed in this blog.
3) Seeing if using the InProc RAS SDK for the logon will help may be worth a try. See KB1553921. The KB has a utility that will write out the logon info for you.
4) Make sure the app pool the app is running under is using he correct framework
5) Process Monitor may not be a bad idea either, but see below...
Both Don and I feel that if none of the above helps, creating a phone casewill be the way to go (e.g.; it's just getting too involved for forums). If this turns out to be a CR bug, the case will be refunded.
- Ludek
Dear Mr. Ludek Uher,
I am Agus from indonesia, could you help me regarding to "Failed to load database information
" ?
i want to develop a simple application (client server) that can view a report based on user's Input dynamically.
this link (http://vb.net-informations.com/crystal-report/dynamic_crystal_report_from_sql_query_string.htm) guide me to create the code.
in my development machine (local PC) the app runs well, but when i try to runs it on client machine that access to the server the app failed to run and the error message is "Failed to load database information. error in file [filename] {GUID_Value}.rpt
"
i've tried to read all solution in every forum, but i still can't find what is the mistake.
Here is the software installed on my development machine (local) :
~ Windows XP Professional SP3 (32-bit)
~ Microsoft SQL Server 2000 SP4
~ VS. Net Ultimate 2010
~ Dot Net Framework 4
~ Crystal Report for VS 2010 SP3 (32-bit)
~ CRforVS_redist_install_32bit_13_0_3 (CR runtime engine 32-bit)
Here is the software installed on my client machine :
~ Windows XP Professional SP3 (32-bit)
~ Microsoft SQL Server 2000 SP4
~ CRforVS_redist_install_32bit_13_0_3 (CR runtime engine 32-bit)
~ the folder source code
This is my snippet code:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data.SqlClient
Imports System.Data
Public Class FrmPrintExpDoc
Dim cryRpt As New ReportDocument
Public Function procesSQL() As String
Dim sql As String
Dim inSql As String
Dim firstPart As String
Dim lastPart As String
Dim selectStart As Integer
Dim fromStart As Integer
Dim fields As String()
Dim i As Integer
Dim MyText As TextObject
inSql = "SELECT " & SelectedCol & " FROM T_TKASPONS WHERE " & ValueCboxSpons & " CONVERT(datetime, " & ValueCboxDoc & " , 106) between " & "'" & valDTPExp & "'" & " and " & "'" & valDTPExpUntil & "'" & " Group By " & SelectedCol & " Order By Nama_Sponsor"
inSql = inSql.ToUpper
selectStart = inSql.IndexOf("SELECT")
fromStart = inSql.IndexOf("FROM")
selectStart = selectStart + 6
firstPart = inSql.Substring(selectStart, (fromStart - selectStart))
lastPart = inSql.Substring(fromStart, inSql.Length - fromStart)
fields = firstPart.Split(",")
firstPart = ""
For i = 0 To fields.Length - 1
If i > 0 Then
firstPart = firstPart & " , " & fields(i).ToString() & " AS COLUMN" & i + 1
MyText = CType(cryRpt.ReportDefinition.ReportObjects("Text" & i + 1), TextObject)
MyText.Text = fields(i).ToString()
Else
firstPart = firstPart & fields(i).ToString() & " AS COLUMN" & i + 1
MyText = CType(cryRpt.ReportDefinition.ReportObjects("Text" & i + 1), TextObject)
MyText.Text = fields(i).ToString()
End If
Next
sql = "SELECT " & firstPart & " " & lastPart
Return sql
End Function
Private Sub FrmPrintExpDoc_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ds As New DataSet1
ds.Clear()
Dim xserver As String
Dim objReader As New System.IO.StreamReader(FILE_NAME)
xserver = objReader.ReadToEnd
objReader.Close()
Dim kon As SqlConnection = New SqlConnection("server='" & xserver & "';uid=sa;pwd=it;database=dbLegalDoc;connect timeout=0")
kon.Open()
Dim sql As String
cryRpt.Load("\\" & xserver & "\WindowsApplication1\ReminderProj\cR_ExpDoc.rpt") 'ACCESS TO THE SERVER THROUGH LOCAL AREA NETWORK (LAN)
sql = procesSQL()
Dim dscmd As SqlDataAdapter = New SqlDataAdapter(sql, kon)
dscmd.Fill(ds, "DataTable1")
kon.Close()
cryRpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
End Sub
End Class
Thank you for your help Mr. Ludek, I would be very appreaciate your kindness. God Bless You...
regards,
Agus Salim - Indonesia
Hello Angus
In a nutshell, as far as CR is concerned, there is no database to worry about as you are passing in a dataset. To troubleshoot dataset problems, I created a blog that may help you out.
Also, do follow the instructions in this KB.
If none of the above helps, I'd like to ask you to please create a new forum thread, recapping our communication here and placing a link to this thread. (otherwise this thread starts to get way too long and also, the original poster is not using datasets)
- Ludek
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.