cancel
Showing results for 
Search instead for 
Did you mean: 

CrystalReports 2008 and .NET C# 2008 manipulate SQL on Runtime

Former Member
0 Kudos

Hello,

I need to manipulate the SQL at runtime. We have some Statistics, that have to be manipulated by search criteria filled in our application.

So I have to set these criteria at runtime.

I earlier versions of CrystalReports we used the RDC and to get the SQL by the sqlquerystring property,

manipulate the SQL and set it again.

What can be done in CrystalReports 2008 with C# .NET?

Regards Christian.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

There is no way to pass an actual SQL Query to the report - not since version 9 of Crystal Reports and certainly not with the Crystal reports .NET SDK. However you could create a dataset and pass that to the report. Essentially the line of code that passes the dataset would be:

explicitly

crReportDocument.Database.Tables(0).SetDataSource(dataSet.Tables("NAME_OF_TABLE"))

or implicitly

crReportDocument.SetDataSource(dataSet) or crReportDocument.SetDataSource(dataSe.Tables(0))

See the following for more information:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2091d0c3-da1d-2b10-22be-a3426b18...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/401c4455-a31d-2b10-ae96-fa57af5a...

Ludek

Answers (0)