PDF Subselect - Automatic new page

Hi!

I have a PDF report with a subselect. When the subselect is more than 15 lines, I want the report to create a second page.

Can someone help me how to do that? I have tried using a macro under Layout PDF/code but with no luck.

Will really appreciate if someone can assist.

Regards
Jacques

Re: PDF Subselect - Automatic new page

Maybe inside the subselect you can use pagebreak,

for ex:
foreach ({pdf_report} as $NM_ind => $Dados)
{
sc_pdf_print_sub_sel($cell_1[$NM_ind]);


sc_pdf_print_sub_sel($cell_x[$NM_ind]);

sc_pdf_set_auto_page_break(‘auto’,‘30’);
}

This will break the page 3 cm from the bottom. Just use the appropriate height to break the page (i.e. the height where your 15th line will end to the bottom of the page… instead of ‘30’ or 3 cm in the sc_pdf_set_auto_page_break…) …

Hope it works.

Re: PDF Subselect - Automatic new page

Hi Ishwor!

Firstly, thanks allot. It worked!

Second, but there is another problem. The second page does not show my template (background) and all the other information. It is blank with only the rest of the sub-select. Is there a way that all the pages will show the template with info and the amount of lines will determin the amount of pages automatically.

I hope you can assist or anyone else.

Regards
Jacques

Re: PDF Subselect - Automatic new page

How about putting the same image again inside the subselect above all sub_sel

ex:

foreach ({pdf_report} as $NM_ind => $Dados)

{
sc_pdf_image(’…/_lib/img/yourbgimage.ext(or whereever your image is)’,x,y,W,H);

sc_pdf_print_sub_sel($cell_1[$NM_ind]);


sc_pdf_print_sub_sel($cell_x[$NM_ind]);

sc_pdf_set_auto_page_break(‘auto’,‘30’);

}

Re: PDF Subselect - Automatic new page

Hi!

I have tried it, but it did’nt work so well. I am using this pdf_report for my invoicing document, but can’t get it to work beyond the first page.

My first page works 100%, but when I have more than 15 invoice lines and it must go over to the second page it does not display the first page info and does not display the background (template).

Have anyone had this problem in the past and what will the correct way be to program it to work this way. I am desperate because it is the only thing holding me back of releasing this project to my client.

Appreciate your assistance so far.

Kind Regards
Jacques