NetTalk Central

Author Topic: Passing Dates as Parameters  (Read 3453 times)

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Passing Dates as Parameters
« on: September 14, 2009, 11:57:31 AM »
Hi All,

Have a PDF Report called from an options page which asks for two dates FromDate, ToDate
I am trying to pass these top the report to use as a filter but can't get it right.  Any tips, help would be appreciated.
Have looked at the examp[le which uses Size as apassed parameters but when using dates I can't seem to get it right.  I probably need to format them in some way or b??  Tried using Set abd GetValue, also tried sending as part of the URL.

Thanks in advance
Brian

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Passing Dates as Parameters
« Reply #1 on: September 14, 2009, 01:15:29 PM »
I would probably save them from the window where they set the range, before calling the PDF procedure, using p_web.GetSessionValue('StartDate'). You could also add them to the URL and use p_web.GetValue('start') kind of thing. Is there a problem you're running into by doing this?
Mike Grigsby
Credify Systems
Central Oregon, USA

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Passing Dates as Parameters
« Reply #2 on: September 14, 2009, 01:53:08 PM »
If you are using a form to enter the limit values and a regular submit/save button, all the values from your form will be available to the called procedure from p_web.gsv('fieldname').
So if your form has Loc:StDate as a date field, your report procedure would get it in the ThisWindow.init as
LOC:StartDate=p_web.gsv('Loc:StDate')

then you can use LOC:StartDate in your filter as usual.

chris
Real programmers use copy con newapp.exe

Rene Simons

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: Passing Dates as Parameters
« Reply #3 on: September 15, 2009, 02:59:14 AM »
Hi,

Before you can use p_web.gsv('Blah') you have to make sure that Blah is stored as as session value.
So first you have to to a p_web.StoreValue to make sure the date fields from your page are copied to the sessionqueue.
My guess is that when you do a p_web.StoreValue just before you do the p_web.gsv('Blah') you will get the value you wish for, provided nothing else changed the value beforehand.

Rene
Rene Simons
NT14.14

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Passing Dates as Parameters
« Reply #4 on: September 15, 2009, 04:47:02 AM »
try p_web.SSV and p_web.GSV instead of p_web.StoreValue and p_web.GetVaule

I would also put in a debug point to check the value of your date fields just befoe you use them to 1) see that they are not balnks and 2) see that they are in the right format to be used by your report

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Passing Dates as Parameters
« Reply #5 on: September 15, 2009, 08:44:28 AM »
Thanks all for the quick and detailed replies.
I will dive into this today and get it done.  Will let you know what i did.

Thanks,

Brian
Brian

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Passing Dates as Parameters
« Reply #6 on: September 18, 2009, 11:51:47 AM »
OK - Got it - Thanks
Turns out Chris is right all the entry fields are passed, (eg FromDate, ToDate) already in the form so I did not need to Set the Value I just needed to get it on the report.
Once I did that I struggled with dates a little but finally got it right.

Thanks again.
Brian