Add page

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 9:44AM
    I have no idea how to start
  • gordkgordk St.Catherines On. Canada.
    edited 9:44AM
    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 9:44AM
    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 9:44AM
    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 9:44AM
    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 9:44AM
    Try to use second TfrxReport. Prepare report for second TfrxReport and add prepared pages to first TfrxReport using TfrxReport.PreviewPages.AddFrom
  • edited 9:44AM
    The way you explained.

    I looked in the manuals just do not know how I can implement using TfrxReport.PreviewPages.AddFrom.
  • gpigpi
    edited 9:44AM
    For example:
    frxReport1.PrepareReport;
    frxReport2.PrepareReport;
    
    frxreport1.PreviewPages.AddFrom(frxreport2);
    
  • edited 9:44AM
    Instead of generating 30 pages in FR why not instruct the printer to print 30 copies?
  • edited 9:44AM
    Thanks for the help, I am sending directly to the printer. >
  • edited 9:44AM
    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.