Add page

edited 11:50AM in FastReport 4.0
I need to print a report several times within a "for", I'm not using the database as I could do to add the same page repeatedly one after the other?

Something like this:

......

for x:=1 to 30 do
begin
try
frxReport1.Variables := '''' + V_NAME + '''';
frxReport1.Variables := '''' + V_VENC + '''';
frxReport1.Variables := '''' + V_BODY + '''';

frxReport1.AddNewPage ??????
end;
finally
frxReport1.ShowReport;
end;

Comments

  • edited 11:50AM
    I have no idea how to start
  • gordkgordk St.Catherines On. Canada.
    edited 11:50AM
    more info please, it is not clear as to what you are trying to do.
    it seems like all you are doing is making copies of the same report.
    If so just set the number of copies after loading the report and before calling showreport.
  • edited 11:50AM
    Must generate the same report many times I do not know how.

    values ​​are passed to the report this way:

    frxReport1.Variables := '''' + V_NAME + '''';
    frxReport1.Variables := '''' + V_VENC + '''';
    frxReport1.Variables := '''' + V_BODY + '''';

    I do not know how to add those pages .


  • gpigpi
    edited 11:50AM
    Try like this:
    for x:=1 to 30 do
    begin
    try
    frxReport1.Variables['C_NAME'] := '''' + V_NAME + '''';
    frxReport1.Variables['C_VENC'] := '''' + V_VENC + '''';
    frxReport1.Variables['C_BODY'] := '''' + V_BODY + '''';
    
    frxReport1.PrepareReport(x=1);
    end;
    finally
    frxReport1.ShowPreparedReport;
    end;
    
  • edited 11:50AM
    gpi, thank you. it is creating the reports as I wanted.

    Only one problem, when it generates over 60 reports which begins to generate the other very slow. Is there any way to optimize IT?

    I must apologise for my English, thanks for your attention.
  • gpigpi
    edited 11:50AM
    Try to use second TfrxReport. Prepare report for second TfrxReport and add prepared pages to first TfrxReport using TfrxReport.PreviewPages.AddFrom
  • edited 11:50AM
    The way you explained.

    I looked in the manuals just do not know how I can implement using TfrxReport.PreviewPages.AddFrom.
  • gpigpi
    edited 11:50AM
    For example:
    frxReport1.PrepareReport;
    frxReport2.PrepareReport;
    
    frxreport1.PreviewPages.AddFrom(frxreport2);
    
  • edited 11:50AM
    Instead of generating 30 pages in FR why not instruct the printer to print 30 copies?
  • edited 11:50AM
    Thanks for the help, I am sending directly to the printer. >
  • edited 11:50AM
    caramagro wrote: »
    I need to print a report several times within a "for", I'm not using the database as I could do to add the same page repeatedly one after the other?

    Something like this:

    ......

    for x:=1 to 30 do
    begin
    try
    frxReport1.Variables := '''' + V_NAME + '''';
    frxReport1.Variables := '''' + V_VENC + '''';
    frxReport1.Variables := '''' + V_BODY + '''';

    frxReport1.AddNewPage ??????
    end;
    finally
    frxReport1.ShowReport;
    end;




    Do this case already solved?]
    I want to know the solution..
    Thanks

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.