cancel
Showing results for 
Search instead for 
Did you mean: 

About Crystal Reports for VStudio 2010 Data Source

0 Kudos

Hello.


I have an ASP Web Application with differents Crystal Reports.

These reports has a direct Database connection defined in their design.

But now I want to assign the dataSource by code, using webservice method as data source.

I have done next: When the end users open the form that displays the report, I call  the webservice and I assign the result to the report datasource, and I refresh the report.

The problem is that for each call to a report there are two queries to the database, one from the connection defined into de report and the other from the webService.


How can I indicate to the report that the connection defined into the report design is only to design the report, and not to get the data?


Thanks,

Eva Janakieff


Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

I had problems using dataset as datasource of the crystal reports. The Crystal Reports filters not are working as expected. When the end user makes a filter, the results are not returned in the original order.

So that, I decided change the database connection by code, instead to use a DataSet.
In the form I show the Crystal Report I change the databaseName:

myReport.DataSourceConnections.Item(0).SetConnection(myReport.DataSourceConnections.Item(0).ServerName, "<databaseName>", IntegratedSecurity:=True)

It works fine. But when I change the page in the report, it shows the data from the original database, used in the crystal reports design.


I tried to change the databaseName every time the form loads, but then it doesn't work the pass between pages of the crystal report, and the report doesn't mantains the filter selected.

Can you help me.


Thanks,
Eva Janakieff