Link to home
Start Free TrialLog in
Avatar of bandi081497
bandi081497

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of michaue
michaue

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bandi081497
bandi081497

ASKER

Can you tell me the way? Maybe some examples?

Thanks
Andras
Can you tell me the way? Maybe some examples?

Thanks
Andras
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
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;

Can you tell me the way? Maybe some examples?

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

Lilita
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