Link to home
Create AccountLog in
Avatar of Steve Jebson
Steve JebsonFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Duplex printing in SSRS 2008

Hi,

I've been searching EE and Google for any kind of update on duplex printing in reporting services and can still find no definitive answer for this. I must be using the wrong search terms cos i can't believe that i'm alone in wanting to print duplex in ssrs !

I've been pointed towards PDFSharp but apparently this doesn't work with 2008 pdf's due to compression.

Actually, duplex printing might not be the right term as anything will print duplex on an enabled printer, it's just we have a report of invoice's (could be multiple pages per invoice) and would like to print the start of each invoice on an odd page. We export our reports to PDF prior to printing.

Any answers or potential new search terms appreciated.
Avatar of liija
liija
Flag of Finland image

Tough question, never tried anything like this. But how about this:
Normally you are not able to check the page number on body. However, with the following code you can do that:

Function PageNumber() As String    
    Return Me.Report.Globals!PageNumber    
End Function

Then - add a rectangle at the end of your report.
- Add a page break on the rectangle properties
- Add code to control the visibility of the rectangle:
=iif(code.PageNumber mod 2 = 0 ,true,false)

I must admit that right now I'm not able to test this solution 100% but I think it should work. The idea is that the rectangle at the end of the report checks on what page you are currently - and adds page break if needed.
Avatar of Steve Jebson

ASKER

Unfortunately this doesn't work as ssrs builds the whole body of the report and then adds/creates the headers/footers. I've tested your theory out though just to be sure and I  added your custom code to the report and then created a rectangle with a text box at the end of the report. I set the text box to =code.PageNumber and it just output 1 on every page.
Strange, the code part worked fine yesterday. It was getting the page number correctly on the body. Now, different machine, same versions and different data. It doesn't work... have to test more later.
You're right, it doesn't work at all.

Another approach: are you able to say for the exact row count that you are able to print on one page?

With custom code you could add logic to count the row count of the current invoice - and with that row count figure out the page count of the current invoice?

Then, with the same same rectangle approach as above, add an extra page break when needed.
No, afraid not, there's a few groups on the page and any of them could have multiple entries
Anybody else got any ideas ?
ASKER CERTIFIED SOLUTION
Avatar of wyliecoyoteuk
wyliecoyoteuk
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Hi,

We are saving it as a pdf before priinting, it's one pdf containing ALL the invoices, sorry, should have made that a bit clearer.

So basicaly we have one pdf (generated in SSRS 2008) with many invoices and each invoice maybe more than 1 page long.

Do you think the batch n print will work with that ?

Steve
I see so you want to burst a report with sections of variable length and print it duplex, but keep the first page of each section on the front of each page.
No, sorry, I don't think that BnP will do that.
You need some way to identify the end of each section and start a new page.

Actually, it may be able to, it has a couple of PDF management addons, may be worth a look.
It's looking quite promising with traction-software, i've spoken with them and there's a few options with different add ons. They also provide development COM components so i can pull a few add ons together and generate a single app to pruduce the result we're looking for.

Thanks
Good to know - though no one here (Finland) is printing invoices on paper any more.
Glad to help.
Always good to know of a new application of a trusted program.