on 12-03-2014 9:38 AM
Hello SAP,
I am creating an application in which I required to creating a crystal report.
To assign the data Table to crystal report I had written following code.
Dim frmPreview As New frmPreview With {.strReportLocation = PstrReportFilename2_Work, .strReportDbLoacation = PstrDatabaseName2_Work}
Dim Report As New ReportDocument
Dim oledbConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & frmPreview.strReportDbLoacation & ";User Id=admin;Password=;"
Dim ConDb As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(oledbConnectionString)
ConDb.Open()
Dim dataAdapter1 As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM TK3320530", ConDb)
Dim dataTable As New DataTable("Report2")
dataAdapter1.Fill(dataTable)
Report.Load(frmPreview.strReportLocation)
Report.SetDataSource(dataTable)
frmPreview.CrystalReportViewer1.ReportSource = Report
This code works fine in development environment but when I build it and run from .exe file.
It throws the exception. at Report.SetDataSource(dataTable) statement
I am attaching a screenshot of stack trace and error message. Please take a moment to review it.
Thanks,
Rudresh Bhatt
You don't say what version of CR and .NET, so please provide that.
Also, my Japanese is not so good. I can struggle through English, Spanish, Portuguese, Czech and perhaps even Italian and French, but not Japanese . Can you translate the errors?
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for reply
I am using Crystal report 2011 and vb.net 4.5
StackTrace message:
Place CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
Location Cystaldecisions.cystalepots.engine.epotdocument.setdatasouceintenal(object val, Type type)
Location CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataTable dataTable)
Location TK3320500. FLG TK3320510bas.SUB_RptDsp3(Int32&, Boolean& DLG)
Exception Message:
Failed to load database information. .Rpt file TK3320530 {D2A808D2-0DF3-4416-A64B-B91749920835}
The error: failed to load database information.
Thnaks & regards,
Rudresh Bhatt
See if this helps;
Find the search box in the top right corner. Enter the search string 'crystal failed load database information'. When the results come up, look at the left side of the screen and under "Asset Type" select Support Notes. This will give you a good selection of KBAs to consult.
- Ludek
Hi Rudresh,
Instead of passing the datatable to report, could you print it to a datagrid on production and see if the datatable actually has any data?
Also, you could write the data to an XML file and then try to map it against the report fields. See if it throws any error message.
I suspect this could be an issue with data table fetching the data or its field mapping with the report.
Thanks,
Bhushan
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.