SQL Query from VS to Fast Report
Hi,
I have to send custom SQL query from my application to Fast Report, How Can I do that??
I set parameter in Fast Report, and I sent the sql query to this parameter from my application
report1.SetParameterValue("sqlQuery", sqlQ);
But, To what object/data/ shall I set the parameter inside Fast Report?
Thanks,
I have to send custom SQL query from my application to Fast Report, How Can I do that??
I set parameter in Fast Report, and I sent the sql query to this parameter from my application
report1.SetParameterValue("sqlQuery", sqlQ);
But, To what object/data/ shall I set the parameter inside Fast Report?
Thanks,
Comments
- run the designer
- select the "Report" object (in the "Properties" window)
- switch to events and create the "StartReport" event handler
- write the following code in it:
I did as you said but I got no error, just the application halt:
report1.Load("calllogs.frx"); //load the report
string sqlQ = createSQLStatement(); // this will create SQL query
FastReport.Data.TableDataSource data = report1.GetDataSource("myTableName") as FastReport.Data.TableDataSource;
data.SelectCommand = (string)report1.GetParameterValue(sqlQ);
report1.Show();
Is there is something wrong in this code??