cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report with text(csv) data file, unable to connect on deployment.

Former Member
0 Kudos

Hi

I have a crystal report that connects to a text file using (Access/Excel DAO).

Now I wrote a C# .net code that loads this report and change the file name to the text file to a different file

using table.TableName and table.Location to the new file and location,

then I do applyLogonInfo.

This worked perfectly on the machine where I developed my report and code but when I put the

files to a different machine where I need to deploy the reports, I get the following error.

Unable to connect: incorrect log on parameters.

at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetTa

bleLocation(ISCRTable CurTable, ISCRTable NewTable)

at CrystalDecisions.CrystalReports.Engine.Table.set_Location(String value)

at ComponentCalcsReport.GenerateCrystalReport.getReportInPdf(String reportfil

e, String fileName)

I have done the following on the deployment machine.

1) I have installed the CR_runtime libraries required to be able to run crystal report applications.

2) I have put my .rpt file and the .csv database files in the correct folder.

3) I have put my exe file on the machine.

I run it from the command line.

Am I missing something like registering the DAO or creating a DSN explicitly?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

After searching through the forums I found this nice document

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0225775-88c4-2c10-bd80-829876929...

Using it's steps, I found out that when I created the report file using CR, I had the data connection set as a path

on the D drive. But the client/deployment machine did not have a D drive and hence the path to which the database was

pointing to. Therefore, the error "cannot connect to database" since the database name was pointing to D:pathToData

When I created a report that was on the C drive and it's data connection was also made from C drive then the same report worked fine on the client machine. I had to make sure that on the client machine I set up the exact same folder structure as the development machine's (i.e. C:pathToMyDataandReportFolder).

I tried using the setConnection function to change this path at run-time but did not succeed.

Answers (0)