NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: ianburgess 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?
-
>> 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
-
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"
-
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
-
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?
-
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
-
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
-
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
-
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
-
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
-
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.
-
sorry, I should have been more clear - see attached pic.
[attachment deleted by admin]
-
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]
-
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
-
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