on 03-10-2009 8:36 AM
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)
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.