Quick riport question

Hi Yee,

How can I print to file with quick riport?
I mean when you call the preview method there's an oppurtuniti to save the riport. It would be better to print
to a file which I can send later to the printer.

Thanks in advance

Andras
bandi081497Asked:
Who is Participating?
 
michaueConnect With a Mentor Commented:
How about using the Prepare method
0
 
bandi081497Author Commented:
Can you tell me the way? Maybe some examples?

Thanks
Andras
0
 
bandi081497Author Commented:
Can you tell me the way? Maybe some examples?

Thanks
Andras
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
michaueCommented:
Prepare will generate a report without printing it or previewing it directly.  When you are finished with the report you should manually free the qrPrinter and set the property to NIL.

Example

MyReport.Prepare;
MyReport.QRPrinter.Save('REPORT.QRP');
MyReport.QRPrinter.Free;
MyReport.QRPrinter := nil;

I've never used it myself, but I hope it works for you.. To see more help select the quick report object, press F1 and look under the prepare method...

Hope it works
0
 
LilitaNCommented:
I have similar problem.
I Think that location of problem is in Inprise source file printer.pas, where API function StartDoc call without output file param.

procedure TPrinter.BeginDoc;
var
  CTitle: array[0..31] of Char;
  DocInfo: TDocInfo;
begin
  CheckPrinting(False);
  SetState(psHandleDC);
  Canvas.Refresh;
  TPrinterCanvas(Canvas).UpdateFont;
  FPrinting := True;
  FAborted := False;
  FPageNumber := 1;
  StrPLCopy(CTitle, Title, SizeOf(CTitle) - 1);
  FillChar(DocInfo, SizeOf(DocInfo), 0);
  with DocInfo do
  begin
    cbSize := SizeOf(DocInfo);
    lpszDocName := CTitle;
    lpszOutput := nil;// Try set OutputFileName here
  end;
  SetAbortProc(DC, AbortProc);
  StartDoc(DC, DocInfo);
  StartPage(DC);
end;

0
 
bandi081497Author Commented:
Can you tell me the way? Maybe some examples?

Thanks
Andras
0
 
LilitaNCommented:
Try add global variable Outputfile. Initialize as Empty String and after printing set to Empty String.
Another solution is more compliced.

Lilita
0
 
bandi081497Author Commented:
Thank you for your answer. It works.
Can you tell me how can I load the files contains the report
and print them later instead of not to use the preview method
and its facility to load the previously saved riport?

Thanks in advance
Andras
0
All Courses

From novice to tech pro — start learning today.