Home End User

Need help with CreateAutoSearchCriteria

edited May 2003 in End User
Hi All,

My end-user reports are acting odd, and I don't know what I did to 'break'
them.

In the calc page, under OnCreate...I put the following code on a report I
was creating (as an end-user!)

Now, even if I create a new report, that criteria comes up in the search
dialog. I can't get rid of it, and there are no traces of this line in my
report code at all.

Any suggestions welcome,
Stacey
Report.CreateAutoSearchCriteria('Items', 'RENEWAL_DATE',
soGreaterThanorEqualTo, DateTimeToStr(CurrentDateTime), False);

Comments

  • edited May 2003
    When you create criteria, they are persistent. Check to make sure that the
    report template doesn't have it defined on the dataview. Most likely you
    created the criteria once and then saved the report. Now the report doesn't
    need the CreateAutosearchCriteria in the OnCreate, because there is a
    criteria from the last time you ran the report with that code that created
    it persistently on the dataview.

    Otherwise, it sounds like it might be a template that is being loaded that
    has the RAP code in it to create the autosearch criteria. Do you have
    Report.SaveAsTemplate set to true? This will cause the report ot load from
    template when you run the report. The RAP code is stored in the template.
    You saved this down to a template with SaveAsTemplate true. Now, you removed
    the RAP code, but ran the report. RB streams the report down when you run
    the report, then because you can change the layout as the report runs
    through your event handlers, it has to reload the report after it has
    printed when you go back into the design tab of the designer. When this
    happens, it sees that SaveAsTemplate is true and it loads the template. I'm
    guessing the RAP code is in the report template that gets loaded. Can you
    load this template into a new report object standalone and set
    Report.SaveAsTemplate to false and runt he report and verify that the
    OnCreate doesn't create criteria.

    --
    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.