Subject: dynamic SLq for crstalreportviewr control
Posted By: dinparacha Post Date: 11/16/2004 1:07:59 PM
I want to pass sql query from vb.net to crystal report.
I am using  crystaldecision.windows.forms.crstalreportviewr  to view the report.
To use crviewr I have two options
1. Use    Dim rptDocument As New ReportDocument as
crview.reportsouce= rptDocument (this line is ok)
 but ReportDocument has no property or method like sqlquerystring, which I can pass from vb.net to crystal report.
I also tried to populate the dataset with dynamic sql. It is pouplutating but when I assign dataset to ptDocument.SetDataSource(custDS) it still shows all records and don’t shows those records which are just in dataset.


2. second option is one that I was using in vb.6. In VB.6 we can assign     Public crydatasheet As CRAXDRT.Report to crviewer control where CRAXDRT.Report has method sqlquerystring. But in vb.net we can’t assign CRAXDRT.Report to crystaldecision.windows.forms.crstalreportviewr, because it gives error message wrong type when we use
 crview.reportsouce= crydatasheet (error wrong type for reportsource)


Any suggestions? How can I pass sqlqeury to crystal report? The query joins several tables and where clause is being built dynamically according to the user selection of different fields from vb.net form.
Thanks


Din

Go to topic 21930

Return to index page 714
Return to index page 713
Return to index page 712
Return to index page 711
Return to index page 710
Return to index page 709
Return to index page 708
Return to index page 707
Return to index page 706
Return to index page 705