//KEYFIELD operation  Topic is solved

Support for Crystal Reports within Jiwa.

//KEYFIELD operation

Postby neil.interactit » Wed Nov 11, 2015 10:14 am

Hey guys,

I have the following ...
Code: Select all
Pass_IssuedBy Design
//TYPE = STRING
//CAPTION = Issued By
//SEARCH = YES
//SELECT = SELECT FullName,StaffID FROM (SELECT FName+' '+SName AS FullName, s.StaffID FROM HR_Staff s UNION SELECT '[Anyone]','[ANYONE]') tbl
//ORDER = ORDER BY FullName
//KEYFIELD = StaffID
//DEFAULT = SELECT '[Anyone]' FullName,'[ANYONE]' StaffID
"zzzzzzz "
Pass_IssuedBy Operating
'Admin '

The SQL result is (Admin,ZZZZZZZZZZ0000000000) and KEYFIELD = StaffID, yet the operating value is FullName.

If I swap the parameter order in the query then StaffID is operating, however it also displays on the filter page. I am trying to display "Admin" on the filter page, then filter on the StaffID.

Am I driving KEYFIELD incorrectly?

Cheers,
Neil.
neil.interactit
Kohai
Kohai
 
Posts: 227
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6

Re: //KEYFIELD operation  Topic is solved

Postby Scott.Pearce » Mon Nov 23, 2015 4:44 pm

Am I driving KEYFIELD incorrectly?


Yes. KEYFIELD is used as the filter AND will be the value shown on the parameters page.

Instead of going with the UNION-ed "Anyone" approach, what if you provided a "From" Username and "To" Username? This would allow ranges of users, a specific user (From and To set to the same value), as well as "Anyone" (the default for From would be TOP 1 Username ORDER-ed by Username DESC, and the default for To would be TOP 1 Username ORDER-ed by Username ASC).
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221


Return to Crystal Reports

Who is online

Users browsing this forum: No registered users and 9 guests