views:

2092

answers:

1

Okay here is the scenario I have a VB6 application that is getting re-written for asp.net 3.5. I have a grundle of Crystal Reports that are getting updated to Crystal Reports 10.5 (which is included in Visual Studio 2008). All of the old reports used OLEDB. What I am doing is taking the sql statements used in the reports and putting them in the database. I next run an automated process to create a Dataset from those select statements and I serialize the DataSet and save the schema and data as an XML document. I then go into the old report update it to Crystal Reports 10.5 and change the Data Source location so that it uses the XML document.

When the report is run I create the same DataSet and instead of serializing it as XML I assign it to the report (see below)

 rd.Database.Tables(0).SetDataSource(ds)

I have tested this and do not get any errors if I create the report new but if I take an existing report and change the database location I get the following error

Invalid Argument provided. Failed to open a rowset. Error in File C:\DOCUME~1\username\LOCALS~1\Temp\R-302 {D49E0C73-47AC-4363-AAD5-E925DFCF446E}.rpt: Invalid argument for database. at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream

It seems as if the report is still trying to connect using OLEDB to the old database. I have been able to get a report to work if I rewrite it using the exact same logic but the updated reports through the above error. How do I fix it?

A: 

How exactly are you changing the datasource location? Like this or are you doing it through code?

dotjoe
Yup I am trying to change the DataSource via the designer.
runxc1 Bret Ferrier
when you go to the *set datasource location* dialog, you should be able to look at the properties to see which connection is used. Maybe you missed a table or sub-report table?
dotjoe