This article focuses on using the 
Prompt API against the Tree prompt making it easier to use the Tree 
prompt against a relational model.
This method works for multi-select tree 
prompts as well. The solution can be extended to get prompt selected 
data for the various levels and using them individually in the reports 
for various other solutions.
Using this method we can do away with writing complex macros to massage the prompt data to suit the relational model.
The solution is simple:
Assuming the MUNs have Year, Q, Month 
included in them to help identify the levels, if not you will have to 
modify the sections referring to val.indexOf(“Year”), val.indexOf(“Q”), 
val.indexOf(“Month”) to match your MUN sections to identify Year, 
Quarter and Month:
Have a couple of hidden text box prompts in the report depending on the number of levels you have in the tree prompt.
Use the prompt API to get the list of selected prompt values.
Use the prompt API to get the list of selected prompt values.
- Identify the level of the selected prompt value.
- Transform the prompt value to a relational value.
- Append the prompt value in the respective text box prompt.
- Create filters in the query passing in the text box prompt values.
Step 1: Create the tree prompt and a list report to get the required data.
Step 2: Name the tree prompt as “treePrompt”.
Step 3: Create 3 hidden text box prompts named YearPrompt, QrtrPrompt, MonthPrompt.
Step 4: Create filters in the list query
 to accept the parameter values from YearPrompt, QuarterPrompt, 
MonthPrompt as mentioned below:
(#csv(split(‘;’,promptMany(‘pYear’,’token’)))#)
(#csv(split(‘;’,promptMany(‘pYear’,’token’)))#)
Step 5: Insert an HTML item with the below prompt API code:
 
No comments:
Post a Comment