Page 1 of 2
Big Problem with Report.Show
Posted: Mon May 14, 2007 2:44 am
by EDV Gradl
When I do this:
Stimulreport MyReport = new Stimulreport();
// Somehow load and compile the report
MyReport.Show(true);
MyReport.Show(true);
The first time the report is show as a dialog windows, the second time nothing happens.
Could you please correct this?
Thanks, Marco!
Big Problem with Report.Show
Posted: Mon May 14, 2007 7:58 am
by Vital
We can't reproduce this problem. Can you create small test application for us?
Thank you.
Big Problem with Report.Show
Posted: Mon May 14, 2007 8:45 am
by EDV Gradl
Vital, your are right. The problem is a bit different.
Try this code:
StiReport MyReport = new StiReport();
MyReport.LoadDocument("File1.mdc");
MyReport.Show(true);
MyReport.LoadDocument("File2.mdc");
MyReport.Show(true);
Only the first report is shown, the second ignored.
The application is on its way.
Marco
Big Problem with Report.Show
Posted: Mon May 14, 2007 10:00 am
by Stéphane
I had the same problem. I don't know if it's the best answer but I call MyReport.ResetRenderedState() method before the Show method and it works.
Big Problem with Report.Show
Posted: Mon May 14, 2007 10:45 am
by EDV Gradl
Thanks for the tip, but it does not work for my. The second report is still not shown. I already tried the build from today - same result.
Big Problem with Report.Show
Posted: Mon May 14, 2007 10:52 am
by Vital
Problem fixed.
Thank you.
Big Problem with Report.Show
Posted: Tue May 15, 2007 11:04 am
by EDV Gradl
Problem fixed. New problem.
When I first load a report
I use
MyReport.Compile(Stream),
thus saving the complied report in a stream
When printing again, I load the report from the stream
with GetReportFromAssembly , thus saving the compile time.
Now when I use the compiled report from the stream and set a variable like
MyReport["MyVar"] = 100
the variable is not set at all.
It only works the first time. Seems to be the same problem I reported earlier with IsVariableExist
It worked till yesterday.
Thanks for the help
Marco
Big Problem with Report.Show
Posted: Tue May 15, 2007 3:13 pm
by Vital
Our error. Solved.
Thank you for your bug report.
Big Problem with Report.Show
Posted: Wed May 16, 2007 4:57 am
by EDV Gradl
Just to be on the safe side. This does not work as well:
StiReport MyReport = new Stireport();
MyReport.Load(@"C:\Myreport.mdc");
MyReport.Compile();
MyReport["MyVar"] = 1; // Value is set
MyReport.Render(false);
MyReport.Show(true);
MyReport["MyVar"] = 2 // Valus is not set
Would be nice, if this could work in the build from today, because my customer become kind of angry.
Big Problem with Report.Show
Posted: Wed May 16, 2007 8:08 am
by Edward
Please use the following code to initialize variable MyVar in the Compiled report.
Code: Select all
StiReport MyReport = new Stireport();
MyReport.Load(@"C:\Myreport.mrt");
..
MyReport.RegData(...);
..
MyReport.Compile();
MyReport.CompiledReport["MyVar"] = 1;
MyReport.Render(false);
MyReport.Show(true);
MyReport.CompiledReport["MyVar"] = 2;
MyReport.Render(false);
MyReport.Show(true);
In the build from May, 17 your code will work as
correctly.
Thank you.