开发者

WinForms.ReportViewer - number of pages that are rendered

Using WinForms.Re开发者_开发技巧portViewer I'd like to get a hold of the number of pages that are rendered.

I need to generate a contents page for a collection of reports and to do this I need to know how many A4 pages are rendered for each report so that I can subsequently generate the contents page. The reports are able to be edited by the end user and replaced so that the next time it's run the number of pages could be different and so the contents would need to be re-generated.

I've managed to get the reports to load at runtime based on the files provided by the end user, but getting hold of the number of pages the report renders is proving quite difficult. I know I can get this information in the header of the report, but know of no way to get that information back out, programatically.


Try using:

int pageCount = Viewer1.Document.Pages.count;


I actually just needed to do an Application.DoEvents() call after calling the display method, before checking the page count. It obviously renders the report in a separate thread...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜