Bind DataSet to Crystal Report Web Service
I have doubt in pushing dataset to Crystal report web service. I cannot find any method to set datasource to the report.
I have created a report and publihsed as web serivce.
In client application i have used..
CViewer.reportsource = new service().report
But i dont know what is the method to bind dataset to the report...
Pls help me to solve this problem.
[591 byte] By [
BaskarBS] at [2007-12-17]
Nowhere in Crystal's documentation does it specifically address changing web service reports on the fly. It is extremely simple to do though.
In the web service constructor do:
| |
ReportDocument rd = new ReportDocument(); //load report rd.Load(Server.MapPath("report.rpt")); //set database logon rd.SetDatabaseLogon("user", "password", "server", "database"); //set parameters rd.SetParameterValue(0, "some parameter value0"); rd.SetParameterValue(1, "some parameter value1"); rd.SetParameterValue(2, "some parameter value2"); rd.SetParameterValue(3, "some parameter value3"); rd.SetParameterValue(4, "some parameter value4"); this.ReportSource = rd; |
If you send the parameters to the web service in the constructor or in an added method for the web service you can then have a single web service for all of your reports instead of generating a web service for each report.