Dynamically display/hide columns according to user inputs
Hi,
I need to display or hide columns in reports based on user input. ie. I have several prompts, if user doesn't input values, then the associated columns will not be displayed in the report. Is there a way to achieve this in BO XI R2. Greatly appreciated for your help.
Hi Andy,
You can't hide them totally, but you can get close using alerters.
Build an alerter (probably a formula one) that put the value ="" in the field.
Now the formula should test the userresponse for that column,
based on the contents of it (filled in --> false, otherwise --> true).
Apply the alerter to all cells of the column. It will empty completely when the prompt was not filled.
Just set the width of the column to automatic (best use the header cell only) and the minimum width on zero. It will shrink the width when empty, making it seem as if hidden.
Good luck,
Marianne
Similar Messages
-
Can I dynamically display a product showing the user's options
I'm a total Flash newbie so please use small words
My customer manufactures small aluminum products that can be
anodized in several colors. The products can have simple line
graphic artwork or user-specified text engraved into them with an
NC milling machine. If the user wants to add text he also selects
one of several possible fonts. The engraving can also be colored to
contrast with the body of the part.
My customer wants a application (Windows or Web) that can
dynamically display the product as the user makes his choices: i.e,
display an image of the product in the chosen color, then show it
engraved with the artwork and/or text. The text should be shown in
the correct font.
The products, colors, artwork and fonts are all known but the
user's text is obviously unpredictable, so it's impossible to
simply prepare photos of every possible combination. Can Flash (or
something else) programmatically generate and overlay text and
artwork on an image? Can it alter the colors or should I simply
have a photo of every product in every color?
Is this possible? Is Flash the appropriate technology?
ThanksSteve,
I am not sure if you have any software to start with, so I
dunno exactly what you need. You need an image editor, some sort of
html editor, and of course Flash. The easy answer is the Web
Premium version of CS3. It should have all you need. If you already
have some of those tools, then the main thing you need is Flash.
There are also some free alternatives out there from web creation
and image editing, but they don't integrate quite as well as having
all Adobe products.
Some good learning resources can be found at Lynda.com. It
has a ton of tutorials on programs that you would need to do this
including Photoshop and Flash. A subscription is a bit pricey, but
when you think that one book can be $50, being able to access so
many tutorials really seems like a good value. Also, there are some
good print book available there that you could use as a buying
guide. You'll need to get into ActionScripting with with this, so
look for a basic intro to Flash CS3, and then something regarding
getting started with ActionScript 3.
These forums are a good resource as well, but mainly when
you have specific questions. People can answer "Why does my text
disappear when I use a mask over it?" but it is harder to answer,
"I want to build a picture library, how do I do that?"
- B
- B -
Displaying columns based on User Input
Hi,
I have a following requirement :
I have four columns in a report : Performance Indicator ,Target (XTD) , Actual (XTD),Indicator(Traffic Lights)
Based on the prompt, which contains column named as "Review Frequency" having values as 1. Monthly 2. Quaterly 3. Yearly.
When User select "Monthly" in pormpt I want to see MTD in Actual and Target column and Indicator depending on these columns.
When User select "Quaterly" in pormpt I want to see QTD in Actual and Target column and Indicator depending on these columns.
Can anybody tell me how can we achieve this?
I think I can achieve this with guided navigation but for that I have to create 3 reports.
Can anybody have any better idea to create just one report and based on user input I can show/hide columns in a single report?
This is mainly related to Balanced ScoreCard.
Thanks in advance
Regards,
Vikasyou have seperate columns for monthly, quarterly, and yearly, right?
In the prompt, save the "Review Frequency" as a Presentation Variable "abc";
In the request, you add actual (MTD) column, edit the formula, use something like:
CASE
WHEN @{abc}='Monthly' THEN "- SalesFacts"."actual (MTD)"
WHEN @{abc}='Quarterly' THEN "- SalesFacts"."actual (QTD)"
ELSE "- SalesFacts"."actual (YTD)"
END
then do the same thing for target column. -
Displaying alert message based on user input on input param screen
Hi,
Based on user input I wish to display an alert popup on my report. I
have provided the user 2 dropdowns called sortasc and sortdesc with all
the column names used in the report to simulate dynamic sorting.This is
because we do not have dynamic sorting in CR XI R2. When the user
selects same column name in both sortasc and sortdesc then the sort
type which has priority in the record sort expert is executed. This is fine but we want an alert
or message popup displayed so as to prevent user from selecting same
column names.
I tried adding an alert with the following code:
if {?sortasc} = {?sortdesc} then true else false
So far I have not been prompted with any alert message box.
Let me know if there is any other option.Hi Shalu,
I have created a alert and it is working fine, please follow the steps
Create a new Alert using two static parameters and give the condition for message like :
if {?Myworld} = {?Myworld1} Then
'You have entered a correct word'
else
'This is not a correct word'
Then create a condition like :
{?Myworld} = {?Myworld1} or {?Myworld} <> {?Myworld1}
Also check the check box Enabled and save the alert. Now it will popup if the myworld is equal to myworld1 or myworld is not equal to myworld1.
Hope this will help you
Thanks,
Sastry -
Dynamic Display/Hide/Disable/Enable Portal Tabs..
We have a Portal Page Group with multiple TABS. We like to be able to display/hide (or enable/disable) tabs based on the Portal Roles assigned to the current user.
Is it possible to Hide/Display tabs dynamically based on certain conditions? What is the best way to enforce this without creating multiple page groups?
ThanksTabs can have access privileges assigned, so out-of-the-box tab security would work. Was there some other condition you need to address?
-John -
Dynamically Show/Hide Columns
Hello friends
I am working on Crystal report 12.1
I have a table in SQL server with 24 fields.
Every 2nd field is bit field. kind of Visible True/False tag for previous column.
e.g. Name, Name_SH, Fund, Fund_SH -
Column names
Name, Fund stores value.
Name_SH stores, True/False for Name
Fund_SH stores, True/False for Fund
So, now, when I display report in Crystal report, user will select some fields from that 12 fields.
That will be processed throug Stored proc in SQL and feeds data in same table.
Now, in Report, How can I implement this situation, of display only columns with _SH = True.
and also, user need proper format, means, there should be equal space between all columns.
Please help me to solve this.
thanks in advance.
Thanks & Regards
UtkarshUNION to a single column with a secondary column for Type (field name) and remove invisible ones from the UNION process.
Then, use a CrossTab to show the final result. -
Dynamic rows increment according to user input in Table Control Module Pool
HI All,
I'm doing a Table Control module pool Program. Now suppose there are two fields - MATNR & MAKTX.
Our requirement is while weu2019ll give the material No (MATNR field), material desc. will be populated in corresponding field (MAKTX field),
Now the problem is, while we are entering Material No. in 1st row it is Material Desc. coming in to corresponding field but while the data is given to next row it replaces the 1st rows data .
eg - ............................... ........ MATNR.............................MAKTX
1st entry in 1st row ..................... 23................................... XXX --after pressing 'ENTER' mat desc XXX comes. now 2nd entry in 2nd row 24 .............................. YYY --after pressing 'ENTER'
1st row details like MATERIAL NO(23) & Desc(XXX) got deleted & that is replaced by 24 YYY
We can not extend that no. of rows of Table Control Table more than one row.
If you kindly help me how it is possible to increase the no. of rows of that table dynamically without replacing the previous row it will be very helpful for me.
Thanks & Regards,
BiswajitHi Biswajit,
This probably means that the table control PAI is modifying the first line always in the internal table instead of current line
eg: we wite the code
loop at screen and then modify the internal table with current line
table_control => name of table control as given on screen
in PAI of the screen
loop at internaltable.
modify internaltable index table_control-current_line .
put a break point here and see*
it will always be updating the first record because of some reason - logic error or coding error*
endloop.
Also in PBO we can see that the internal table will be having just one record after the action mentioned above....it is a case of overwrite
To simply increment the number of lines
table_control-lines = table_control-lines + 1. in PAI
Pls check and revert
Hope it helps
Regards
Byju -
Dynamically show/hide columns for DelimitedData output
My users want to see only dynamic sets of data from the same report query.
For example, if the query returns:
Date, Widget1Count, Widget2Count, ..., WidgetZCount
User1 wants to see Date and counts for widgets 1,2, 5, and 10
User2 wants to see Date and counts for widgets 2, 3, 4, 5, 10-20.
Uset3 wants to see Date and widget 99 count.
I don't want to write a custom report for every single user nor do I want to create Z! number of queries to satisfy every possible request combination.
I wonder, is there a way to change "Exclude from XML Output" property for a particular query field(s) from a report AfterPForm or BeforeReport trigger?Hi,
I had the same problem, but I saw the Metalink document: 340793.1, which gave the solution I needed.
In my case, I needed to limit the number of columns being outputted in a DELIMITEDDATA format based on a user parameter.
I ended up with the following code in my After PForm trigger, which did the job.
BEGIN
SRW.ADD_DEFINITION('<report DTDVersion="1.0">');
SRW.ADD_DEFINITION('<customize>');
-- For those columns I want displayed, Set the XMLSuppress property to False
FOR tmp IN 1 .. 10 LOOP
SRW.ADD_DEFINITION('<object name="col_'||LPAD(TO_CHAR(tmp), 3, '0')||'_title" type="REP_COL_MAP">');
SRW.ADD_DEFINITION('<properties>');
SRW.ADD_DEFINITION('<property name="XMLSuppress">False</property>');
SRW.ADD_DEFINITION('</properties>');
SRW.ADD_DEFINITION('</object>');
END LOOP;
-- For those column I don't want displayed, Set the XMLSuppress property to True
FOR tmp in 11 .. 100 LOOP
SRW.ADD_DEFINITION('<object name="col_'||LPAD(TO_CHAR(tmp), 3, '0')||'_title" type="REP_COL_MAP">');
SRW.ADD_DEFINITION('<properties>');
SRW.ADD_DEFINITION('<property name="XMLSuppress">True</property>');
SRW.ADD_DEFINITION('</properties>');
SRW.ADD_DEFINITION('</object>');
END LOOP;
SRW.ADD_DEFINITION('</customize>');
SRW.ADD_DEFINITION('</report>');
SRW.APPLY_DEFINITION;
END;
I hope this helps with your problem.
Paul -
How to display the column dyanmically depending upon input
I am doing a alv report of tax breaks in which i had 6 columns to be displayed as static and rest of ( vat tax )columns should be dynamic .
if i enter a p.o.document no then if that p.o has taxes
excise and excess then they should be displayed and vat field contain 0 or nodata then it should not be in output .pls let me know .Farukh Quadri
In the program, check if the PO has the EXCISE and EXCESS details. If yes, then make the FLAG = ' ' .
If the PO doesnot have EXCISE and EXCESS details then make FLAG = 'X'.
While biulding the Field Catalog, make that COLUMNS INVISIBLE depending upon the FLAG value
loop at locFieldCatalog.
case locFieldCatalog-fieldname.
when 'WERKS'.
locFieldCatalog-emphasize = 'X'.
locFieldCatalog-col_pos = 1.
modify locFieldCatalog.
when 'MATNR'.
locFieldCatalog-emphasize = 'X'.
locFieldCatalog-col_pos = 2.
modify locFieldCatalog.
<b> when 'EXCESS'.
if FLAG = 'X'.
locFieldCatalog-no_out = 'X'.
modify locFieldCatalog.
endif.</b>
endcase.
Please close your previous postings
Thanks
Kam -
How to hide report errors when user input incorrect?
I have a tabular report with output that's limited on date interval basis in the WHERE clause. So I have two date items that's used to set start and end dates accordingly. Both items have validations "Item specified is a valid date". How to hide error in report area when validation fires?
screenshot http://ehype.com.ru/tmp/rep_error.jpgHave you tried putting a condition on the report region of type "No Inline Validation Errors Displayed"?
Scott -
How to display the records based on user input
Hi all,
On the front end, there are two date fileds, for example, start and end. Whenever user enters start date and end date, i want to display those dates starting from start date to
end date whatever the user enters.
For example, user enters Start date : 01/15/2012 and End date : 01/19/2012
I want to display like this *01/15/2012 01/16/2012 01/17/2012 01/18/2012 01/19/2012*
Thanks in advance.
Thanks,
PalHello
You can generate a range of dates between two supplied variables with something like
var start_date varchar2(20)
var end_date varchar2(20)
exec :start_date:='01/15/2012';
exec :end_date:='01/19/2012';
SELECT
TO_DATE(:start_date,'mm/dd/yyyy') + (rownum-1)
FROM
dual
CONNECT BY
LEVEL <= (TO_DATE(:end_date,'mm/dd/yyyy') - TO_DATE(:start_date,'mm/dd/yyyy') ) + 1
TO_DATE(:START_DATE,
15-JAN-2012 00:00:00
16-JAN-2012 00:00:00
17-JAN-2012 00:00:00
18-JAN-2012 00:00:00
19-JAN-2012 00:00:00If you want to have them in columns you'd need to set an upper limit for the number of dates and use a pivot
SELECT
MAX(CASE WHEN date_idx = 1 THEN dt END) date1,
MAX(CASE WHEN date_idx = 2 THEN dt END) date2,
MAX(CASE WHEN date_idx = 3 THEN dt END) date3,
MAX(CASE WHEN date_idx = 4 THEN dt END) date4,
MAX(CASE WHEN date_idx = 5 THEN dt END) date5,
MAX(CASE WHEN date_idx = 6 THEN dt END) date6,
MAX(CASE WHEN date_idx = 7 THEN dt END) date7,
MAX(CASE WHEN date_idx = 8 THEN dt END) date8,
MAX(CASE WHEN date_idx = 9 THEN dt END) date9,
MAX(CASE WHEN date_idx = 10 THEN dt END) date10
FROM
( SELECT
rownum date_idx,
TO_DATE(:start_date,'mm/dd/yyyy') + (rownum-1) dt
FROM
dual
CONNECT BY
LEVEL <= (TO_DATE(:end_date,'mm/dd/yyyy') - TO_DATE(:start_date,'mm/dd/yyyy') ) + 1
) Or failing that, you could use string aggregation like so...
WITH dates AS
( SELECT
TO_DATE(:start_date,'mm/dd/yyyy') + (rownum-1) dt
FROM
dual
CONNECT BY
LEVEL <= (TO_DATE(:end_date,'mm/dd/yyyy') - TO_DATE(:start_date,'mm/dd/yyyy') ) + 1
SELECT LTRIM(MAX(SYS_CONNECT_BY_PATH(TO_CHAR(dt,'mm/dd/yyyy'),' '))
KEEP (DENSE_RANK LAST ORDER BY curr),',') AS dates
FROM (SELECT dt,
ROW_NUMBER() OVER (ORDER BY dt) AS curr,
ROW_NUMBER() OVER (ORDER BY dt) -1 AS prev
FROM dates)
CONNECT BY prev = PRIOR curr
START WITH curr = 1
DATES
01/15/2012 01/16/2012 01/17/2012 01/18/2012 01/19/2012HTH
David -
Displaying different reports based on user input.
Hi,
I have a requirement to display the invoiced amount and Ago amount on a dashboard. The ago amount will be dynamic in that if user selects the prompt 'compare with' as previous day, it should display day ago amount along with todays amount. It he chooses month, then it should display this month's amount and previous month's amount.
Is there a way I can achieve this on a dashboard?
Thanks,
Vivek.Use guided navigation. And you need to have 2 reports (one for day level and the other for month level, eac has own AGO part). And some reports for guided navigation conditions.
Regards
Goran
http://108obiee.blogspot.com -
Dynamic display of columns in pivot query
I have a table called STUDENT_SCORE . I need to display the avarage score /month for past 2 years and the monthly score till today' month.
So suppose this is April 2009. The report will look like
Roll_id 2007avg 2008avg Jan09 Feb 09 Mar09
101 80.9 70.9 89.7 56.8 90.9
102 70.9 23.9 87.2 90.0 76.8
I have tried a bit , but can not fix the display of monthly score dynamically.
the DDL/DML is as below
create table STUDENT_SCORE
(roll_id number,
mth_id date,
score number) ;
insert into STUDENT_SCORE values
(101, to_date('01/01/2006', 'mm/dd/yyyy') , 67.5);
insert into STUDENT_SCORE values
(101, to_date('02/01/2006', 'mm/dd/yyyy') , 77.5);
insert into STUDENT_SCORE values
(101, to_date('03/01/2006', 'mm/dd/yyyy') , 87.5);
insert into STUDENT_SCORE values
(101, to_date('04/01/2006', 'mm/dd/yyyy') , 27.5);
insert into STUDENT_SCORE values
(101, to_date('05/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('06/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('07/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('08/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('09/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('10/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('11/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('12/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('01/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('02/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('03/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('04/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('05/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('06/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('07/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('08/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('09/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('10/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('11/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('12/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('01/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('02/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('03/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('04/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('05/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('06/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('07/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('08/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('09/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('10/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('11/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('12/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(101, to_date('01/01/2009', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('01/01/2006', 'mm/dd/yyyy') , 67.5);
insert into STUDENT_SCORE values
(102, to_date('02/01/2006', 'mm/dd/yyyy') , 77.5);
insert into STUDENT_SCORE values
(102, to_date('03/01/2006', 'mm/dd/yyyy') , 87.5);
insert into STUDENT_SCORE values
(102, to_date('04/01/2006', 'mm/dd/yyyy') , 27.5);
insert into STUDENT_SCORE values
(102, to_date('05/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('06/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('07/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('08/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('09/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('10/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('11/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('12/01/2006', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('01/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('02/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('03/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('04/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('05/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('06/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('07/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('08/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('09/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('10/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('11/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('12/01/2007', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('01/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('02/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('03/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('04/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('05/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('06/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('07/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('08/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('09/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('10/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('11/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('12/01/2008', 'mm/dd/yyyy') ,57.5);
insert into STUDENT_SCORE values
(102, to_date('01/01/2009', 'mm/dd/yyyy') ,57.5);Hi,
Run this script:
-- Suppress SQL*Plus features that interfere with raw output
SET FEEDBACK OFF
SET LINESIZE 200
SET PAGESIZE 0
-- The prelimiary query produces two rows like this, for the last two complete years
-- , AVG (CASE WHEN TO_CHAR (mth_id, 'YYYY') = '2008' THEN score END) AS "2008avg"
-- It also produces 0 to 11 rows like the following, for every complete month in the current year
-- , AVG (CASE WHEN TO_CHAR (mth_id, 'YYYYMM') = '200901' THEN score END) AS "Jan09"
SPOOL dynamic_part.sql
-- Preliminary query, to create dynamic_part.sql
SELECT ', AVG (CASE WHEN TO_CHAR (mth_id, ''YYYY'
|| CASE -- Add 'MM' except for 1st two rows
WHEN LEVEL > 2
THEN 'MM'
END
|| ''') = '''
|| CASE -- YYYY or YYYYMM
WHEN LEVEL <= 2
THEN TO_CHAR ( ADD_MONTHS ( &target_month
, 12 * (-3 + LEVEL)
, 'YYYY'
ELSE TO_CHAR ( ADD_MONTHS ( TRUNC (&target_month, 'YYYY')
, LEVEL - 3
, 'YYYYMM'
END
|| ''' THEN score END) AS "'
|| CASE -- '2008avg' or 'Jan09'
WHEN LEVEL <= 2
THEN TO_CHAR ( ADD_MONTHS ( &target_month
, 12 * (-3 + LEVEL)
, 'YYYY"avg'
ELSE TO_CHAR ( ADD_MONTHS ( TRUNC (&target_month, 'YYYY')
, LEVEL - 3
, 'MonYY'
END
|| '"'
FROM dual
CONNECT BY LEVEL <= 2 + MONTHS_BETWEEN (&target_month, TRUNC (&target_month, 'YYYY'))
SPOOL OFF
-- Restore SQL*Plus features suppressed earlier
SET FEEDBACK ON
SET LINESIZE 80
SET PAGESIZE 50
-- Main query
SELECT roll_id
@dynamic_part.sql
FROM student_score
GROUP BY roll_id
ORDER BY roll_id;
{code}
I defined the substitution variable target_month like this:
{code}
DEFINE target_month = "TO_DATE ('April 2009', 'Month YYYY')"
{code}
You can use SYSDATE wherever I used &target_month.
With the sample data you posted, I got this output:
{code}
. ROLL_ID 2007avg 2008avg Jan09 Feb09 Mar09
101 57.5 57.5 57.5
102 57.5 57.5 57.5
{code} -
Dynamically generating and printing output from user input on pdf form
Hi Everyone,
I am consider the purchase of of Designer with the hopes of doing something really simple (and hopefully in a simple way)
I would like to present the user with a form which they will fill out. On clicking a "submit button", I would like to generate a letter and have it print out based on the information provided in this form (note, the user doesn't ever really even need to see the letter).
Would Designer be able to do something like this? I have been messing around with the trial version, so I am somewhat familiar with the scrip language. For instance, I am at the point where I would be able to get all the information, and generate the letter in HTML stored in a string object. But I wouldn't know what to do with this string to render and print it.
Thanks!
- DaveI have just downloaded the trial version of Acrobat 7. It appears that if you want to create a new form, it pretty much brings you to Designer... which is really fine by me.
I appreciate everyone telling me that it is doable, I'm still left with the problem of what I should actually do to do it! =)
- Dave -
To select columns based on user's input
hi all..
i am beginner in oracle forms 6i..
i want to select columns in my query according to user's input?
how can i do it in my oracle forms 6i?
i am using a graph in my oracle form and i want to plot graph according to user input?
in my graph i have to show sum of only those colums which are selected by user at run time?
how is it possible?please tell me the method in detail?Thanks for the Reply sir,
When you say Write the Code, you are referring to the Package is that correct,unfortunately I am not implementing this via PL/SQL Package.
you mentioned that I can Implement the Logic in the Data definition file( which is a XML file), how and Where I have print use that IF construct (or) Can you Please Print the Code snippet in the Model XML template that i have pasted in my Post.
May i know what is this
ln_req_id := fnd_request.submit_request -- for XML1 For...
Sorry about my ignorance...
Maybe you are looking for
-
Java.lang.SecurityException: Jurisdiction policy files are not signed by t
Hi *I am installing ECC6 onAIX 6.1 with oarcle 10g.* *I am getting error in create secure store* *Policy and security files are ok,* aused by: java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.initialize(J9VMInternals.java:218)
-
Photoshop CC crashing while using gradients.
While using PS CC on a Macbook Pro with Mavericks, 16gb of RAM and 80gb of space on an SSD I get crashes while using the gradient tool. I'll make a curve, fill the mask and select the gradient tool to use in the mask. If I switch from black to white
-
I was watching a movie last night on airplay from my mini iPad 2 and the airplay signal just disappeared 12 min before end of movie. ?
-
Sony has received reports from a number of PRST1 owners that the Reader software has been causing bookmarks and notes to be duplicated with some of their books. Sony engineering is aware of the issue and is currently working on a solution which will
-
HT204266 I upgraded an app and it charged me for 2 of them what can i do???
Please help I upgraded an app and got charged for 2 of them what can I do?