Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

ShowPringDialog

edited April 2002 in General
Hi,

I am having some problems getting a printdialog to show with the code below.
This report is done entirely in code. We make the report templates, store
them in a database and print directly from there. How can I get a print
dialog to show? Any help would be great!

Thanks,

Jada

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////
procedure TformProposalUI.PrintMedicalProductGrid;
// printing the report templates as one print job
var
lPrinterDevice : TppPrinterDevice;
integerX : integer;

begin
integerReportNo := 1;
lPrinterDevice := TppPrinterDevice.Create(self);
lPrinterDevice.PageSetting := psAll;
FreportTemp.SavePrinterSetup := True;
lPrinterDevice.StartPrintJob := True;
lPrinterDevice.EndPrintJob := False;


for integerX := 0 to
formdatamoduleQuoteOutput.tableReportTemplates.RecordCount - 1 do
begin
FreportTemp.Template.DatabaseSettings.Name := 'ReportPage' +
inttostr(integerReportNo) + 'Template';
FreportTemp.Template.LoadFromDatabase;
lPrinterDevice.Publisher := FreportTemp.Publisher;

if integerX = 0 then
begin
FreportTemp.ShowPrintDialog := True;
FreportTemp.PrintToDevices;
end
else
begin
FreportTemp.ShowPrintDialog := False;
FreportTemp.PrintToDevices;
end;{if integerX = 0 then}

inc(integerReportNo);
lPrinterDevice.StartPrintJob := False;
end;
lPrinterDevice.EndPrintJob := True;
lPrinterDevice.Free;
end;{PrintMedicalProductGrid}

Comments

This discussion has been closed.