Page 1 of 1
How to pass Parameter into SQL base Report
Posted: Mon Jun 07, 2010 5:11 am
by ssaturn
Hi,
I am trying to generate the report by passing parameter from Web Form,
Example, I want to pass @DateStart and @DateEnd parameter into a SQL query..
I using the method,
Me.stiReport1.Item("@DateStart")
Me.stiReport1.Item("@DateEnd")
compilation is no problem, the only problem I face is no result return, and Stimulsoft Report is not generated.
Anything I miss over here?
---
If I set a query without passing any parameter into the SQL, the Stimulsoft Report work fine.
Anyone can help me on this?
Thanks,
How to pass Parameter into SQL base Report
Posted: Mon Jun 07, 2010 6:04 am
by Andrew
Hello,
Do you use Stimulsoft Reports.Fx for Flex?
Thank you.
How to pass Parameter into SQL base Report
Posted: Mon Jun 07, 2010 9:33 am
by ssaturn
Hi,
Thanks for the quick reply.
I am using StiWebViewerFx..
Below is my coding
Dim ReportDateStart As DateTime = cDateStart.SelectedDate
Dim ReportDateEnd As DateTime = cDateEnd.SelectedDate
Dim Report As StiReport = New StiReport
Dim applicationDirectory As String = HttpContext.Current.Server.MapPath(String.Empty)
Dim reportFileName As String = applicationDirectory & "\Reports\reportTimeShifts.mrt"
Dim TagID As String = dlistUserName.SelectedItem.Text
Report.Load(reportFileName)
Report.Item("@TagID") = TagID
Report.Item("@DateStart") = ReportDateStart
Report.Item("@DateEnd") = ReportDateEnd
Report.Compile()
Report.Render(True)
Me.StiWebViewerFx1.Report = Report
That the full code of it, but it when come to generating the report, it give a blank..
How to pass Parameter into SQL base Report
Posted: Tue Jun 08, 2010 2:59 am
by Jan
Hello,
Please check following sample project:
www.stimulsoft.com/private/WebSqlParameters.zip
This project use WebViewer but code for WebViewerFx will be same.
Thank you.
How to pass Parameter into SQL base Report
Posted: Tue Jun 08, 2010 5:42 pm
by ssaturn
Hi,
Thanks for the reply, I will give this method a try

. Will let you know is it working or not..
:biggrin:
How to pass Parameter into SQL base Report
Posted: Tue Jun 08, 2010 10:35 pm
by Andrew
Thank you!
How to pass Parameter into SQL base Report
Posted: Wed Jun 09, 2010 3:46 am
by ssaturn
Hi,
I tried the method
Dim ReportDateStart As DateTime = cDateStart.SelectedDate
Dim ReportDateEnd As DateTime = cDateEnd.SelectedDate
Dim Report As StiReport = New StiReport
Dim applicationDirectory As String = HttpContext.Current.Server.MapPath(String.Empty)
Dim reportFileName As String = applicationDirectory & "\Reports\reportTimeShifts.mrt"
Dim TagID As String = dlistUserName.SelectedItem.Text
Report.Load(reportFileName)
Report.Compile()
Report.CompiledReport.DataSources("reportTimeShift").Parameters("@DateStart").ParameterValue = ReportDateStart
Report.CompiledReport.DataSources("reportTimeShift").Parameters("@DateEnd").ParameterValue = ReportDateEnd
Report.Render()
Me.StiWebViewerFx1.Report = Report
And it still giving me a blank page, as far as I know the loading value stop when it reach around 33%, then the report page turn blank. Event I try just put a title (textblock) in the report, it doesn't turn out as well.
Note: reportTimeShift is the name for the DataSource in MRT file
Any Idea why?
---
Another Error I encounter is when i user webreportviewer I get the error on reportTable is null, and there is no return on offsetWidth. It stop at the debug mode.. If I click on continue, nothing will get generate as well.
reportFrame.width = reportTable.offsetWidth;
reportFrame.height = reportTable.offsetHeight - heightDelta;
How to pass Parameter into SQL base Report
Posted: Thu Jun 10, 2010 1:02 am
by Jan
Hello,
Please attach your report for examination or send it to
support@stimulsoft.com.
Thank you.
How to pass Parameter into SQL base Report
Posted: Thu Jun 10, 2010 8:17 am
by ssaturn
I sent the email

hope to hear from you all soon