Discussion:
Rave Reports PDF and Print in same run?
(too old to reply)
Vincent
2006-12-05 13:25:13 UTC
Permalink
When I excute my code, and tell it to print, it works fine. If I tell it to
make a PDF it also works fine, if I try to do both in the same loop, only
the PDF will work. Here is some code snipets...

While NOT(ReportClass.EOF) Do
Begin
ReportTable := ReportClass.GeneratePrintRecord;
RvProject.Open;
RvProject.SelectReport('SimpleReport',False);
RvProject.SetParam('CustomerName',ReportClass.AccountName + ' ('
+ReportClass.AccountNumber + ')');
RvProject.SetParam('HeaderKind','H1');
RvSystem1.DefaultDest := rdPrinter;
RvSystem1.DoNativeOutput := True;
RvSystem1.RenderObject := nil;
FileName := 'Reports\' + ReportClass.AccountName + '.pdf';
RvProject.Execute;//Print it

RvSystem1.DefaultDest := rdFile;
RvSystem1.DoNativeOutput := False;
RvSystem1.RenderObject := RvRenderPDF1;
RvSystem1.OutputFileName := FileName;
RvProject.Execute;//Make PDF

RvProject.Close;
ReportClass.Next;
SetLength(ReportTable,0);
End;


Any suggestions?
Thomas Pfister
2007-01-12 17:15:53 UTC
Permalink
Vincent,

make a NDR-file with the NDRWriter-componente and then you can use this
NDR-stream for pdf and print with only one .execute!
IIRC on the tips&tricks-page you should find some examples;

:-) thomas
Post by Vincent
When I excute my code, and tell it to print, it works fine. If I tell it
to make a PDF it also works fine, if I try to do both in the same loop,
only the PDF will work. Here is some code snipets...
While NOT(ReportClass.EOF) Do
Begin
ReportTable := ReportClass.GeneratePrintRecord;
RvProject.Open;
RvProject.SelectReport('SimpleReport',False);
RvProject.SetParam('CustomerName',ReportClass.AccountName + ' ('
+ReportClass.AccountNumber + ')');
RvProject.SetParam('HeaderKind','H1');
RvSystem1.DefaultDest := rdPrinter;
RvSystem1.DoNativeOutput := True;
RvSystem1.RenderObject := nil;
FileName := 'Reports\' + ReportClass.AccountName + '.pdf';
RvProject.Execute;//Print it
RvSystem1.DefaultDest := rdFile;
RvSystem1.DoNativeOutput := False;
RvSystem1.RenderObject := RvRenderPDF1;
RvSystem1.OutputFileName := FileName;
RvProject.Execute;//Make PDF
RvProject.Close;
ReportClass.Next;
SetLength(ReportTable,0);
End;
Any suggestions?
Loading...