Hi,
I am new to Dynamics Nav, our company is in the process of implementing Dynamics Nav at the moment and I'm trying to setup the Customer Statements report. The thing I need to do is to print the statments as a batch (we would generally print a batch of 1000 - 1500 statements once a month for our account holders). We would like to print double sided (duplex) to the printer. When printing though a customer statement may have only one page, in this instance if you are sending to the printer in duplex then you have a problem with the next page being printed on the reverse of the first page (end up with different customer statements on same page).
Now to what hopefully someone can point me in the right direction on. I have tried using the CurrRepor.NEWPAGE function to force a blank page in the correct places (after a statement that had odd number of pages to keep the duplexing in line) but this does not result in me getting a blank page in the output. I know it is being done at the correct times as the Page number printed shows the page number increment. Additionally I have set PrintOnlyIfDetail to No thinking that this may have suppressed the output but no good here either.
Does anyone have any experience doing something like this or any advice on what I could try next? How can I easily get a blank page in the printer output or what might I be missing here?
Thanks,
David.
0
Comments
P.S.: The "right place" to put that page break, is not the odd/even pages, but at the point of change of customer no.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I haven't tried something like this and I don't know how the printer behaves when it automatically prints on both sides. You could try it though.
if the customer ends in one page only, the new page print the other customer! sorry, i completely missed this part!
kapamarou solution can work, but there's also the last resource: count the printable lines for each customer.
for example: if you know that every page can contain a maximum of X, then you can count the lines to be printed for each customer, and do something like this:
count the lines to be printed for each customer and divide that number for the max no. of lines printable on each page.
if the result is <= 1 perform a double page break, otherwise, do a single page break...
example:
max printable lines per page = 20
lines to be printed for customer A = 10
lines to be printed for customer B = 30
lines to be printed for customer C = 50
customer A: (10 lines in the first page only) 10/20 = 0,5: double page break at the end of the customer
customer B: (20 lines in the first page, 10 in the second page) 30/20 = 1,5: single page break at the end of the customer
customer A: (ten lines in the first page only) 50/20 = 2,5: single page break at the end of the customer
it's crappy, but it should work, depending on the possibility to forecast the number of lines for every customer :-k
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I ended up adding an integer dataitem at the end of the report and indenting it so it runs once after each customer record - then in the body part of the page I added a large area of whitespace to the section to trigger the new page. In code I do the following to determine if I should show the section or not (add a blank page or not):
IF CurrReport.PAGENO MOD 2 <> 0 THEN // when the page counter is uneven send a blank page and increment counter.
BEGIN
intPageCount:= intPageCount + 1;
CurrReport.SHOWOUTPUT(TRUE);
END
ELSE
BEGIN
CurrReport.SHOWOUTPUT(FALSE);
END;
This works but long term I think the solution of calling the report up one record at a time from another report is the best solution.