NetTalk Central

Author Topic: Web Browse - "Range" not working  (Read 5003 times)

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Web Browse - "Range" not working
« on: July 15, 2012, 01:20:50 AM »
I have a browse with a filter based on a range of dates - and that works fine. I tried to make things more efficient and tried using a "Range" in the browse template in conjunction with a relevant key, but wit returns no records. Is it possible to use "Range" in a web browse and if so, what might i be doing wrong?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Web Browse - "Range" not working
« Reply #1 on: July 15, 2012, 09:53:47 PM »
>> Is it possible to use "Range" in a web browse

yes.

>> if so, what might i be doing wrong?

perhaps you can post an example of what you're doing? It's a lot easier to diagnose what you are doing as distinct from what you might-be doing.

cheers
Bruce

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: Web Browse - "Range" not working
« Reply #2 on: July 15, 2012, 11:08:46 PM »
If I have no range and the following filter it works fine:
'DIA:Date >= ' & LOC:StartDate & ' AND DIA:Date <= ' & LOC:EndDate

If I remove the filter and have the following range, I get "No Records":
Range limit field: DIA:Date
Range limit type: Range of Values
Range Values:
Low Limit Value: LOC:StartDate
Hight Limit Value: LOC:EndDate

The Table is set to the "Diary" table (prefix DIA) and set to the 2 part key comprising:
DIA:Date (Ascending)
DIA:Time (Ascending)
 No fields set to "Hot"

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Web Browse - "Range" not working
« Reply #3 on: July 16, 2012, 01:19:57 AM »
using local variables "plain" in the filter is not recommended. You're supposed to use SessionValues.

Obviously you should prime the session values correctly - but not knowing where you are getting loc:fromdate, and loc:todate from I can't speak to that directly.

Filter should be

'DIA:Date >= ' & p_web.GSV('LOC:StartDate') & ' AND DIA:Date <= ' & p_web.GSV('LOC:EndDate')

If you get the values set in the SessionValues correctly, then the filter (and range) will work.

cheers
Bruce

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: Web Browse - "Range" not working
« Reply #4 on: July 16, 2012, 02:08:54 AM »
Thanks Bruce.

The filter IS working fine (LOC variables are set within the procedure and this is not a problem).

The problem I have is using the "Range" as outlined in my previous post. I cannot see why the range won't work given that I am using the same variables as in the filter which does work.

The only reason I was thinking of using a "Range" is that I thought it would be more efficient than a filter, but I just read the documentation which says that effectively there is no such thing as a nettalk web browse range and it is effectively converted into a filter. If this is the case, then there is no point in me trying to get this to work.

But this raises the issue of how one efficiently "ranges" making use of the file's key?
« Last Edit: July 16, 2012, 02:28:42 AM by ianburgess »

mikefremont

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Web Browse - "Range" not working
« Reply #5 on: November 20, 2012, 10:45:03 PM »
Did you ever get the answer with "Range" not working issue?    I have the problem too.     I did exactly you did and got no record on Browse too.
Thanks

Mike

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Web Browse - "Range" not working
« Reply #6 on: November 20, 2012, 11:19:14 PM »
Hi Ian,

>> there is no such thing as a nettalk web browse range

there's no such thing as a _Clarion_ Browse range. All browses, Clarion, ABC, Legacy, NetTalk make use of the View engine, and the view engine has no concept of range (or "key" for that matter). All any template does is convert your template settings into the filter for you.

the view _can_ use a key, if it's a sufficient match, but it'll work without a key, and there's no way to tell if it _did_ use a key or not.

cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Web Browse - "Range" not working
« Reply #7 on: November 20, 2012, 11:21:50 PM »
Hi Mike,

>> Did you ever get the answer with "Range" not working issue? I have the problem too. I did exactly you did and got no record on Browse too.

If you are using local variables in the range, then you need to set their values to the right value in the right place. Are you doing that?

Posting an example would greatly aid in being more specific as to what you are doing wrong.

cheers
Bruce


mikefremont

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Web Browse - "Range" not working
« Reply #8 on: November 21, 2012, 11:18:29 AM »
Hi Bruce,  thank your reply.

in NetWebBrowse procedure
   Tab - Filters
           Range Limited Field: ARIV:InvoiceNo
           Range Limited:   Low:     loc:InvoiceNo_From
                                    Hight:   loc:InvoiceNo_To

both loc;InvoiceNo_From and loc:InvoiceNo_To   are local variable.
In 2 Before Browse Loop
      1. After Setting Browse Behavior Setting
          loc:InvoiceNo_From = 'MA0000'
          loc:InvoiceNo_To = 'MA5000'

But it shows "no record".     I believe I must miss something.     

Mike 


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Web Browse - "Range" not working
« Reply #9 on: November 21, 2012, 09:19:35 PM »
If you tick on the template option to
"Send Order and Filter to Debugview"
you should be able to see the contents of the filter. Can you cut & paste that here please.

Cheers
Bruce

mikefremont

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Web Browse - "Range" not working
« Reply #10 on: November 22, 2012, 09:56:50 PM »
Hi Bruce,

I can not find where is 'Template Option/"Send Order and Filter to Debugview"?    I am in C6 and there is only 'Template Utility' but there is no Debugview.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Web Browse - "Range" not working
« Reply #11 on: November 22, 2012, 10:04:32 PM »
sorry, I should have been more clear - see attached pic.


[attachment deleted by admin]

mikefremont

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Web Browse - "Range" not working
« Reply #12 on: November 23, 2012, 10:58:37 PM »
Hi Bruce,   Ok  I saw it and tick on "Send Order and Filter to Debugview".  But , where can I find the content of debug view?

However, please guide me easier by using your NT example Web1 as attachment.   

I did try,   
1. embed the local variable:    Loc:BoxName='Peter'
2, Tab- Filter
Range Limit Field: MAI:MailBoxName
Range Limit Type: Single Value
Range Limit Value: Loc:BoxName
But it doesn't work.     If I just use Filter 'MAI:MailBoxName=''Peter''', it works.

What did I miss? 


[attachment deleted by admin]

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Web Browse - "Range" not working
« Reply #13 on: November 25, 2012, 02:19:24 PM »
firstly you need to download and install debug view (google it for a download link). then you can see any debug messages from the templates or ones you add like p_web._trace('xxx')

for filters try

 'MAI:MailBoxName=<39>' &  p_web.gsv('Loc:BoxName') & '<39>'

So you need to p_web.ssv('Loc:BoxName',Loc:BoxName) at the appropriate place.

seeing the filter via debug view makes the above a lot easier when things don't work

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: Web Browse - "Range" not working
« Reply #14 on: November 25, 2012, 09:18:49 PM »
Hi Peter,

>> What did I miss

you're setting your local variable as
  Loc:MailBox = 'Peter'

you should set it as
  p_web.SSV('Loc:MailBox','Peter')

Browses are multi-entrant, so work on Session Values.

cheers
Bruce