Skip to Content
author's profile photo Former Member
Former Member

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

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?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2011 at 04:22 PM

    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-8298769293de?quicklink=index&overridelayout=true

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.