Disabling Printing from the Preview Window.
How can I disable the Print button in the print preview?
or barring that, How can I stop the print job from going to the printer?
I have tried putting a Report.Cancel or a Report.PageLimitReached in the
BeforePrint but the print job is still being sent to the printer.
Thanks in advance,
Trevor Bourget
or barring that, How can I stop the print job from going to the printer?
I have tried putting a Report.Cancel or a Report.PageLimitReached in the
BeforePrint but the print job is still being sent to the printer.
Thanks in advance,
Trevor Bourget
This discussion has been closed.
Comments
http://www.digital-metaphors.com/tips/CustomPreview.zip
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
in the preview some of the time. How can I have Report Builder use the
custom form sometimes and the actual form the rest of the time?
My problem is that in some areas of my program I need to control when they
can print the report. Yet I still would like to use the print preview to
allow them to view the report. In other areas of the program they can print
with impunity. From my understanding of the demo, Report Builder will use
the Custom Print Preview all the time.
Thanks,
Trevor Bourget
"Alexander Kramnik (Digital Metaphors)" wrote
toggle to specify whether the button should be shown. Then you don't have to
worry about switching up forms and only use one.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
set the visible property of the Print Button I am getting a memory access
error. When I debug it I can see the value for the visible property but the
button itself reads as inaccessable.
Here is the code that I added:
public:
property ShowPrintButton : boolean read GetPrintVisible write
SetPrintVisible;
implementation
function TmyPreview.GetPrintVisible : boolean;
begin
if assigned(FBtnPrint) then result := FBtnPrint.Visible
else
Result := False;
end; //
procedure TmyPreview.SetPrintVisible(PrintVisible :boolean);
begin
FBtnPrint.Visible := PrintVisible;
blnPrintVisible := PrintVisible;
end; // SetPrintVisible
the Report.OnPreviewFormCreate event. btw. what is 'blnPrintVisible '.
PS. The getter could be simplified as below:
Result := (FBtnPrint<> nil) and (FBtnPrint.Visible);
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Report.OnPreviewFormCreate:
TmyPreview(rptLabel.PreviewForm).ShowPrintButton := False;
However when i step into the SetPrintVisible (provided below), FbtnPrint is
nil, yet i have a breakpoint at the FBtnPrint :=
TSpeedButton.Create(FToolbar); line which gets tripped before
SetPrintVisible is even called.
How can this be?
Thanks,
Trevor Bourget
PS. The blnPrintVisible is just a flag I have made.
"Alexander Kramnik (Digital Metaphors)" wrote
getting nilled out. Try following the progress of the program by stepping
over code from the point where the button gets created. It's possible that
for some reason you might be looking at two different instances of the
preview form, one of then not having been initialized.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com