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

Hiding components based on printing device

edited November 2012 in General
Hi

(Using Delphi 2010 - RB 12.02)

I would like to assign an action to a new menuitem in the popupmenu, an
action with a checbox. The purpose is to give the user ability to hide
certain components when physically printed on paper. (Showing
logo/backgrund on screen and pdf but not on paper).

I can add items to the designer-menu by assigning a mergemenu
Is there anyway I can add items to the designers popupmenu ?

Or perhaps you have better suggestions to control this ?

René/SSV

Comments

  • edited November 2012
    Hi Rene,

    The designer itself does not have a single popup menu. Each component
    and band control contain a separate popup menu object. If you would
    like to add an item, you would basically need to create new popup menu
    objects for each band/component your users may select and register them
    with the popup menu manager. See the initialization section of the
    ppPopupMenus.pas file for how this is currently done.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2012
    Hi Nico

    That's too much work, I will settle on just a normal action/menuitem
    with a shortcut for easy activation. It would have been nice though to
    have this setting in popupmenus for all components.
    Would you consider this for a new version ? - I think it would be
    generally useful to let the user decide which components should NOT be
    visible when printing on paper.
    On this subject I have a little problem: When printing to screen and
    pushing the print button from the viewer, the Devicetype will be
    dtPrinter even when I select for instance PDF-file in the printdialog.
    This means that users will not be able to manually create PDF-output
    with all components shown when "printing" from the viewer. Any way to
    fix that ?

    Best Regards
    René / SSV
    (Sorry for the direct mail to you - hitting Reply instead of Follow Up)

    Den 13-11-2012 16:16, Nico Cizik (Digital Metaphors) skrev:
  • edited November 2012
    Hi Rene,

    Thanks for the feedback.

    I'm a bit unclear about your second issue. Are you printing from the
    built-in previewer? If you create a minimal application (Report and
    button on a form) are you unable to export to PDF from the previewer?

    My first suggestion would be to upgrade your version of ReportBuilder to
    12.05. Contact info@digital-metaphors.com for upgrade instructions.
    If, after the upgrade, you still get this issue, send a simple example
    using only RB and Delphi components in .zip format to
    support@digital-metaphors.com and I'll take a look at it.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2012
    Hi Nico.

    I did not not explain properly.
    My wish is to add an option which can control wether an object is shown when
    printing to he printer.
    (A way to hide logos and background images, lines etc. when printing and
    preprinted paper/forms ).
    On one hand I suggest that you implement this feature for a coming release.
    On the other hand I am implementing this now (the simple way).
    ... OnPrint handler doing something like: (Sender as TppPrintable).Visible:=
    ppReport.DeviceType <> dtPrinter;

    and I am facing the problem that whatever device you choose from the viewer
    the DeviceType will be dtPrinter.
    Thus a PDF-file generated this way will not show the logos etc, that I have
    chosen to hide when printing to paper.

    Regards Ren?

  • edited November 2012
    Hi Rene,

    Thanks for the clarification. If you would like to know which device
    the user selected from the Print Dialog, you need to check the
    Report.PrintDialog.DeviceType property instead of the Report.DeviceType
    property. Do this in the OnPrintDialogClose event.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.