You are not logged in.
Pages: 1
Thanks for the help.
Can you give me a example of the code you sugested?
Thanks for the help.
I still get the error on the quickreport.TQRExpBarChart in Delphi 10.2 and QReport V6 Pro.
If I print manual all is working,
If I preview all is working.
Only when I export by code it give me a eccess violation at address 01EF3D35.
When I debug the code all looks fine but still at random places it generate this error.
All my other reports are working fine exept the ones with this TQRExpBarChart component.
Ok I have installet the mORMot2.
But it will not have this line Pdf.Canvas.RenderMetaFile(aMeta,1,1,0,0);
This is the code I'm using now in mORMot2:
QuickRep.Prepare;
Pdf := TPdfDocument.Create;
Try
Pdf.Info.CreationDate := Now;
Pdf.Info.Creator := aPractiveName;
Pdf.DefaultPaperSize := psA4;
for i := 1 to QuickRep.QRPrinter.PageCount do
begin
Pdf.AddPage;
aMeta := QuickRep.QRPrinter.GetPage(i);
try
// draw the page content
Pdf.Canvas.RenderMetaFile(aMeta,1,1,0,0);
finally
aMeta.Free;
end;
end;
Try
Pdf.SaveToFile(aFileName);
Finally
End;
Finally
pdf.Free;
End
In Delphi 10.2 and Quick Report component TQRExpBarChart to PDF error.
procedure TfPrinterOptions.ExportAsPdf(QuickRep: TQRCompositeReport; aFileName, aDescription: String);
var
Pdf: TPdfDocument;
aMeta: TMetaFile;
i: integer;
pdfFilter: TQRPDFDocumentFilter;
begin
Pdf := TPdfDocument.Create;
Pdf.Info.CreationDate := Now;
if NOT dmVA.aQryVAPraktice.Active then
dmVA.aQryVAPraktice.Active := True;
Pdf.Info.Creator := dmVA.aQryVAPraktice.FieldByName('PrakticeName').AsString;
dmVA.aQryVAPraktice.Active := False;
Pdf.DefaultPaperSize := psA4;
QuickRep.Prepare;
try
for i := 1 to QuickRep.QRPrinter.PageCount do
begin
Pdf.AddPage;
aMeta := QuickRep.QRPrinter.GetPage(i);
try
// draw the page content
Pdf.Canvas.RenderMetaFile(aMeta,1,1,0,0);
finally
aMeta.Clear;
aMeta.Free;
end;
end;
Try
Pdf.SaveToFile(aFileName); // Error Access violation at address 004C4620 in module ...
Finally
// Send to ...
end;
finally
Pdf.CleanupInstance;
Pdf.free;
end;
Pages: 1