views:

309

answers:

1

Hi, i have to print my form but it is big to enter in only one page so i need to print it in 2 pages ,my poor knowledge allow me to know how print one page but hot how print in multipage . Do you have any advice how i can print in multipage,all kind of help will be appreciate.

Thanks.

Good Work

+1  A: 

You need to override the DocumentPaginator class.

This blog post helped me get it working.

What I did was create a UserControl that would show one page's (any of the pages) worth of data.

Then in the override for GetPage I created the UserControl (passing it the page number to render), then measured and arranged it (using the PageSize from the DocumentPaginator), and returned it as a DocumentPage (by passing it to the constructor of DocumentPage).

Then you need to override PageCount and PageSize, so that when PageSize is updated, the PageCount is changed.

Ray
Hi Ray,your link is helpful,Thanks so much... with it i can print in multipage ,but i did not understand in my case ,i have a document where i store data with databinding (Report) and i dont know how use the example of the blog in my case.I Created my UserControl but without luck.Do you have any help for that.However thanks again
JayJay
Sorry, the only printing I've done matched the blog post pretty closely and don't have any experience outside of that. The only suggestion I would have is to try and make your UserControl be able to display just a single page of data and be able to choose whether it shows the first or second page.
Ray