Big Problem with Report.Show

Stimulsoft Reports.NET discussion
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

Big Problem with Report.Show

Post 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!
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Big Problem with Report.Show

Post by Vital »

We can't reproduce this problem. Can you create small test application for us?

Thank you.
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

Big Problem with Report.Show

Post 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
Stéphane
Posts: 74
Joined: Wed Dec 06, 2006 3:45 am
Location: Paris (France)

Big Problem with Report.Show

Post 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.
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

Big Problem with Report.Show

Post 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.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Big Problem with Report.Show

Post by Vital »

Problem fixed.
Thank you.
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

Big Problem with Report.Show

Post by EDV Gradl »

Problem fixed. New problem. :angry:

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
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Big Problem with Report.Show

Post by Vital »

Our error. Solved.

Thank you for your bug report.
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

Big Problem with Report.Show

Post 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.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Big Problem with Report.Show

Post 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

Code: Select all

MyReport["MyVar"] = 2; 
correctly.

Thank you.
Post Reply