cancel
Showing results for 
Search instead for 
Did you mean: 

Datasource won't switch in VS 2008 CR2008

Former Member
0 Kudos

I have a report with 1 command object that originally connected to an ODBC datasource. I would now like to connect using an ADO dataset. Here is my code.

myReportsDocument.Load("c:\goldfish.rpt")
...set up dataset.ds
myReportsDocument.SetDataSource(ds)
myReportsDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "C:\goldfish.pdf")

I've also used myReportsDocument.Database.Tables(0).SetDataSource(ds) at line 3 to no avail. No matter what I do it seems to want to point to the ODBC connection. How can I point it to the dataset instead?

The ado dataset is pointing to an oracle database using System.Data.OracleClient.

Thanks in advance,

J

Edited by: Jason Cameron on Mar 10, 2009 3:36 AM

Edited by: Jason Cameron on Mar 10, 2009 4:41 AM (added data location of dataset)

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

See this blog re troubleshooting issues with .NET datasets:

/people/ludek.uher/blog/2009/03/02/troubleshooting-issues-with-vs-net-datasets-and-crystal-reports

If the above does not help, you say:

No matter what I do it seems to want to point to the ODBC connection.

But what exactly happens? errors, behavior, etc.? Also, have you applied the latest SP for CR 2008? SP1 is here:

https://smpdl.sap-ag.de/~sapidp/012002523100010503722008E/cr2008_sp1.exe

Ludek

Former Member
0 Kudos

I'll take a look at the troubleshooting but unfortunately what happens is ... nothing. It just points to the the old locations.

I'm running fixpack 1.2 for sp1 which I think is the latest.

hmmm it looks like it works if I change the code to:

myReportsDocument.Load("c:\goldfish.rpt")
...set up dataset.ds
myReportsDocument.SetDataSource(ds.Tables(0))
myReportsDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "C:\goldfish.pdf")

J

Edited by: Jason Cameron on Mar 10, 2009 11:12 AM

Answers (0)