cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report >> Failed to load database information. Error in file temp_ {GUID_Value} .rpt

Former Member
0 Kudos

Dear Senior Programmer,

Please help me,

I am Agus from indonesia, could you help me regarding to "Failed to load database information. Error in file temp_ {GUID_Value} .rpt" ?

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 dynamic query 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 temp_ {GUID_Value} .rpt"

i've tried to implement 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 source code folder

this is my snippet code:

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data.SqlClient
Imports System.Data

Dim cryRpt As New cR_ExpDoc

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")

         sql = procesSQL()

         Dim dscmd As SqlDataAdapter = New SqlDataAdapter(sql, kon)

         dscmd.Fill(ds, "DataTable1")

         kon.Close()

         'cryRpt.SetDataSource(ds.Tables(0))
         cryRpt.Database.Tables(0).SetDataSource(ds)
         CrystalReportViewer1.ReportSource = cryRpt
         CrystalReportViewer1.Refresh()

End Sub

Any Help would be very appreciated, thank you so much.

regards,

AGUS SALIM - Indonesia (agus.salim@asia.com)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Mr. Ludek,

I have thinking over and all over again regarding to the error "failed to load database information. error in file temp_ " in my client machine.

I just realized that the EXE file is cannot stand alone to running it, the EXE file need the [app_name].exe.config in the same directory so the application can run and load the crystal report successfully.

so these is my conclusion:

1. the app.exe.config is all in one package which cannot be separated with the EXE file.

2. the supporting component such as dll files, app.exe.config etc CANNOT be combined into the EXE file

is it true my conclusion above ?

is this what do you want to explain to me right ?

if i am right, then this discussion can be closed and the ANSWERS IS RESOLVED.

Thank you so much for your help and big apologize for my dullness.

Kind Regards,

Agus Salim

former_member183750
Active Contributor
0 Kudos

Yes, that is all correct.

- Ludek

Answers (3)

Answers (3)

Former Member
0 Kudos

Dear Senior Programmer,

@LudekUher and @DanielKelleher

Regarding to my error problem "failed to load database information. error in file temp...."

Then i tried to compare the .exe file by using Modules Utility, here is the result :

the EXE FILE (Failed to run crystal report) there is no crdb_adoplus.dll and crdb_adoplus_RES_EN.dll loaded

but on the EXE FILE (SUCCESS to run crystal report) i can find the .dll above

so, could you show me how to include the crdb_adoplus.dll on my EXE file when i debug n build the exe file...

Thank you so much,,

regards,

Former Member
0 Kudos

Pardon me Mr. Ludek,

but i've already configure and include the app.config before.

i am very confuse related this error "failed to load database information. error in file temp..."

the .exe file runs well on my development machine, but cannot run on my client machine.

when i am using the module utility,

i can find the crdb_adoplus.dll in my development machine, but i didn't found the crdb_adoplus.dll in my client machine ?

the error message just show "failed to load database information. error in file temp..."

NOT "Could not load file or assembly 'file:///<Path>crdb_adoplus.dll' or one of its dependencies"

am i suppose to create the setup/installer file first to deploy in my client machine ?

I have read all your article related to troubleshooting with crystal report, but i still cannot find the source problem ?

I hope this problem will be resolved soon with a favor from the senior programmer,

Thank U

regards

former_member183750
Active Contributor
0 Kudos

Your "app.config", should have the same name as your app exe. E.g. if the app is called myApp.exe, the config file should be called myApp.config. And of course it must be in the same directory as myApp.exe. Is this the case?

- Ludek

Former Member
0 Kudos

Hi Mr. Ludek, hope you're always in best condition

Regarding this error "failed to load database information. error in file temp..."

below are my steps to test my application on the client machine, so the error above could happened :

1. I don't create an installer/Setup project to deploy the application, i just copied all SOURCE CODE into one folder and place it on the client machine.

2. I copied the EXE file from the bin folder into my client desktop

3. I ran the EXE file and the error above is show up.

BUT, when i ran the EXE file directly or create the shorcut directly from the bin folder which include many files and WGA.exe.config the application runs well and the report executed successfully.

notes:

i have already include the config file (.config) into my project solution manually since that file didn't create automatically by the visual studio.net and the name of the config file is app.config NOT WGA.config, is it okay ?

BUT, when i follow your suggest before >> "...should have the same name as your app exe..."

i tried to rename my app.config into WGA.config,

came this error:

Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information

whereas, I already added this code either into app.config :

<startup useLegacyV2RuntimeActivationPolicy="true">

      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />

  </startup>

so what is the conclusion for my problem,

can i create an application by including all files JUST INTO one EXE file ? (the config file automatically directly included into the EXE file, not separated)

am i should use the SETUP/INSTALLER project to deploy the application, so related files could be automatically loaded and successfully accessed by the EXE file ?

Thank you so much for your help and i am sorry for this inconvenience because bothering you,

OMG, why so hard to be an expert in programming

regards,

Agus Salim - Indonesia

former_member183750
Active Contributor
0 Kudos

Hello Angus

To be honest, I stopped reading right after your point one:

1. I don't create an installer/Setup project to deploy the application, i just copied all SOURCE CODE into one folder and place it on the client machine.

You must use either the MSM, MSI or ClickOnce deployments to install the CR runtime on client computers. No way to make CR work with a simply copy of files... See this for links to runtime files:

http://scn.sap.com/docs/DOC-7824

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Hi Mr. Ludek,

as my first posting above dated on June 29th 2012, i gave an explanation for the installed software on my client machine (you can check my first posting above)

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) >>>> i am using the .msi 32bit

~ the source code folder

after the latest CR for VS2010 is released (SP4), i directly install the .msi 32 bit (CR Runtime SP 4) into my client machine and still have the same problem "failed to load database information. error in file temp..."

I hope you still want to continue read my last posting related to the config file above hehehehe

Have a nice weekend, Mr. Ludek

kind regards,

former_member183750
Active Contributor
0 Kudos
Former Member
0 Kudos

Hello Agus,

The "failed to load the database info" error tells us that the dataset isn't being filled properly, or isn't making it to the report document object properly. The code you're using looks about right, though there are a few things to try.

First, confirm that your dataset is being populated on the client machine. You can add some code to write out your dataset as XML to a file location and make sure there's data in there.

Regarding the code, please comment out the CrystalReportViewer1.Refresh() line of code. You shouldn't need it. Finally, uncomment the first SetDataSource line of code and just set the dataset without referencing Table(0). This code should look like this - "cryRpt.SetDataSource(ds)". Be sure to comment out the other SetDataSource code line.

I hope this helps!

Sincerely,

Dan Kelleher