Passthru function being called when printer selected in print dialog
Hello,
Using
Delphi 2007
ReportBuilder 12.03 enterprise
I have an end-user reporting application in which I use a passthru
function to prompt for a client ID (the function allows the user to
look-up the client by name and returns the client ID to the report).
The function (GetClientOnlyPrompt) is called in the event
ReportBeforeOpenDataPipelines.
Said procedure is shown below.
(ReportBeforeOpendataPipelines event)
var
lSQLBuilder: tdaSQLBuilder;
sReportStartdate, sReportEndDate: string;
begin
GetClientOnlyPrompt(gClientSelection, gCancelReport);
if gCancelReport then
showmessage('Report cancelled')
else
begin
lSQLBuilder := TdaSQLBuilder.create(Report.dataPipeline);
lSQLBuilder.SearchCriteria[0].value := gClientSelection;
{ showmessage(gclientSelection);
Showmessage(lSQLBuilder.SQL.SQLText.Text);
}
lSQLBuilder.Applyupdates;
lSQLBuilder.Free;
end;
end;
This report breaks in the following scenario:
1) Open the report with print-preview option
2) The passthru function is displayed and prompts the user for the
client ID.
3) Client selection is passed to the report and the report is shown in
the preview screen correctly
4) Click on the printer icon in the preview screen
5) Change the printer in the print dialog window
6) Report breaks because, apparently, it is firing the
ReportBeforeOpenDataPipelines event again - and waiting for the passthru
function to return a value.
If I skip step 5 - and do not change the printer selection in the print
dialog, the report prints without a problem.
Is there a different event I can use that won't be fired by a printer
selection in the dialog? Or is there a way to prevent the passthru
function from being called subsequently?
Thanks, as always, for your great help.
Phil Horst
Using
Delphi 2007
ReportBuilder 12.03 enterprise
I have an end-user reporting application in which I use a passthru
function to prompt for a client ID (the function allows the user to
look-up the client by name and returns the client ID to the report).
The function (GetClientOnlyPrompt) is called in the event
ReportBeforeOpenDataPipelines.
Said procedure is shown below.
(ReportBeforeOpendataPipelines event)
var
lSQLBuilder: tdaSQLBuilder;
sReportStartdate, sReportEndDate: string;
begin
GetClientOnlyPrompt(gClientSelection, gCancelReport);
if gCancelReport then
showmessage('Report cancelled')
else
begin
lSQLBuilder := TdaSQLBuilder.create(Report.dataPipeline);
lSQLBuilder.SearchCriteria[0].value := gClientSelection;
{ showmessage(gclientSelection);
Showmessage(lSQLBuilder.SQL.SQLText.Text);
}
lSQLBuilder.Applyupdates;
lSQLBuilder.Free;
end;
end;
This report breaks in the following scenario:
1) Open the report with print-preview option
2) The passthru function is displayed and prompts the user for the
client ID.
3) Client selection is passed to the report and the report is shown in
the preview screen correctly
4) Click on the printer icon in the preview screen
5) Change the printer in the print dialog window
6) Report breaks because, apparently, it is firing the
ReportBeforeOpenDataPipelines event again - and waiting for the passthru
function to return a value.
If I skip step 5 - and do not change the printer selection in the print
dialog, the report prints without a problem.
Is there a different event I can use that won't be fired by a printer
selection in the dialog? Or is there a way to prevent the passthru
function from being called subsequently?
Thanks, as always, for your great help.
Phil Horst
This discussion has been closed.
Comments
time.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
That works. Thanks!
Phil