0

Is there a way to pass multiple filters to an Intractive Report via the URL?

For one filter it works like this:

/pls/apex/f?p=100:1:123456::::IRC_line:0
Bharata
  • 13,509
  • 6
  • 36
  • 50
Felix
  • 3
  • 1
  • 5

1 Answers1

3

General rule

Syntax for using f?p to link pages is:

f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly

If you have more than one value that you want to pass in your itemNames and itemValues segments, you should separate them with ',' like this:

f?p=App:Page:Session:Request:Debug:ClearCache:item1_Name,item2_Name,item3_Name:item1_Value,item2_Value,item3_Value:PrinterFriendly

Your example

For filling apex items on your target page:

/pls/apex/f?p=100:1:123456::::IRC_line,Other_item,Another_item:0,0,0

If they don't already exist,you must then create those items (IRC_line, Other_item and Another_item, for this example) on your target page and include those items in your SQL query that generates your interactive report. That way, on page load, data you passed will be given to your items and those values will be taken into account when your interactive report generates.

On the other hand, if you want to pass values directly to your Interactive report (IR), then you can write the URL in following syntax, in place of above mentioned itemNames:itemValues part of the URL:

IR_COLUMN1,IR_COLUMN2:EQ_VALUE1,EQ_VALUE2

where instead of COLUMN1 and COLUMN2 you write-in names of your IR columns, and in the place of EQ_VALUE1 and EQ_VALUE2 you write-in values you want your corresponding columns to be equal to.

For example, if you want your condition to be like where streetname = 'A' and number = 1, you would write the following (built upon your app's app ID, page number and some session):

/pls/apex/f?p=100:1:123456::::IR_STREETNAME,IR_NUMBER:A,1

With a slight change of syntax, you can change your condition from equal to, for example, greater than or less than by changing IR_NUMBER to IRGT_NUMBER when you want you condition to be number > 1 instead of number = 1 or changing IR_NUMBER to IRLT_NUMBER when you want your condition to be number < 1 instead of number = 1, respectively.

Corresponding documentation, as you yourself found: https://docs.oracle.com/database/121/HTMDB/bldapp_rpt_int.htm#HTMDB28370

Goran Kutlaca
  • 2,014
  • 1
  • 12
  • 18
  • I already tried that. but he brings this error message: ERR-1002 Unable to find item ID for item "Other_item" in application "100". – Felix Aug 22 '18 at 13:41
  • When I create a text field with the id "Other_item" apex fills that with the second value – Felix Aug 22 '18 at 13:41
  • Of course, `IRC_line` , `Other_item` and `Another_item` must be the existing items on your target page, that you want to fill with values (in this example those values would be `0` for all three items). – Goran Kutlaca Aug 22 '18 at 13:45
  • But how can I use the values from the text fields as a filter for my interactive report? – Felix Aug 22 '18 at 13:53
  • @Felix You must create those items on your target page and include those items in your SQL query that generates your interactive report. That way, on page load, data you passed will be given to your items and those values will be taken into account when your interactive report generates. – Goran Kutlaca Aug 22 '18 at 13:57
  • You can do in this way, but you can filter IR without using item. Just to check: https://docs.oracle.com/database/apex-5.1/HTMDB/linking-to-interactive-reports.htm#HTMDB30108 – romeuBraga Aug 22 '18 at 18:39
  • there is no possibility to set the filters directly via the link? without the detour with the text fields. e.g. as here only with several filters: https://docs.oracle.com/database/121/HTMDB/bldapp_rpt_int.htm#BABDHIDJ – Felix Aug 29 '18 at 09:08
  • @Felix It can be done, but than specify me column names you want to filter and values you want to filter them by (equals to something, greater than some value etc.) – Goran Kutlaca Aug 29 '18 at 09:29
  • streetname = A and number = 1 table: streetname | number ----------------|-------- A | 1 ----------------|-------- B | 1 ----------------|-------- A | 2 ----------------|-------- A | 1 ----------------|-------- B | 1 result: streetname | number ----------------|-------- A | 1 ----------------|-------- A | 1 – Felix Aug 29 '18 at 12:34
  • sorry I don't know how to add a table – Felix Aug 29 '18 at 12:35
  • @Felix I updated my answer with example on your data. See if that helps you. – Goran Kutlaca Aug 29 '18 at 14:15
  • But then I have again the problem that I described in my first comment. – Felix Sep 04 '18 at 05:17
  • @Felix Does it say that there is no column named `USERNAME` in your interactive report? What is the message? Do you have the column named `USERNAME`? If not, have you changed the code above to include the real name of your column instead of `USERNAME`? – Goran Kutlaca Sep 04 '18 at 07:40
  • This is the message: ERR-1002 Unable to find item ID for item "USERNAME" in application "100". – Felix Sep 04 '18 at 07:46
  • @Felix But there is no string `USERNAME` anywhere in my answer or in data you said you use.... Can you post in your question the select statement you use for this report.. – Goran Kutlaca Sep 04 '18 at 12:48
  • I have found a solution for my problem. /pls/apex/f?p=100:1:123456::::IR_line,IR_otherline:0,5 Thanks for your help!! – Felix Sep 05 '18 at 09:24
  • @Felix Glad you found it :) What is the difference between that line of code and the one stated in my answer? – Goran Kutlaca Sep 05 '18 at 09:47
  • I don't know. Do you know if there is any way to do this backwards? For example, I have set a filter for myself and want to send the link to a colleague. – Felix Sep 05 '18 at 11:45