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

Invalid AutoSearch Parameters

edited September 2008 in Server
This is probably a dumb question, but I don't know the best solution to it.
I'm using RB Server 7.04 with Delphi 7. I create custom autosearch dialogs
for all my reports. Some reports require dateTime parameters and some
require integer parameters. I'm using a Report Volume Controller for the
server. The problem that I'm having is as follows:

Client runs a report from a browser and the autosearch dialog appears. All
parameters are required. If the user leaves a parameter blank, the dialog
indicates that the value is required. If, at that point, they click the
"Back" button on the browser which returns them to the report tree, and then
they try to run the same report, the report server does not redisplay the
autosearch dialog and the report generates an error trying to convert a null
value to an integer or dateTime, depending on the report. This crashes the
report server. My BeforeAutoSearchDialog create routine only creates
autosearch fields if the report's autosearch.fieldcount = 0. The
ReportVolumeController has a ValidateReportParameters event, but
unfortunately, this event fires before the autosearch dialog is created,
which does me no good. Do I need to test for invalid values in all my
GetAutoSearchParameters events, or is there a simpler solution?

Thanks

Comments

  • edited October 2008
    One solution is that when you create the autosearch fields you initialize
    the SearchExpression property to a default value.

    For example:

    myAutoSearchField.SearchExpression := '0';

    myAutoSearchField.SearchExpression := DateToStr(Now);



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    ">

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.