NetTalk Central

Author Topic: NetWebYear - embed point for SetSessionValue of clicked date  (Read 5936 times)

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Looking for an embed point on NetWebYear procedure where the clicked date can be saved to SetSessionValue.

Thanks,
Sukhendu

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11302
    • View Profile
Re: NetWebYear - embed point for SetSessionValue of clicked date
« Reply #1 on: April 27, 2012, 08:57:03 PM »
Hi Sukhendu,

More context for your request is required. When you lick on a date on the calendar it usually goes to a form. So, what are you wanting the session value for?

cheers
Bruce

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: NetWebYear - embed point for SetSessionValue of clicked date
« Reply #2 on: April 28, 2012, 01:46:06 PM »
Hi Bruce,
I don't want it go to a form, instead to a report or another procedure that needs this date (which comes from a table that is loaded on to a NetWebYear).  I could accomplish this on a memory form with a look-up, but I like the looks of calendar layout of NetWebYear better.

Thanks,
Sukhendu

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11302
    • View Profile
Re: NetWebYear - embed point for SetSessionValue of clicked date
« Reply #3 on: April 29, 2012, 09:48:22 PM »
ok, so the date is passed to the new procedure as a parameter called
_date_
in the new procedure you should do a
p_web.StoreValue('_date_')
and then use it after that as a session value.

cheers
Bruce

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: NetWebYear - embed point for SetSessionValue of clicked date
« Reply #4 on: April 30, 2012, 08:56:20 AM »
Bruce,

Yes, but I don't know how to pass the date from the NetWebYear procedure to the new procedure as a parameter called _date_

I can do parameter passing in windows programming, but doing the same in NT web programming has been my biggest challenge so far.    All web procedures has NetWebServerWorker parameter.  How do I add a new parameter on the prototype and then call it into a new procedure.  If there is an example that would be very helpful.

Thanks,
Sukhendu
 

estadok

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • EstaSoft
    • Email
Re: NetWebYear - embed point for SetSessionValue of clicked date
« Reply #5 on: April 30, 2012, 09:57:23 AM »
Hi Sukhendu,

Try SomeDate = p_web.GetValue('_date_'). I use this to prime StartDate for UpdatePlanner. So you can use this in to your procedure.
Clarion 9.0.10376
NetTalk 7.26
SecWin 6.25
StringTheory 1.92

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: NetWebYear - embed point for SetSessionValue of clicked date
« Reply #6 on: April 30, 2012, 11:30:31 AM »
Thanks estadok.  This is what I have:
1) Table Daily that has a column DLY:DLYDate.
2) I load this into a NetWebYear procedure
3) I click a date on the calendar where DLY:DLYDate exists (which is visible as a darker font on the calendar). 
4) The click event in step 3 will run a new procedure (say a report) which needs that date.  I do not want to load the FORM for Daily table.

As we suggested, I can get the value using GetValue function, but first I have to store the value or pass it.  How do I store it while I'm still on the NetWebYear procedure?  I did not see any parameter passing option on the NetWebYear procedure.

- Sukhendu

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11302
    • View Profile
Re: NetWebYear - embed point for SetSessionValue of clicked date
« Reply #7 on: April 30, 2012, 08:16:56 PM »
Hi Sukhendu,

ok, you're off track mate, so let's back up a bit.

Firstly, and it's important to realise this, you are not calling your report from the NetWebYear procedure. Because by the time the user _sees_ the calendar, the procedure has finished and disappeared.

The report procedure is called by the _browser_, via the URL embedded in the calendar cell.

So the first key is not to think of embedding in the NetWebYear, because at the time of the click it simply doesn't exist, and is not called. The report is called.

Fortunately the date the user clicked is already a parameter of the url. (Although I guess to some extent that depends on what you've done setting up the calendar). But if it is there, it's passed as _date_, so in the _report_
procedure you can do a
loc:date = p_web.GetValue('_date_')
and use loc:date in your report filter as normal.
(don't forget to BIND loc:date if you use it in a filter.)

cheers
Bruce

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: NetWebYear - embed point for SetSessionValue of clicked date
« Reply #8 on: May 01, 2012, 01:35:04 PM »
Thanks Bruce for clearing thing up.  It is working now if I run a FORM procedure when a date is clicked.  But if run a report instead of a form I get "No matching prototype available error" (If p_web.GetPreCall('Rpt_DailySummary') = 0 then Rpt_DailySummary(p_web,Net:Web:Popup).  So I'm accessing the report via a form.  It would be nice if I an directly run the report when a date is clicked on the NetWebYear.

Sukhendu