StopBeforePage on reports with large data

Stimulsoft Reports.WEB discussion
User avatar
Buknoy Palaboy
Posts: 48
Joined: Fri Jun 22, 2012 1:34 am
Location: Philippines

StopBeforePage on reports with large data

Post by Buknoy Palaboy »

Hi Stimulsoft Team,

Remember my post regarding large data resulting to blank pages?
http://forum.stimulsoft.com/viewtopic.php?f=14&t=5884

I have recently discovered the stimulsoft report property StopBeforePage. Now this property plays a big role on large reports
such as ours since I can limit the number of pages being shown on the WebViewer. The good thing about this discovery is that
if the report is not previewed on the WebViewer like exporting the whole report to PDF or printing it to printer, Stimulsoft report
can produced the whole 4535 pages on PDF and I assume it will also do this on the printer since I tried to print only the last page
and it did print the page. The problem with this logic now is this, if I have a report with 4535 pages and use the StopBeforePage to
view 100 pages only then export my report to PDF, it will only export pages 1 to 100 of the report. What I want to do is to set
the StopBeforePage again to 0 so that it will export/print the whole report to whatever format I like. Is this possible?
Thanks in advance, I hope there is a way to solve this!

Note: Currently viewing pages 1 to 100 of the report then click on the save or print button on the toolbar of the WebViewer.

Regards and Thanks,
Buknoy
User avatar
Buknoy Palaboy
Posts: 48
Joined: Fri Jun 22, 2012 1:34 am
Location: Philippines

Re: StopBeforePage on reports with large data

Post by Buknoy Palaboy »

Hi Stimulsoft Team,

Any update on this issue?

Regards and Thanks,
Buknoy
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: StopBeforePage on reports with large data

Post by Vladimir »

Hello,

You can load the report again and re-render it in the export action, for example:

Code: Select all

public FileResult ExportReport()
{
    //StiReport report = StiMvcViewerFxHelper.GetReportObject(this.Request);

    StiReport report = new StiReport();
    report.Load(reportpath);
    report.Dictionary.Databases.Clear();
    report.RegData(data);
    report.Render(false);

    return StiMvcViewerFxHelper.ExportReportResult(report, this.Request);
}
Thank you.
User avatar
Buknoy Palaboy
Posts: 48
Joined: Fri Jun 22, 2012 1:34 am
Location: Philippines

Re: StopBeforePage on reports with large data

Post by Buknoy Palaboy »

Hi Vladimir,

Thanks for your reply.

I was able to do the same thing, loading the report again and do the export. Now the problem is, how do I do the same thing
for printing? I don't find any action function for print.

Regards and Thanks,
Buknoy
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: StopBeforePage on reports with large data

Post by Vladimir »

Hello,

Unfortunately, this will not work in the 'Default' print mode, because in this mode viewer not requests a report from the server. You can use the 'Print as HTML' or 'Print as PDF' modes. These modes can be selected in the print dialog box.

Thank you.
User avatar
Buknoy Palaboy
Posts: 48
Joined: Fri Jun 22, 2012 1:34 am
Location: Philippines

Re: StopBeforePage on reports with large data

Post by Buknoy Palaboy »

Hi Vladimir,

Can't we have an override of the printing event so that we can put the same code as you did above but instead of:
public FileResult ExportReport()

maybe we can have

public FileResult PrintReport()

With this, we can load the report again and then print without the StopBeforePage.

Regards and Thanks,
Buknoy
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: StopBeforePage on reports with large data

Post by Vladimir »

Hello,

MvcViewerFx has three modes of printing: 'Default', 'Print as HTML', 'Print as PDF'. In the first mode, printing is carried by Flash application, and it is necessary to fully load a report in the viewer - but in this case you will have a problem that you have described here: http://forum.stimulsoft.com/viewtopic.php?f=14&t=5884. In the other two modes this problem should not be, as in this case, the report is processed on the server side.

Thank you.
User avatar
Buknoy Palaboy
Posts: 48
Joined: Fri Jun 22, 2012 1:34 am
Location: Philippines

Re: StopBeforePage on reports with large data

Post by Buknoy Palaboy »

Hi Vladimir,

If that is the case, can we atleast warn the user that the report will have more than 1,000 pages and that they have the option to do the "Print as HTML" and "Print as PDF". But for other reports that will not exceed 1,000 pages, the user will be able to print as is. Do you think this logic is possible? Any suggestion as to how we can handle the printing side since the viewing is solved by "StopBeforePage".

Regards and Thanks,
Buknoy
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: StopBeforePage on reports with large data

Post by Vladimir »

Hello,

We can add a special option that will hide the 'Default' printing method. In this case, leaving only the 'Print as HTML' and 'Print as PDF' methods that will be processed in the ExportReport() action.

Thank you.
User avatar
Buknoy Palaboy
Posts: 48
Joined: Fri Jun 22, 2012 1:34 am
Location: Philippines

Re: StopBeforePage on reports with large data

Post by Buknoy Palaboy »

Hi Vladimir,

I tried to do a "Print as PDF" and have all pages included on the pdf file, which means it works fine. The problem is, when I tried to do
"Print as HTML", it only shows what was retrieved in the flash application. Based on my observation, the modes: "Default" and "Print as HTML" have the same behavior unlie the "Print as PDF" which follows the code written at the "ExportReport" action. As long as the report does
not pass by the flash application, we can retrieve all the records that the report needs. So if I generate a report without using StiMvcViewerFx,
then render it and use the function report.Print, it will print everything. Am I correct so far? If my observations are correct, then maybe, that
idea of printing the report without the flash application would be possible upon click of the print button if we can modify how printing should behave based on our specifications. The only drawback that I see on this logic is that, if the report page is interactive like the user change the sorting, etc., that will not take effect since the report will be reloaded upon print without the flash application. Any comment on the my suggestion/observation?

Regards and Thanks,
Buknoy
Post Reply