Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preventing Prompting for Parameter values

Status
Not open for further replies.

Turkbear

Technical User
Mar 22, 2002
8,631
US
Hi,
In CE10, I could pass a NULL value ( an empty string or nothing) and, as long as I tesed for it in the Record Selection formula, I was not prompted for a value..
In XI, even when Nulls and zero-length strings are accounted for in the selection formula, it insists on prompting for the parameter value..

Was this actually changed in XI?

For instance, in XI this selection formula:
Code:
(
If (IsNull({?BdateStart}) and IsNull({?BDateEnd})) then
True
else
{HR_CUR_RPTNG.BIRTH_DT} in {?BdateStart} to {?BDateEnd}
)
and
{HR_CUR_RPTNG.EMPL_STAT_CD} = 'A'

Requires an input for both parameters before it will run..

Any workaround?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I beleieve that it always required input if you selected prompt user.

A report doesn't get to that point until AFTER it has prompted the user, wouldn't make much sense to execute that code and then prompt, and then execute that code. How wouold it ever know that you wanted it to prompt?

Turn off the prompt use on the parameters if you don't want it to prompt. I think you'll find that was the case in CE 10 as well.

Now if you mean using external code and passing parameters, then post the code being used, CE itself doesn't work the way you describe.

-k
 
Hi synapse,
In V10, the very same report, using the same criteria, and with the same options set in the CMC, works fine..

I can leave the 2 dates blank and get all data with no prompting from the published report..

( The one I posted was just an example) the actual Report selection criteria is:
Code:
({WR_REPORT.WORK_REQUEST_TYPE} = "MAINT" or {WR_REPORT.WORK_REQUEST_TYPE} = "TEREQ") and 

//Systems may have multiple highway milepoints this allows only the primary to be used. 
{SYSTEM_THRU_HIGHWAY_LOOKUP.PRIMARY_FLG} = "Y" and

{SYSTEM_DEFINITION.SYSTEM_IND} = "L" 


AND (If {?County} <> "ALL"  then Cstr({SYSTEM_DEFINITION.COUNTY_CODE}, 0) = {?County} else True)

AND (If {?District} <> "ALL"  then {SYSTEM_DEFINITION.DISTRICT_CODE} = {?District} else True)
 
AND (If {?PriorityCode} <> "ALL"  then Cstr({WR_REPORT.PRIORITY}, 0) = {?PriorityCode} else True)

AND (If {?FeedPoint} <> "ALL"  then {SYSTEM_DEFINITION.FEEDPOINT_NO} = {?FeedPoint} else True)

AND (If {?LMaintZone} <> "ALL"  then {SYSTEM_DEFINITION.MAINT_ZONE} = {?LMaintZone} else True)

AND (If {?Municipality} <> "ALL"  then {SYSTEM_DEFINITION.MUNICIPALITY_CODE} = {?Municipality} else True)


AND 

  (If {?EmpNbr} = "ALL"  then
    True
  else if {?EmpNbr} = "NONE"  then
    (IsNull ({WR_REPORT.EMPLOYEE_NO}) or ({WR_REPORT.EMPLOYEE_NO} = {?EmpNbr}))
  else
    ({WR_REPORT.EMPLOYEE_NO} = {?EmpNbr}))


AND

(If {?HistoryFlag} = "ALL"  then
   True
 else if {?HistoryFlag} = "active"  then
   {WR_REPORT.HISTORY_FLG} = 'N'
 else if {?HistoryFlag} = "history"  then
   {WR_REPORT.HISTORY_FLG} = 'Y')

AND

(If {?ReportedAsCode} = "ALL"  then
     True
 else if {?ReportedAsCode} = "Knockdown"  then
     {WR_REPORT.REPORTED_AS_CODE} in ['KD', 'BAS', 'KDM', 'KDC', 'KDP', 'PLL']
 else if {?ReportedAsCode} = "LightsOut" then
    not ({WR_REPORT.REPORTED_AS_CODE} in ['KD', 'BAS', 'KDM', 'KDC', 'KDP', 'PLL'])
 else if {?ReportedAsCode} = "Breaker" then
    {WR_REPORT.REPORTED_AS_CODE} in ['BT', 'CDC', 'SCR', 'CD', 'OUT'])

AND

(If {?CompRept} = "N" then
   True
 else if {?CompRept} = "R" then
   ({WR_REPORT.REPORTED_AS_DATE} in Date({?StartDateStr}) to Date({?EndDateStr}))
 else if {?CompRept} = "C" then
   ({WR_REPORT.WORK_REQUEST_COMPLETION_DATE} in Date({?StartDateStr}) to Date({?EndDateStr})))
and the Ultimate URL used to call the report is:
Code:
[URL unfurl="true"]http://<editedforsecurity>/Afms/includes/viewrpt.cwr?id=1333511&apstoken=<editedforsecurity>&promptex-County="ALL"&promptex-District="ALL"&promptex-EmpNbr="ALL"&promptex-PriorityCode="ALL"&promptex-FeedPoint="ALL"&promptex-HistoryFlag="active"&promptex-LMaintZone="ALL"&promptex-Municipality="ALL"&promptex-ReportedAsCode="ALL"&promptex-CompRept="N"&promptex-StartDateStr=""&promptex-EndDateStr=""&init=actx[/URL]

It does not prompt for the dates and , since the CompRept parameter is 'N', it returns all records regardless of Date.

In XI, it always prompts for the 2 Dates when the SAME URL ( just a server and token change) is used..
If I just place any string for the dates ( they are defined as string parameters and converted within the report) - it works fine - the 'N' keeps the dates from being used..




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Ahhhh, I see, URL passing, got it.

I didn't notice it was you posting or I would have known there was something valid to this...

I'm afraid I haven't tried this myself, I guess that I'd go with setting default values for the date parms as well, coding the record selection accordingly, rather than expecting nulls/blanks to pass muster.

-k
 
Hi,
That's what we eventually did..The drop-down list for the 2 Dates has 'No Date' as a default - this is fine with the reports since the CompRept='N' tells it to ignore the Date strings anyway..
Just an odd behavior to alter in the new version ( one of the less useful improvements in XI) [ponder] .

We also have a test in the code that, if something other than 'N' is chosen for the CompRept parameter ( there are 2 other values), then a valid Date must be entered/chosen..





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top