Home DADE

Display Changes to AutoSearch in ppViewer AutoSearch Dialog

edited September 2009 in DADE
We have a form that contains a ppViewer component and lists all reports
stored in the DB. When the user clicks on a report in the list, the report
is displayed in the ppViewer component ... this is good.

When the user clicks the AutoSearch toolbar button, we execute the following
code to display the AutoSearch dialogue:

ppViewer.DisplayAutoSearchDialog;

When the AutoSearch dialogue appears, it displays preexisting AutoSearch
rules, but it DOES NOT display changes that were made and saved in the
ReportDesigner.

Any Ideas?

Patrick

Comments

  • edited September 2009
    Hi Patrick,

    The ppViewer.DisplayAutoSearchDialog is simply a passthru to the
    Report.DisplayAutoSearchDialog call. If you are loading templates, it will
    display the autosearch dialog saved down with that template. You will need
    to load the template, change the data settings, then make the call if you
    would like to use the end-user designer.

    --
    Regards,

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

    Best Regards,

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

    Not sure that I understand. When we create a Report in the ReportDesigner
    and select the Save menu option, the report template is saved to the rbItems
    data table. On our Report Viewer form, we list the available reports in the
    rbItems data table and when the user selects that report, we stream the
    report with the following code:

    if Locate('Name', lboxDB.Items.Strings[lboxDB.ItemIndex], []) then begin

    MS := TMemoryStream.Create;

    TBlobField(FieldByName('Template')).SaveToStream(MS);

    MS.Position := 0;

    ppReport.Template.LoadFromStream(MS);

    ppViewer.Report := ppReport;

    ppViewer.Report.PrintToDevices;

    MS.Free;

    end;

    Once the Blob field has been streamed from the rbItems table, we display the
    report in the ppViewer. When the user clicks the AutoSearch toolbar button,
    we execute the following statement:

    ppViewer.DisplayAutoSearchDialog;

    ...which we assumed would display ALL AutoSearch rules that have been
    designed into the report via the ReportDesigner.

    If I run the same report in the ReportDesigner Preview tab, the AutoSearch
    dialogue is correct.

    Patrick

  • edited September 2009
    Hi Patrick,

    Using the same technique, if you change another aspect of the report (such
    as a label color) and save it to your DB, then try to load and view it are
    you able to see the changes reflected in the viewer?

    --
    Regards,

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

    Best Regards,

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

    Yes. I changed the font color in report column headers and the change was
    reflected when the report was viewed in the ppViewer...but the AutoSearch
    dialogue did not display all search rules that had been defined in the
    ReportDesigner.

    Patrick

  • edited September 2009
    Hi Patrick,

    I have tried, but am unable to recreate this behavior on my machine. The
    autosearch fields and settings are saved to a template the same as any other
    component however according to your descritpions, they are the only items
    not being saved. One item I did notice is that when calling PrintToDevices,
    you are taking complete control over the printing process so none of your
    parameters will be initiailized. Try the following instead...

    if Report.InitializeParameters then
    Report.PrintToDevices;

    Please send a simple example including steps to recreate this issue on my
    machine. Send the example in .zip format to support@digital-metaphors.com.

    --
    Regards,

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

    Best Regards,

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

    THANKS...that worked.

    Patrick

  • edited September 2009
    Great!, glad we got to the bottom of it.

    --
    Regards,

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

    Best Regards,

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

    I have added new data to a record in the data table which is used in the
    report auto search lookup. When I run the report and display the AutoSearch
    dialog, the new data item DOES NOT appear in the dropdown lookup list.

    Any ideas?

    Patrick

  • edited October 2009
    Hi Patrick,

    When are you adding this new datafield? Is this occuring at runtime while
    the report is executing? Once you add a new data entry, you might try
    disconnecting the datapipeline from the parameter then reconnecting it to be
    sure the list is updated.

    --
    Regards,

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

    Best Regards,

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

    The Data Records and Print Shop (RB technology) components are separate
    applications. The data was entered via the Data Records application. Then,
    when running the report from the Print Shop, the new data did not appear in
    the dropdown lookup in the Print Shop report's AutoSearch dialog.

    Patrick

  • edited October 2009
    Hi Patrick,

    When the application loads, the DataPipeline compiles a list of fields, then
    when the report loads, a list of records is compiled for the parameter. If
    you then add a record to the dataset, it will not be reflected in the record
    list unless you close the report and re-open it, or close and re-open the
    dataset.

    --
    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.