Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Generating dynamic report
Ronak
Hii,
I have one different scenario here.
I have one procedure and from that I have to generate report.
I have attached a procedure.
EG:
If user_id = 1
then the column should be dispayed from table_A
elsif user_id = 2
then the column should be dispayed from table_B
end;
Also the condition is that I have to display only those columns which are in REF cursors.
I have no idea of how to doing it.
I have to do it with using that procedure only. please tell me how to do that. I possible than please send an small example.
I just have one idea that I share with you:
1.We can do the scenario like that if by default we have one big table of almost 200 columns.
2.Then as per the UserId, since different user have different columns we can attach data to the tables and just hide the vacant(empty) columns.
This is the idea I have but I don'
Find more posts tagged with
Comments
mwilliams
Ok, so you have a dataSet that has 200 columns and you want to only show specific columns for specific users? If so, you could create your table dynamically in the beforeFactory script based on the user number, that I'm assuming is passed through a parameter. Or, you could hide or drop the unneeded columns based on the user id parameter. Let me know if my first assumption is correct.
Ronak
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79153" data-time="1309209334" data-date="27 June 2011 - 02:15 PM"><p>
Ok, so you have a dataSet that has 200 columns and you want to only show specific columns for specific users? If so, you could create your table dynamically in the beforeFactory script based on the user number, that I'm assuming is passed through a parameter. Or, you could hide or drop the unneeded columns based on the user id parameter. Let me know if my first assumption is correct.<br /></p></blockquote>
<br />
<br />
<br />
No You are getting it wrong.<br />
What I wants is that I have one procedure which I send you already. In that procedure there are three tables with different columns. I just want to display the table in the table format as per UserID.<br />
So just tell me how can I do that dynamically with that procedure.
mwilliams
3 database tables or 3 report design tables? If you have 3 database tables that you want to switch between but the columns are named the same, you could just change your query depending on the user. If there are 3 tables in your report design and you only want to show specific ones depending on the user, you could drop the tables you don't need from the design in your beforeFactory script. If I'm still getting it wrong, please explain it with a simple example. Thanks.
Ronak
Hi Williams,
Here is that procedure:
CREATE OR REPLACE PROCEDURE doExcelExport( pvModuleName Varchar2,
rcColList OUT ERM.RC ) AS
BEGIN
If pvModuleName = 'TEST1' then
OPEN rcColList FOR
SELECT USER_ID,
LOGIN_DATE,
LOGIN_DAY,
DAY_TYPE,
LOGIN_TIME,
LOGOUT_TIME,
WORK_HOURS,
BREAK_HOURS
FROM SR_1189
ORDER BY Login_Date;
Elsif pvModuleName = 'TEST2' then
OPEN rcColList FOR
SELECT DOMAIN_NAME,
ATTRIBUTE,
ATTRIB_VALUE
FROM T_DOMAIN;
Elsif pvModuleName = 'TEST3' then
OPEN rcColList FOR
SELECT LANG_CODE,
LANG_NAME,
LANG_KEY
FROM T_LANG;
End If;
Exception
When Others Then
Null;
END doExcelExport;
Now with the help of this procedure I have to create generate the table as per the user. i.e If user enters TEST1 as parameter the the tabular report should be generated of table SR1189. How to do that.
In case please send me some idea.
Thanks,
Ronak
Hans_vd
Hi Ronak,
I'd go like this:
- Create three different data sets that call that same procedure with the paramter value hardcoded (so the strings 'TEST1', 'TEST2' and 'TEST3' will be the parameter values)
- Then create three different tables on the report, each one based on one of the datasets
- Use the visibility property of the tables to hide two of the tables
Hope this helps
Hans_vd
JasonW already provided a solution that removes the tables in a script, instead of hiding. Didn't that work out for you?