Only 1 Page Displayed

Stimulsoft Reports.NET discussion
Post Reply
kinga
Posts: 9
Joined: Mon Mar 26, 2012 10:22 am
Location: England

Only 1 Page Displayed

Post 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
Attachments
Page2.PNG
Page2.PNG (7.14 KiB) Viewed 1801 times
Page1.PNG
Page1.PNG (73.44 KiB) Viewed 1801 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Only 1 Page Displayed

Post by Alex K. »

Hello,

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

Thank you.
kinga
Posts: 9
Joined: Mon Mar 26, 2012 10:22 am
Location: England

Re: Only 1 Page Displayed

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Only 1 Page Displayed

Post 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.
kinga
Posts: 9
Joined: Mon Mar 26, 2012 10:22 am
Location: England

Re: Only 1 Page Displayed

Post by kinga »

Hi

Works perfectly :D

Thanks for all your help

Regards
Andy
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Only 1 Page Displayed

Post by HighAley »

Hello.

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

Thank you.
Post Reply