Page 1 of 1

Displaying report

Posted: Fri May 18, 2007 6:19 pm
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?

Displaying report

Posted: Sat May 19, 2007 2:12 am
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

Displaying report

Posted: Sat May 19, 2007 3:24 am
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.