Page 1 of 1

Only 1 Page Displayed

Posted: Wed Oct 24, 2012 7:26 pm
by kinga
Hi

I have created a report and populated it with data (116 pages).
Using the Web Viewer I see page 1 of the report (all good :D ) see attachment Page1.png

As soon as I hit "next page" all pages disappear :( see attachment Page2.png

Please help

Thanks

Andy

Re: Only 1 Page Displayed

Posted: Thu Oct 25, 2012 5:58 am
by Alex K.
Hello,

Please try to set the RenderMode to "AjaxWithCache" value for WebViewer component.

Thank you.

Re: Only 1 Page Displayed

Posted: Thu Oct 25, 2012 9:50 am
by kinga
Hi Thanks for your quick response.

I have set the rendermode to "AjaxWithCache" and this has fixed my initial problem :D

The problem I have now is that when I change to query to my report and run it again, I get the cached report, not the new one :(

Below is my code I use to run my report. The _SQL variable does change!

// CREATE A NEW REPORT INSTANCE
StiReport rpt = new StiReport();

// LOAD REPORT
rpt.Load(Server.MapPath("~\\Reports\\rptTastingNotesByJudge.mrt"));

// POINT TO SERVER
String _connectionString = ConfigurationManager.ConnectionStrings["DecanterConnectionString"].ConnectionString;
rpt.Dictionary.Databases.Clear();

// ADD DB CONNECTION
rpt.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("DecanterDAWA", _connectionString));

// MODIFY REPORT QUERY
((Stimulsoft.Report.Dictionary.StiSqlSource)rpt.Dictionary.DataSources["vw_TastingNotes"]).SqlCommand = _SQL;

// SYNC DATA
rpt.Dictionary.Synchronize();

// BUILD NEW REPORT
rpt.Render();

// ADD CACHE
StiWebViewer1.RenderMode = StiRenderMode.AjaxWithCache;

// ADD REPORT TO VIWER
StiWebViewer1.Report = rpt;

// RENDER REPORT
StiWebViewer1.Report.Render(true);

Do I need to "clear" the cache? How?

Many Thanks

Andy

Re: Only 1 Page Displayed

Posted: Fri Oct 26, 2012 9:45 am
by HighAley
Hello.

Please, try to use next code:

Code: Select all

// ADD REPORT TO VIWER
StiWebViewer1.ResetReport();
StiWebViewer1.Report = rpt;
You don't need to do it:

Code: Select all

StiWebViewer1.Report.Render(true);
Thank you.

Re: Only 1 Page Displayed

Posted: Fri Oct 26, 2012 10:17 am
by kinga
Hi

Works perfectly :D

Thanks for all your help

Regards
Andy

Re: Only 1 Page Displayed

Posted: Fri Oct 26, 2012 11:18 am
by HighAley
Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.