I have some input box which allow user input data, and then I create dynamic SQL select command , How do i put my SQL select command back to Report (such like reportviewer1...), and force this report to Fill data? I can not use parameter for SQL because these input data is too complicate.
4 Answers, 1 is accepted
0

phelix
Top achievements
Rank 1
answered on 09 Sep 2008, 01:40 PM
you can build your sql statement in your report viewer aspx and pass this sql statement to your data access layer and return a dataset and then pass this dataset to your report as datasource
0

tony
Top achievements
Rank 1
answered on 09 Sep 2008, 01:57 PM
Hi Phelix,
Appreciate for reply!
Can you please provide 'pass this dataset to your report as datasource'
Syntax for me? I have been looking for this solution for a couple of
Days and nights , but still can not found answer on this issue.
Is it somthing like :
DataViewer1.DataSource = Mydataset;
Appreciate for reply!
Can you please provide 'pass this dataset to your report as datasource'
Syntax for me? I have been looking for this solution for a couple of
Days and nights , but still can not found answer on this issue.
Is it somthing like :
DataViewer1.DataSource = Mydataset;
DataVieweer1.Databind();
Please advice.
0

phelix
Top achievements
Rank 1
answered on 09 Sep 2008, 02:09 PM
in your reportviewer.aspx. create this functioin and when you need to refresh it call this function
private void LoadReport(){
//build your sql based on user's entry
string strSQL = ....
//execute dataset
DataSet oDS = ...
//Create an instance of your report class
MyReport report = new MyReport();
report.DataSource = oDS;
this.ReportViewer1.Report = report;
}
private void LoadReport(){
//build your sql based on user's entry
string strSQL = ....
//execute dataset
DataSet oDS = ...
//Create an instance of your report class
MyReport report = new MyReport();
report.DataSource = oDS;
this.ReportViewer1.Report = report;
}
0

tony
Top achievements
Rank 1
answered on 11 Sep 2008, 07:41 PM
Hi phelix,
Appreciate your help! Your post is good for my request.
I try to implement but still have some other issue which
did not allow my sql command to show up in Report.
After some try and error , I decide to sit back and
doing somthing else (like use report parameter) for
solve this Report and wait for i had more experience about
Telerik.Reporting then will come back to finished this SQL
command driven report idea.
Thanks again!!
Appreciate your help! Your post is good for my request.
I try to implement but still have some other issue which
did not allow my sql command to show up in Report.
After some try and error , I decide to sit back and
doing somthing else (like use report parameter) for
solve this Report and wait for i had more experience about
Telerik.Reporting then will come back to finished this SQL
command driven report idea.
Thanks again!!