Single page subfile with filter
Last Post 31 Jan 2013 10:17 AM by dexum. 4 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
nishar
New Member
New Member
Posts:60

--
30 Jan 2013 02:41 AM
I have a single page subfile which has two fields, 'Account' and 'description'. The subfile is displayed from File1 which has account(key) but doesn't have description. Description is coming from another file which is dynamically generated while loading the subfile with . Now in the subfile I want to include a filter or a 'position to'(any of the one will do) based on type and description. But since my subfile is based on file1 which has no description in it, is there any method to filter or position to the subfile?

Titus Aguilar
Veteran Member
Veteran Member
Posts:576
Avatar

--
30 Jan 2013 05:41 AM
Hi,

Option 1: Address this via the data selection routine, not on the subfile. You can use dynamic SQL to include the filter then use the resulting selection as your source, instead of File1. No change required as far as the subfile design is concerned.

Option 2: Change the subfile to full load subfile. If the data is small enough, it's a simple and good enough solution. The filter won't work. Your only choice is to use the filter selection as a start condition. You need to reread the subfile everytime the filter changes and then set the subfile rrn to the first record that matches your criteria.

Option 1 is the better solution. It's more robust, easier to manage and frankly, more realistic.

Hth,
Titus
nishar
New Member
New Member
Posts:60

--
31 Jan 2013 01:35 AM
Can you be more elaborative on the option 1? How can I include filter on the Dynamic SQL?
Tommy Holden
Senior Member
Senior Member
Posts:2833
Avatar

--
31 Jan 2013 05:14 AM
Posted By nishar on 31 Jan 2013 02:35 AM
Can you be more elaborative on the option 1? How can I include filter on the Dynamic SQL?

simply add a WHERE clause (or expand your existing one) on the SQL statement.
dexum
Veteran Member
Veteran Member
Posts:1158
Avatar

--
31 Jan 2013 10:17 AM
If flag = *off;
  run full SQL;
else;
  run SQL with Where clause;
endif;

 You could after  loading  subfile have user place cursor on field you want to filter by and press a Fkey.

 Get data at cursor location and pass data to where statement.

Google "cursor location site:iprodeveloper.com"

Danny Exum Model 515 OS Level 6.1
You are not authorized to post a reply.

Acceptable Use Policy