Printing first page of report on paper from another tray
Printing first page of report on paper from another tray
Hi,
Is there a way to tell the report that its first page should be printer on paper from "Tray 1" and all following pages from "Tray 2". In Tray1 there is paper with preprinted headers as opposed to "Tray 2" where blank paper is stored.
I saw some entries in the forum that said you have to do this via code, is that true? If so, would you be so kind as to show me in what event and what code is needed?
Thanks and cheers,
Pascal
Is there a way to tell the report that its first page should be printer on paper from "Tray 1" and all following pages from "Tray 2". In Tray1 there is paper with preprinted headers as opposed to "Tray 2" where blank paper is stored.
I saw some entries in the forum that said you have to do this via code, is that true? If so, would you be so kind as to show me in what event and what code is needed?
Thanks and cheers,
Pascal
Re: Printing first page of report on paper from another tray
Hello.
There are Paper Source of First Page and Paper Source of Second Page property of the Page that you could use for this.
Thank you.
There are Paper Source of First Page and Paper Source of Second Page property of the Page that you could use for this.
Thank you.
Re: Printing first page of report on paper from another tray
Hi,
thanks for the answer but are these properties accessible from within the designer or only in code? I couldn't find them in the designer.
Can you show me an example on how to set these properties? If indeed this has to be done from code, then "where?" and "how?"
Thanks,
Pascal
thanks for the answer but are these properties accessible from within the designer or only in code? I couldn't find them in the designer.
Can you show me an example on how to set these properties? If indeed this has to be done from code, then "where?" and "how?"
Thanks,
Pascal
Re: Printing first page of report on paper from another tray
Any hint here? Or code snippets?
Would be greatly appreciated, thanks!
Cheers,
Pascal
Would be greatly appreciated, thanks!
Cheers,
Pascal
Re: Printing first page of report on paper from another tray
Hello.
Unfortunately, these properties were not implemented in the WPF Designer because it was impossible in WPF.
As we know it's impossible to set different paper trays for different pages.
Thank you.
Unfortunately, these properties were not implemented in the WPF Designer because it was impossible in WPF.
As we know it's impossible to set different paper trays for different pages.
Thank you.
Re: Printing first page of report on paper from another tray
Wow, that's some bad news!
I can't believe that nobody needs this!?!? This is an essential feature...
So what would you suggest as a solution? One report with different pages, two reports? Some code in some events? There's got to be a way to change the tray...
Pascal

I can't believe that nobody needs this!?!? This is an essential feature...
So what would you suggest as a solution? One report with different pages, two reports? Some code in some events? There's got to be a way to change the tray...

Pascal
Re: Printing first page of report on paper from another tray
Hello.
The main problem is that it's impossible to set paper source in WPF.
You could find more information on the Visual Studio forum.
There is no universal method to do this.
Thank you.
The main problem is that it's impossible to set paper source in WPF.
You could find more information on the Visual Studio forum.
There is no universal method to do this.
Thank you.
Re: Printing first page of report on paper from another tray
Well just as an information for anybody being confronted with the same question. I did it this way:
Using informations I gathered from http://social.msdn.microsoft.com/Forums ... windowsxps I was able to create my own ModifyPrintTicket() Method.
I then used this in a Method "GetPrinterTrays(aPrinter)" to get all trays available to a given printer and a Method "SetPrinterTray (aPrinter, aTray)" to set a given Tray in a PrintTicket and returning it.
Using the returned PrintTicket I then called PrintWithWpf the following way (simplified):
That way I am able to choose different trays for the first and all the following pages... Of course you can do this to change the tray only for the fourth and/or fifth page or whatever you need.
The drawback is, that you have to know at what printing-pagenumber you want to change the trays. So if you use bands or pages in your report and want certain bands/pages to be printed on another tray then this is not a solution for you since you can't tell after which printing-page to make the change... In this case you might want to use some events that tell you when a band/page is going to be printed and change the trays there. But I don't know how and if you can send a new PrintTicket to the Printing-System from within a PrintJob...
I hope this helps somebody
Cheers,
Pascal
Using informations I gathered from http://social.msdn.microsoft.com/Forums ... windowsxps I was able to create my own ModifyPrintTicket() Method.
I then used this in a Method "GetPrinterTrays(aPrinter)" to get all trays available to a given printer and a Method "SetPrinterTray (aPrinter, aTray)" to set a given Tray in a PrintTicket and returning it.
Using the returned PrintTicket I then called PrintWithWpf the following way (simplified):
Code: Select all
PrintTicket objPrintTicket = SetPrinterTray("MyPrinter", "TrayForFirstPage");
objReport.PrintWithWpf (objPrintTicket, false, 1, 1, ......);
PrintTicket objPrintTicket = SetPrinterTray("MyPrinter", "TrayForFollowingPages");
objReport.PrintWithWpf (objPrintTicket, false, 2, objReport.RenderedPages.Count, ......);
The drawback is, that you have to know at what printing-pagenumber you want to change the trays. So if you use bands or pages in your report and want certain bands/pages to be printed on another tray then this is not a solution for you since you can't tell after which printing-page to make the change... In this case you might want to use some events that tell you when a band/page is going to be printed and change the trays there. But I don't know how and if you can send a new PrintTicket to the Printing-System from within a PrintJob...
I hope this helps somebody
Cheers,
Pascal
Re: Printing first page of report on paper from another tray
Hello.
Thank you for your solution.
Thank you for your solution.