How to batch export report for each row in a dataset?
Hi,
I have a dataset with several rows. I wish to export a PDF file for
each row (e.g.: one row one pdf file).
How am I going to do that with ReportBuilder? The following is my
attempt and it doesn't work:
begin
ppDBPipeline1.RangeBegin := rbCurrentRecord;
ppDBPipeline1.RangeEnd := reCount;
ppDBPipeline1.RangeEndCount := 1;
ppDBPipeline1.First;
while not ppDBPipeline1.EOF do begin
D := TppPDFDevice.Create(nil);
try
D.FileName := 'Random-generated-file.pdf';
D.Publisher := ppReport1.Publisher;
ppReport1.PrintToDevices;
finally
D.Free;
end;
ppDBPipeline1.Next;
end;
end;
The above loop only traverse once only.
--
Best regards,
Chau Chee Yang
E Stream Software Sdn Bhd
URL: www.sql.com.my
SQL Financial Accounting
I have a dataset with several rows. I wish to export a PDF file for
each row (e.g.: one row one pdf file).
How am I going to do that with ReportBuilder? The following is my
attempt and it doesn't work:
begin
ppDBPipeline1.RangeBegin := rbCurrentRecord;
ppDBPipeline1.RangeEnd := reCount;
ppDBPipeline1.RangeEndCount := 1;
ppDBPipeline1.First;
while not ppDBPipeline1.EOF do begin
D := TppPDFDevice.Create(nil);
try
D.FileName := 'Random-generated-file.pdf';
D.Publisher := ppReport1.Publisher;
ppReport1.PrintToDevices;
finally
D.Free;
end;
ppDBPipeline1.Next;
end;
end;
The above loop only traverse once only.
--
Best regards,
Chau Chee Yang
E Stream Software Sdn Bhd
URL: www.sql.com.my
SQL Financial Accounting
This discussion has been closed.
Comments
The easies way to accomplish this would be to create a group that breaks on
each detail record. Then use the NewFile property of the Group to export a
separate PDF file for each group.
http://www.digital-metaphors.com/rbWiki/Output/PDF/How_To...Separate_File_for_Each_Group
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com