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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you tell me the way? Maybe some examples?
Thanks
Andras
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('R EPORT.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
Example
MyReport.Prepare;
MyReport.QRPrinter.Save('R
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).Upd ateFont;
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;
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).Upd
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;
ASKER
Can you tell me the way? Maybe some examples?
Thanks
Andras
Thanks
Andras
Try add global variable Outputfile. Initialize as Empty String and after printing set to Empty String.
Another solution is more compliced.
Lilita
Another solution is more compliced.
Lilita
ASKER
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
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
ASKER
Thanks
Andras