Displaying report

Stimulsoft Reports.NET discussion
Post Reply
jamesk
Posts: 23
Joined: Thu Apr 12, 2007 12:47 pm

Displaying report

Post by jamesk »

The company I work for recently purchased the Stimul Reports and I have a question regarding displaying the compiled report.

We have an MDI application that when a used wants to run a report, we first display a filter form that we created that will allow the user to select the filter criteria. Once the user selects the filter criteria, the user then clicks a button that will generate the report and display it in the viewer. The way we pass the filter criteria to the report is to change the SQL that the report uses. The problem that I am running into is that the report that is displayed the first time shows the report just fine. If I then close the viewer and alter the filter then rerun the viewer, the report that is generated is identical to the first time it is created.

Here is a block of code that duplicates the problem:

Code: Select all

            Stimulsoft.Report.Dictionary.StiSqlSource tableSource = _report.DataSources["ds_WorkOrders"] as Stimulsoft.Report.Dictionary.StiSqlSource;
            tableSource.SqlCommand = "SELECT * FROM WorkOrders WHERE UID = 4";
        
            _report.Compile();
            _report.Render(true);
            _report.Show();

            tableSource.SqlCommand = "SELECT * FROM WorkOrders WHERE UID = 5";

            _report.Compile();
            _report.Render(true);
            _report.Show();
This code should display two different reports, the first should show a report with record UID 4, and the next report should show record UID 5. The problem is that the second report shows the exact same as the first report (they both are showind record UID 4).

I am guessing that I am missing some code that would display the reports correctly. How do I get this so that the first report would display record UID 4 and the second report would display the record UID 5?
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

Displaying report

Post by EDV Gradl »

I had a similar problem. There was a bug in the report engine. Are you sure you are using the latest version?

Marco
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Displaying report

Post by Vital »

Please place before second calling of compile method following code:

Code: Select all

_report.ResetRenderedState();
This method clear result of first compiling.

Thank you.
Post Reply