PassQueryParametersToReport
PassQueryParametersToReport
I would like to pass a value to a report to pull the data based on the value.
For example, I have an ApplicationID an Integer that = 3 . I would like to pass that value to the report to see the information for the ApplicationID that equals 3.
I would like to do that in code, I cannot seem to find and example. I see the function 'PassQueryParametersToReport' but I am not sure of the syntax or where to use it?
Can someone give me an example or point me to the information that explains it.
I am using the current version of Stimulsoft and program in VB.net.
For example, I have an ApplicationID an Integer that = 3 . I would like to pass that value to the report to see the information for the ApplicationID that equals 3.
I would like to do that in code, I cannot seem to find and example. I see the function 'PassQueryParametersToReport' but I am not sure of the syntax or where to use it?
Can someone give me an example or point me to the information that explains it.
I am using the current version of Stimulsoft and program in VB.net.
-
- Posts: 6302
- Joined: Tue Mar 20, 2018 5:34 am
Re: PassQueryParametersToReport
Hello,
How do you register data in the report? Is it DataSet or database connection with queries?
You can use variables as parameters in the query or in Filters of the DataBand.
Please check the Parameters category on the Demo:
https://demo.stimulsoft.com/#Net/Parame ... Categories
Thank you.
How do you register data in the report? Is it DataSet or database connection with queries?
You can use variables as parameters in the query or in Filters of the DataBand.
Please check the Parameters category on the Demo:
https://demo.stimulsoft.com/#Net/Parame ... Categories
Thank you.
Re: PassQueryParametersToReport
I am using a data query with a where statement 'where applicationID = @ApplicationID.
When I test the query in the report designer it works fine. I need to move it to a web app and pass the value from a Session variable if possible, failing that Query parameter.
I will look at the link.
When I test the query in the report designer it works fine. I need to move it to a web app and pass the value from a Session variable if possible, failing that Query parameter.
I will look at the link.
Re: PassQueryParametersToReport
Thi is the code I am trying to get to run on the code behind page.
Code: Select all
Protected Sub StiWebViewer1_GetReport(ByVal sender As Object, ByVal e As StiReportDataEventArgs)
Dim report = StiReport.CreateNewReport()
Dim path = Server.MapPath("Reports/OnlineApp.mrt")
report.Load(path)
e.Report = report
e.Report.Variables.Item("@ApplicationID") = 3
End Sub
-
- Posts: 6302
- Joined: Tue Mar 20, 2018 5:34 am
Re: PassQueryParametersToReport
Hello,
Please check the following sample:
https://www.stimulsoft.com/en/samples/r ... es-in-code
Thank you.
Please check the following sample:
https://www.stimulsoft.com/en/samples/r ... es-in-code
Thank you.
Re: PassQueryParametersToReport
I understand how to create a variable. What I don't understand is what stimulsoft object/property is used to receive it for the report to make use of it when it renders.
It is more of a namespace,object, property question.
I hope this added information is useful in narrowing things down.
John W
It is more of a namespace,object, property question.
I hope this added information is useful in narrowing things down.
John W
Re: Resolved PassQueryParametersToReport
I found the syntax.
I needed to use the Dictionary object.
report.Dictionary.Variables("varApplicationID").Value = 3
I needed to use the Dictionary object.
report.Dictionary.Variables("varApplicationID").Value = 3
-
- Posts: 798
- Joined: Tue Sep 07, 2021 10:11 am
Re: PassQueryParametersToReport
Hello,
Ok.
Let us know if you need our help.
Thank you.
Ok.
Let us know if you need our help.
Thank you.