Date Parameters

edited March 2009 in Server
I recently upgraded from RB 7.04 to RB 11.03. My old reports for my report
server compile fine. But when I run the server and log on through a
browser, reports that require autosearch date fields create an error in my
GetAutoSearchValues procedure. My autosearch criteria asks for a date range
using soBetween. My GetAutoSearchValues routine tries to assign
AutoSearchField.Values[0] to a local TDateTime variable. The server
generates an error saying it cannot convert a string datatype to a double
datatype. I've read in some of the other posts that you re-did the way
dates are handled in RB11, but I'm still confused as to how to handle this.

Comments

  • edited March 2009

    I tried a simple test here. I put a TppReport on a form and created a query
    on the customer table from DBDemos. I added an autosearch field on
    LastInvoiceDate using the Between operator. I assisgned an initial value of
    1/1/1980, 1/1/1990.

    I implement the OnGetAutoSearchValues event like this...

    procedure TForm1.ppReport1GetAutoSearchValues(Sender: TObject);
    var
    ldDateTime: TdateTime;
    begin
    ldDateTime := ppReport1.AutoSearchFields[0].Values[0];

    ShowMessage(DateToStr(ldDateTime));

    end;

    In a button I call ppReport1.Print.

    When I run the repor the autosearch dialog is displayed and I press OK and
    then I get the ShowMessage with the 1/1/1980 value.



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2009


    Thanks for the quick response, Nard. I created a small client report with
    the code you showed me and it worked fine. I then added the datamodule that
    contained the report into a small server program - with that datamodule
    being the only registered report. Then I get the error I wrote you about in
    the original post. Is the error because of the web tier handling date
    formats differently in RB 11? I still don't understand why the
    ppReport1.AutoSearchFields[0].Values[0] would be coming to the server as a
    string. Would this also create the symptom where the autosearch dialog
    containing dates within a web browser generates a HTTP 403 error whenever I
    click on the datetimepicker icons?



  • edited March 2009

    Can you make a simple example report using DBDemos and save an .rtm that I
    can run using the Demo server installed with RB. Then create a simple
    WebTier example using the Demos\WebTier\WebDebug example as a starting
    point.

    Send to me in zip format and then I can build and run it here.


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

    Best regards,

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