Subreport 'Template' Report Graphic Problem.
Hi,
I use the following script to create a 'header template', that will make the
top of all reports look the same. (And allow me to customise the header from
one spot). The problem I have is when I try to print the report to disk
(ie - not to a printer), using Adobe Illustrator, any images in the
'template' subreport don't print correctly. (They print out as a black
square). An example of this can be found at
http://www.jvxp.com/temp/report.pdf. (Black box top-left hand corner)
I thought that this may be an Adobe Acrobat problem, but have found I
experience the same problem if I use gnostic's export routines. It does
print fine though, when printing onto paper direct from my application.
Can anyone see where the problem is? To print one of my reports with the
header, I simply call:
Printit(report_i_want_to_print, 'caption of report', true)
Thanks & Regards
Adam Hair.
procedure TReportTemplate.Printit(Report: TppReport; Caption: string; Prompt
: Boolean);
var
i: Integer;
tsub: TppSubReport;
tchd: TppChildReport;
ts1: TStream;
begin
reporttemplate.ppLabel1.caption := caption;
tsub := TppSubReport.Create(Report);
tsub.Band := Report.HeaderBand;
tsub.CreateReport(Report);
tchd := tsub.report as TppChildReport;
tchd.CreateDefaultBands;
ts1 := TMemoryStream.Create;
reporttemplate.ppHeaderBand1.Report.Template.SaveToStream(ts1);
tsub.Report.Template.LoadFromStream(ts1);
Report.AllowPrintToFile := true;
Report.PreviewFormSettings.WindowState := wsMaximized;
Report.PreviewFormSettings.ZoomPercentage := 100;
Report.PreviewFormSettings.ZoomSetting := zsWholePage;
Report.ShowPrintDialog := true;
Report.Print;
tchd.free;
tsub.free;
ts1.free;
ReportTemplate.free;
end;
I use the following script to create a 'header template', that will make the
top of all reports look the same. (And allow me to customise the header from
one spot). The problem I have is when I try to print the report to disk
(ie - not to a printer), using Adobe Illustrator, any images in the
'template' subreport don't print correctly. (They print out as a black
square). An example of this can be found at
http://www.jvxp.com/temp/report.pdf. (Black box top-left hand corner)
I thought that this may be an Adobe Acrobat problem, but have found I
experience the same problem if I use gnostic's export routines. It does
print fine though, when printing onto paper direct from my application.
Can anyone see where the problem is? To print one of my reports with the
header, I simply call:
Printit(report_i_want_to_print, 'caption of report', true)
Thanks & Regards
Adam Hair.
procedure TReportTemplate.Printit(Report: TppReport; Caption: string; Prompt
: Boolean);
var
i: Integer;
tsub: TppSubReport;
tchd: TppChildReport;
ts1: TStream;
begin
reporttemplate.ppLabel1.caption := caption;
tsub := TppSubReport.Create(Report);
tsub.Band := Report.HeaderBand;
tsub.CreateReport(Report);
tchd := tsub.report as TppChildReport;
tchd.CreateDefaultBands;
ts1 := TMemoryStream.Create;
reporttemplate.ppHeaderBand1.Report.Template.SaveToStream(ts1);
tsub.Report.Template.LoadFromStream(ts1);
Report.AllowPrintToFile := true;
Report.PreviewFormSettings.WindowState := wsMaximized;
Report.PreviewFormSettings.ZoomPercentage := 100;
Report.PreviewFormSettings.ZoomSetting := zsWholePage;
Report.ShowPrintDialog := true;
Report.Print;
tchd.free;
tsub.free;
ts1.free;
ReportTemplate.free;
end;
This discussion has been closed.
Comments
The prining of black boxes instead of images is usually due to how the
printer driver is reading certain images from your report. Here are some
things to try...
1. Set ppImage.DirectDraw to True.
2. Be sure the ppImage.Transparent property is set to False.
3. Try printing in a different image format (i.e. .bmp).
4. Try exporting to PDF using a different device available from our website
at
http://www.digital-metaphors.com/Subpages/Downloads/companionproductsDevices.html
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks so much for your suggestions. It appears as though the Transparent
property was set to true, and this was causing the problem.
Best Regards
Adam.