sending parameters from windows application to the report
sending parameters from windows application to the report
Hi
currently i designed a report with embedded parameters that work well for me.
but i want to know that is there any way to send the parameters value to the report from my windows application?
i see a video about this but in web application,i think its a little bit different in windows application.so how can i do this?
my second question is about generating the report for the second time,in a simple button i write a "strireport1.show();" code,so i can view my report,but when i try to see my report for the second time,it does not present me my form,just a blank page!.
Thanks in Advance
currently i designed a report with embedded parameters that work well for me.
but i want to know that is there any way to send the parameters value to the report from my windows application?
i see a video about this but in web application,i think its a little bit different in windows application.so how can i do this?
my second question is about generating the report for the second time,in a simple button i write a "strireport1.show();" code,so i can view my report,but when i try to see my report for the second time,it does not present me my form,just a blank page!.
Thanks in Advance
sending parameters from windows application to the report
Hi
In the most cases you can use the following simple steps to pass parameters into the report:
1. Declare a parameter in the DataSource with the following name, for example:
@MyParameter
2. After compilation of the report:
report.Compile()
3. you can assign that parameter as follows:
report["@MyParameter"] = 5;
Here are the links on how to use named and unnamed parameters:
Named parameters:
http://www.stimulsoft.com/livedemos/Rep ... eters.html
Unnamed parameters:
http://www.stimulsoft.com/livedemos/Rep ... ers_2.html
There is another method of sending parameters using of the report variable. This method is suitable in case if non of named (@myparameter) or
unnamed (?) parameters worked as it was discussed here:
http://forum.stimulsoft.com/Default.aspx?g=posts&t=504
How to send parameters for SQL query by application?
1. You can use an expression to form any part in SQL query. First, you add variables to the SQL query:
select * from customers where code = {myvariable}
2. You need to create a variable in the Report Dictionary.
3. You need to initialize a variable before report running:
C#
StiReport report = new StiReport();
report.Load("Variables.mrt");
report.Compile();
//Set Variable
report["myvariable"] = 123;
report.Render();
VB
Dim Report As StiReport = New StiReport()
Report.Load("Variables.mrt")
Report.Compile()
'Set Variable
report.Item("myvariable") = " Value "
Report.Render()
Also please open Demo.exe sample application from the standard installation of Stimulsoft Reports.Net.
Open 'SQL' category and the report Master-Detail with Parameters. Press 'Design' button. It is another example of using parameters.
And in Program Files\Stimulsoft Reports.Ultimate 2009.3 Trial\Samples\WinForms\C#\SqlParameters\ you can find a project which describes work with parameters in Stimulsoft Reports.Net.
Additional documentation you can find here:
http://stimulsoft.com/Documentation.aspx
Also we have some other video tutorials:
http://stimulsoft.com/ReportsNetVideos.aspx
stiReport1.ResetRenderedState();
Thank you.
The method of passing parameters is the same. Here you are.imax36581 wrote:Hi
currently i designed a report with embedded parameters that work well for me.
but i want to know that is there any way to send the parameters value to the report from my windows application?
i see a video about this but in web application,i think its a little bit different in windows application.so how can i do this?
In the most cases you can use the following simple steps to pass parameters into the report:
1. Declare a parameter in the DataSource with the following name, for example:
@MyParameter
2. After compilation of the report:
report.Compile()
3. you can assign that parameter as follows:
report["@MyParameter"] = 5;
Here are the links on how to use named and unnamed parameters:
Named parameters:
http://www.stimulsoft.com/livedemos/Rep ... eters.html
Unnamed parameters:
http://www.stimulsoft.com/livedemos/Rep ... ers_2.html
There is another method of sending parameters using of the report variable. This method is suitable in case if non of named (@myparameter) or
unnamed (?) parameters worked as it was discussed here:
http://forum.stimulsoft.com/Default.aspx?g=posts&t=504
How to send parameters for SQL query by application?
1. You can use an expression to form any part in SQL query. First, you add variables to the SQL query:
select * from customers where code = {myvariable}
2. You need to create a variable in the Report Dictionary.
3. You need to initialize a variable before report running:
C#
StiReport report = new StiReport();
report.Load("Variables.mrt");
report.Compile();
//Set Variable
report["myvariable"] = 123;
report.Render();
VB
Dim Report As StiReport = New StiReport()
Report.Load("Variables.mrt")
Report.Compile()
'Set Variable
report.Item("myvariable") = " Value "
Report.Render()
Also please open Demo.exe sample application from the standard installation of Stimulsoft Reports.Net.
Open 'SQL' category and the report Master-Detail with Parameters. Press 'Design' button. It is another example of using parameters.
And in Program Files\Stimulsoft Reports.Ultimate 2009.3 Trial\Samples\WinForms\C#\SqlParameters\ you can find a project which describes work with parameters in Stimulsoft Reports.Net.
Additional documentation you can find here:
http://stimulsoft.com/Documentation.aspx
Also we have some other video tutorials:
http://stimulsoft.com/ReportsNetVideos.aspx
Please call the following method to reset rendering state of the report before launching Show() method:my second question is about generating the report for the second time,in a simple button i write a "strireport1.show();" code,so i can view my report,but when i try to see my report for the second time,it does not present me my form,just a blank page!.
Thanks in Advance
stiReport1.ResetRenderedState();
Thank you.
sending parameters from windows application to the report
thanks,but...
my code is like this:
StiReport report = new StiReport();
report.Load(".//Reports//Report_eghamat.mrt");
report.Compile();
report["@mahal"] = ComboBox1.Text;
report.Render();
report.Show();
but when it showes my report its empty,just i see my report header
.
it seems that the parameter don't send to my report correctly.
Thanks in advance
my code is like this:
StiReport report = new StiReport();
report.Load(".//Reports//Report_eghamat.mrt");
report.Compile();
report["@mahal"] = ComboBox1.Text;
report.Render();
report.Show();
but when it showes my report its empty,just i see my report header

it seems that the parameter don't send to my report correctly.
Thanks in advance
sending parameters from windows application to the report
thanks,but...
my code is like this:
StiReport report = new StiReport();
report.Load(".//Reports//Report_eghamat.mrt");
report.Compile();
report["@mahal"] = ComboBox1.Text;
report.Render();
report.Show();
but when it showes my report its empty,just i see my report header
.
it seems that the parameter don't send to my report correctly.
Thanks in advance
my code is like this:
StiReport report = new StiReport();
report.Load(".//Reports//Report_eghamat.mrt");
report.Compile();
report["@mahal"] = ComboBox1.Text;
report.Render();
report.Show();
but when it showes my report its empty,just i see my report header

it seems that the parameter don't send to my report correctly.
Thanks in advance
sending parameters from windows application to the report
Hello,
Please check attached sample project.
Thank you.
Please check attached sample project.
Thank you.
- Attachments
-
- 317.SqlParameters.zip
- (39.83 KiB) Downloaded 1065 times
sending parameters from windows application to the report
Thank you.
i found my mistake .
i found my mistake .
sending parameters from windows application to the report
Hi
Please let us know if any help is required.
Thank you.
Please let us know if any help is required.
Thank you.
Re: sending parameters from windows application to the repor
Hello,
Please try to use the following code:
Please try to use the following code:
Code: Select all
report.Dictionary.DataSources["DataSourceName"].Parameters["ParameterName"].Value = value;