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

No AutoSearch Dialog at Print

edited February 2009 in General
I have a homegrown Report Viewer form that displays a list of report
templates and displays them in a ppViewer control.

When I execute a Print action, the AutoSearch dialog is displayed.

How do I prevent the AutoSearch dialog from displaying when a print action
is taken?

Thanks, Patrick

Comments

  • edited February 2009
    Hi Patrick,

    Set the Report.ShowAutoSearchDialog property to False.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2009
    Nico,

    Thanks. The ppReport.ShowAutoSearchDialog property is set to FALSE. We use
    the following event handler when the Print button is clicked ...

    procedure TfrmRulesAndView.btnPrintClick(Sender: TObject);
    begin
    { print }
    ppReport.AllowPrintToFile := TRUE;
    ppReport.ShowPrintDialog := TRUE;
    ppReport.DeviceType := dtPrinter;
    ppReport.PDFSettings.OpenPDFFile := TRUE;
    ppReport.CurrentPage := ppReport.PageNo;

    case cxpcTemplates.ActivePageIndex of
    FSTAB: if (lboxFS.Items.Count > 0) AND (lboxFS.ItemIndex <> -1) then
    ppViewer.Report.Print;

    DBTAB: if (lboxDB.Items.Count > 0) AND (lboxDB.ItemIndex <> -1) then
    ppViewer.Report.Print;
    end;
    end;

    Patrick
  • edited February 2009
    Hi Patrick,

    If you are loading templates, all properties set before the template is
    loaded will be replaced with the saved template properties. Try using the
    OnLoadEnd template event to assign any properties you would like to affect
    all loaded reports.

    http://www.digital-metaphors.com/rbWiki/Design/Templates/Using_Template_Events

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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