Home » Developer & Programmer » Reports & Discoverer » How can we dynamically show the selected fields (oracle reports 10g with oracle 11g database)
How can we dynamically show the selected fields [message #625415] Wed, 08 October 2014 01:38 Go to next message
rocky_007
Messages: 36
Registered: March 2012
Location: India
Member
Hello Everyone,

I have one table which have results stored in 5 fields. In the parameter form, I am asking the user to choose the fields to be shown. User can select all the fields or any one of them.
In the report the results should come as per his selection.

I have tried using lexical parameter but it has the restriction.

code for the test table:
CREATE TABLE TESTING1
(
  ID  NUMBER,
  T1  NUMBER,
  T2  NUMBER,
  T3  NUMBER,
  T4  NUMBER,
  T5  NUMBER
)
Insert into TESTING1
   (ID, T1, T2, T3, T4, 
    T5)
 Values
   (1, 1, 2, 3, 4, 
    5);
Insert into TESTING1
   (ID, T1, T2, T3, T4, 
    T5)
 Values
   (2, 1, 2, 3, 4, 
    5);
Insert into TESTING1
   (ID, T1, T2, T3, T4, 
    T5)
 Values
   (3, 1, 2, 3, 4, 
    5);
Insert into TESTING1
   (ID, T1, T2, T3, T4, 
    T5)
 Values
   (4, 1, 2, 3, 4, 
    5);


Please help.
Re: How can we dynamically show the selected fields [message #625421 is a reply to message #625415] Wed, 08 October 2014 02:55 Go to previous messageGo to next message
cookiemonster
Messages: 13958
Registered: September 2008
Location: Rainy Manchester
Senior Member
Use format triggers to hide the fields the users haven't selected.
Re: How can we dynamically show the selected fields [message #625422 is a reply to message #625421] Wed, 08 October 2014 03:25 Go to previous messageGo to next message
rocky_007
Messages: 36
Registered: March 2012
Location: India
Member
Yes I have tried format trigger also but suppose if the user only selects the last field (i.e. test 5 in our table) then the report will show space for 1 to 4 field and then last field.... it will not look good.
Re: How can we dynamically show the selected fields [message #625423 is a reply to message #625422] Wed, 08 October 2014 03:43 Go to previous messageGo to next message
cookiemonster
Messages: 13958
Registered: September 2008
Location: Rainy Manchester
Senior Member
True, reports isn't really designed to cater for this requirement.
You could try combining all the columns into a single result column, using || and nullif and then probably the pad functions to get uniform spacing.
Re: How can we dynamically show the selected fields [message #625424 is a reply to message #625423] Wed, 08 October 2014 03:49 Go to previous messageGo to next message
rocky_007
Messages: 36
Registered: March 2012
Location: India
Member
I have tried that also but all the fields come nearby and I was unable to put space between them.

Re: How can we dynamically show the selected fields [message #625425 is a reply to message #625424] Wed, 08 October 2014 03:52 Go to previous message
rocky_007
Messages: 36
Registered: March 2012
Location: India
Member
I have found one solution for this. I have selected all the fields in the main query and used same amount of formula columns in it. Now, according to the selection I am filling the data into the Formula columns.

Thanks cookiemonster for your consent.
Previous Topic: Re: Oracle Reports 6i log on screen
Next Topic: Database value with Arabic , english letters and digits
Goto Forum:
  


Current Time: Sat Nov 23 06:06:17 CST 2024