Page 1 of 1

as adding a value to a variable code to a design by

Posted: Thu Sep 29, 2011 2:45 pm
by miguels
Hi I have my report design saved on my hard drive as reporte.mrt,
which in the query data source in the query's WHERE you put a variable.

C # code and the condition I assign that variable to filter my report. but I make an error inthe show preview

so by my report
StiReport report = new StiReport();
report.Load("c:\\reporte.mrt");

later attempts to assign the condition to my variable
report.Dictionary.Variables.Items[0].Value = "pla.numemppl='1420'


and here I try to upload the report to preview or directly to the printer ... but mark me for rendering an error

report.Render(true);

if (!report.IsStopped)
{
if (reportAction == ReportAction.PreviewInWindow) report.Show();
else if (reportAction == ReportAction.Preview)
{
stvVista.Report = report;
}
else
if (reportAction == ReportAction.Print)
{
report.Print(false, printerSettings);
}
}

my question is if I need something more after you load the report and filter the data before displaying it ..


I hope they can help me thanks

as adding a value to a variable code to a design by

Posted: Fri Sep 30, 2011 1:23 am
by HighAley
Hello.
miguels wrote:Hi I have my report design saved on my hard drive as reporte.mrt,
which in the query data source in the query's WHERE you put a variable.

C # code and the condition I assign that variable to filter my report. but I make an error inthe show preview

so by my report
StiReport report = new StiReport();
report.Load("c:\\reporte.mrt");

later attempts to assign the condition to my variable
report.Dictionary.Variables.Items[0].Value = "pla.numemppl='1420'


and here I try to upload the report to preview or directly to the printer ... but mark me for rendering an error

report.Render(true);

if (!report.IsStopped)
{
if (reportAction == ReportAction.PreviewInWindow) report.Show();
else if (reportAction == ReportAction.Preview)
{
stvVista.Report = report;
}
else
if (reportAction == ReportAction.Print)
{
report.Print(false, printerSettings);
}
}

my question is if I need something more after you load the report and filter the data before displaying it ..


I hope they can help me thanks
What error do you have?

Thank you