SQL Report Help
SELECT case prod_family
WHEN 'CENTRALINK' THEN 'Total CENTRALINK'
WHEN 'DATA' THEN 'Total DIGITAL '
When 'MSGWKS' then 'Total MESSAGEWORKS'
WHEN 'TERM PLAN' then 'Total TOLL'
WHEN 'TERM PLANS' then 'Total TOLL'
Else 'Total OTHER' End
AS inwd_agent_tie,alternate_prod_cd,payment_type_cd,
TOLL_NON_TOLL,prod_category
CASE CNT460_COMM_DATA.payment_type_cd
when 'NEW' then 'NEW'
When 'ADD' then 'NEW'
when 'UP' then 'RE'
when 'RE' then 'RE'
when 'WB' then 'NEW'
when 'REVD' then 'RE'
FROM (
select inwd_agent_tie, alternate_prod_cd, payment_type_cd,
decode(to_char(TOLL_NON_TOLL),'1','DIGITAL','TOLL'), prod_category
,sum(JanAmt), sum(FebAmt), sum(MarAmt), sum(AprAmt),
SUM(JanAmt+FebAmt+MarAmt+AprAmt) as YTDAmt
from (select
inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2) AS TOLL_NON_TOLL, prod_category ,
sum(decode(forc_tcvrev_paid,null, calc_tcvrev_paid,
forc_tcvrev_paid)) as JanAmt, 0 as FebAmt, 0 as MarAmt, 0 as AprAmt
from cnt350_inward_data a, cnt380_tran_data b, cnt460_comm_data c
where a.inwd_ref_nbr = b.inwd_ref_nbr
and a.inwd_ref_nbr = c.inwd_ref_nbr
and subsid_cd = 'EAST'
and a.inwd_agent_tie = '58'
and cycle_date >= '01-JAN-08'
and cycle_date <= '31-JAN-08'
and status_cd = 'OSCPD'
and decode(forc_tcvrev_paid,null, calc_tcvrev_paid, forc_tcvrev_paid)
<> 0 group by inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2), prod_category union all select
inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2) AS TOLL_NON_TOLL, prod_category ,0 as JanAmt,
sum(decode(forc_tcvrev_paid,null, calc_tcvrev_paid,
forc_tcvrev_paid)) as FebAmt, 0 as MarAmt, 0 as AprAmt from
cnt350_inward_data a, cnt380_tran_data b, cnt460_comm_data c where
a.inwd_ref_nbr = b.inwd_ref_nbr
and a.inwd_ref_nbr = c.inwd_ref_nbr
and subsid_cd = 'EAST'
and a.inwd_agent_tie = '58'
and cycle_date >= '01-FEB-08'
and cycle_date <= '29-FEB-08'
and status_cd = 'OSCPD'
and decode(forc_tcvrev_paid,null, calc_tcvrev_paid, forc_tcvrev_paid)
<> 0 group by inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2), prod_category union all select
inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2) AS TOLL_NON_TOLL, prod_category ,0 as JanAmt,
0 as FebAmt, sum(decode(forc_tcvrev_paid,null, calc_tcvrev_paid,
forc_tcvrev_paid)) as MarAmt, 0 as AprAmt from cnt350_inward_data a,
cnt380_tran_data b, cnt460_comm_data c where a.inwd_ref_nbr =
b.inwd_ref_nbr
and a.inwd_ref_nbr = c.inwd_ref_nbr
and subsid_cd = 'EAST'
and a.inwd_agent_tie = '58'
and cycle_date >= '01-MAR-08'
and cycle_date <= '31-MAR-08'
and status_cd = 'OSCPD'
and decode(forc_tcvrev_paid,null, calc_tcvrev_paid, forc_tcvrev_paid)
<> 0 group by inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2), prod_category union all select
inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2) AS TOLL_NON_TOLL, prod_category ,0 as JanAmt,
0 as FebAmt, 0 as MarAmt, sum(decode(forc_tcvrev_paid,null,
calc_tcvrev_paid, forc_tcvrev_paid)) as AprAmt from cnt350_inward_data
a, cnt380_tran_data b, cnt460_comm_data c where a.inwd_ref_nbr =
b.inwd_ref_nbr
and a.inwd_ref_nbr = c.inwd_ref_nbr
and subsid_cd = 'EAST'
and a.inwd_agent_tie = '58'
and cycle_date >= '01-APR-08'
and cycle_date <= '30-APR-08'
and status_cd = 'OSCPD'
and decode(forc_tcvrev_paid,null, calc_tcvrev_paid, forc_tcvrev_paid)
<> 0 group by inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2), prod_category
) A
group by inwd_agent_tie, TOLL_NON_TOLL, alternate_prod_cd,
payment_type_cd, prod_category order by 1,2,3
) as CNT350_INWARD_DATA join
CNT380_TRAN_DATA ON
CNT350_INWARD_DATA.INWD_REF_NBR = CNT380_TRAN_DATA.INWD_REF_NBR
option (maxdrop 1)I am getting error as ORA-00923: FROM keyword not found where expected
Now I have corrected the code as you have told
but I think the ) AS CNT350_INWARD_DATA JOIN CNT460_COMM_DATA ON
CNT350_INWARD_DATA.INWD_REF_NBR = CNT460_COMM_DATA.INWD_REF_NBRstatement is giving error to me...
SELECT case cnt350_inward_data.prod_family
WHEN 'CENTRALINK' THEN 'Total CENTRALINK'
WHEN 'DATA' THEN 'Total DIGITAL '
When 'MSGWKS' then 'Total MESSAGEWORKS'
WHEN 'TERM PLAN' then 'Total TOLL'
WHEN 'TERM PLANS' then 'Total TOLL'
Else 'Total OTHER' End
AS rptgroup,inwd_agent_tie,
alternate_prod_cd,payment_type_cd,
TOLL_NON_TOLL,prod_category,
CASE CNT460_COMM_DATA.payment_type_cd
when 'NEW' then 'NEW'
When 'ADD' then 'NEW'
when 'UP' then 'RE'
when 'RE' then 'RE'
when 'WB' then 'NEW'
when 'REVD' then 'RE'
else 'OTHER' end as payment_type_cd,
sum(JanAmt), sum(FebAmt), sum(MarAmt), sum(AprAmt),
SUM(JanAmt+FebAmt+MarAmt+AprAmt) as YTDAmt
from (
select inwd_agent_tie, alternate_prod_cd, payment_type_cd,
decode(to_char(TOLL_NON_TOLL),'1','DIGITAL','TOLL'), prod_category
,sum(JanAmt), sum(FebAmt), sum(MarAmt), sum(AprAmt),
SUM(JanAmt+FebAmt+MarAmt+AprAmt) as YTDAmt
from (
select inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2) AS TOLL_NON_TOLL, prod_category ,
sum(decode(forc_tcvrev_paid,null, calc_tcvrev_paid,
forc_tcvrev_paid)) as JanAmt, 0 as FebAmt, 0 as MarAmt, 0 as AprAmt
from cnt350_inward_data a, cnt380_tran_data b, cnt460_comm_data c
where a.inwd_ref_nbr = b.inwd_ref_nbr
and a.inwd_ref_nbr = c.inwd_ref_nbr
and subsid_cd = 'EAST'
and a.inwd_agent_tie = '58'
and cycle_date >= '01-JAN-08'
and cycle_date <= '31-JAN-08'
and status_cd = 'OSCPD'
and decode(forc_tcvrev_paid,null, calc_tcvrev_paid, forc_tcvrev_paid)
<> 0 group by inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2), prod_category
union all
select inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2) AS TOLL_NON_TOLL, prod_category ,0 as JanAmt,
sum(decode(forc_tcvrev_paid,null, calc_tcvrev_paid,
forc_tcvrev_paid)) as FebAmt, 0 as MarAmt, 0 as AprAmt from
cnt350_inward_data a, cnt380_tran_data b, cnt460_comm_data c where
a.inwd_ref_nbr = b.inwd_ref_nbr
and a.inwd_ref_nbr = c.inwd_ref_nbr
and subsid_cd = 'EAST'
and a.inwd_agent_tie = '58'
and cycle_date >= '01-FEB-08'
and cycle_date <= '29-FEB-08'
and status_cd = 'OSCPD'
and decode(forc_tcvrev_paid,null, calc_tcvrev_paid, forc_tcvrev_paid)
<> 0 group by inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2), prod_category
union all
select inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2) AS TOLL_NON_TOLL, prod_category ,0 as JanAmt,
0 as FebAmt, sum(decode(forc_tcvrev_paid,null, calc_tcvrev_paid,
forc_tcvrev_paid)) as MarAmt, 0 as AprAmt from cnt350_inward_data a,
cnt380_tran_data b, cnt460_comm_data c where a.inwd_ref_nbr =
b.inwd_ref_nbr
and a.inwd_ref_nbr = c.inwd_ref_nbr
and subsid_cd = 'EAST'
and a.inwd_agent_tie = '58'
and cycle_date >= '01-MAR-08'
and cycle_date <= '31-MAR-08'
and status_cd = 'OSCPD'
and decode(forc_tcvrev_paid,null, calc_tcvrev_paid, forc_tcvrev_paid)
<> 0 group by inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2), prod_category
Union all
select inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2) AS TOLL_NON_TOLL, prod_category ,0 as JanAmt,
0 as FebAmt, 0 as MarAmt, sum(decode(forc_tcvrev_paid,null,
calc_tcvrev_paid, forc_tcvrev_paid)) as AprAmt from cnt350_inward_data
a, cnt380_tran_data b, cnt460_comm_data c where a.inwd_ref_nbr =
b.inwd_ref_nbr
and a.inwd_ref_nbr = c.inwd_ref_nbr
and subsid_cd = 'EAST'
and a.inwd_agent_tie = '58'
and cycle_date >= '01-APR-08'
and cycle_date <= '30-APR-08'
and status_cd = 'OSCPD'
and decode(forc_tcvrev_paid,null, calc_tcvrev_paid, forc_tcvrev_paid)
<> 0 group by inwd_agent_tie, alternate_prod_cd, payment_type_cd,
DECODE(MAN_CD,NULL,1,2), prod_category
) A
group by inwd_agent_tie, TOLL_NON_TOLL, alternate_prod_cd,
payment_type_cd, prod_category order by 1,2,3
) AS CNT350_INWARD_DATA JOIN CNT460_COMM_DATA ON
CNT350_INWARD_DATA.INWD_REF_NBR = CNT460_COMM_DATA.INWD_REF_NBR
Similar Messages
-
Hi All,
I am creating a report which is having 2 sql queries ,1 for the main columns that i need to show and 2 from total sum and count.
Report is something as given below
SET TAB OFF;
set linesize 1500;
set pagesize 50;
SET FEEDBACK OFF;
SET WRAP OFF
COLUMN today NEW_VALUE VAR1 NOPRINT;
TTITLE LEFT 'ABC Inc.' SKIP 1 -
LEFT 'Daily Report' SKIP 1 -
LEFT 'As Of ' VAR1 SKIP 2
BTITLE LEFT SKIP 'Page No : ' FORMAT 9999999999 SQL.PNO SKIP 3;
COL SR_NO HEADING 'Seq' FORMAT 999999;
COL REFNO HEADING 'Ref No' FORMAT A20;
COL ORIG_NAME HEADING ' Branch Name'
FORMAT A50;
SELECT ROWNUM SR_NO,
REF_NO REFNO,
ORIGIN_NAME BRNAME
FROM BANK
WHERE PASS_CD=101
SELECT ' Failure Count : '|| NVL(COUNT(DECODE(CODE,1,CODE,NULL)),0) ||
' Failure Total Amt : '|| NVL(SUM(DECODE(CODE,799,AMT,NULL)),0)
|| CHR(10) ||
' Successful Count : '|| NVL(COUNT(DECODE(CODE,000,CODE,NULL)),0) ||
' Successful Total Amt: '|| NVL(SUM(DECODE(CODE,000,AMT,NULL)),0)
FROM BANK;
CLEAR BREAKS;
CLEAR COLUMN;
TTITLE OFF;
When i am running this second query output is going to secong page and title is repeated again and same as 1rst page is showing page no-1
Kindly help me,i want the output on the same page at bottom.
Thanksi think its only work in ISQL* PLUS enivironment iam
not sure.It does work in SQL*Plus
is that i can use in the package??http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12048.htm -
Please Help - SQL Report long column value required in a separate cell
Hi.
I need to create a SQL report with the structure like below:
Country State City Vertical Business Details (detail desc)
US MA Quincy Healthcare
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
US MA Braintree IT
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
This is a detail desc value that needs to displayed in a different cell.
I came through a solution where you can hide/display the long column value in a different cell. But my requirement is that it should be displayed when the page opens and user don;t want to click on a button to see the value. This is mainly for their presentations and printing. so its very annoying for them to click on so many buttons to see the detail desc value for every record. I am new to Java script, Please helpI'm not sure I understand your requirements--are you showing us 2 lines of data, 7 lines, or 9? Do you want the long detail description on the same row, or underneath it?
I'm going to go on the assumption that you're showing us two rows, and that the long descriptions in this example happen to be 3-4 lines long, and that you want the long descriptions underneath the details. In which case, I suggest using "named column" templates. They're a lot easier to use than they appear when you first look at them, so bear with me.
Under "Shared Components", select "Templates", and then click on the yellow Create> button. You're creating a report template, from scratch. On the final page of the wizard, select "Named Column (row template)" for the template type. This will create a rather generic (and useless) template, which you'll have to edit; I don't know why they chose to not send you straight into the editor. When you edit it, you'll see that the only field with a value in it is "Row Template 1", and it's set to:
<tr><td>#1#</td><td>#2#</td><td>#3#</td><td>#4#</td><td>#5#</td></tr>For meeting your requirements with basic functionality, change it to something along the lines of:
<tr><td>#COUNTRY#</td><td>#STATE#</td><td>#CITY#</td><td>#VERT#</td></tr>
<tr><td colspan="4">#DETAILS#</td></tr>Then you'll probably want to put something under Column Heading Template, like:
<tr><td>Country</td><td>State</td><td>City</td><td>Vertical Business</td></tr>
<tr><td colspan="4">Details</td></tr>Apply whatever CSS styles you want to it, of course.
Using the template is straightforward: if your report, chose the template, and make sure your SQL returns values using the column names you specified in your template. Otherwise, you'll see literal "#COUNTRY#" text in your report.
You can get fancy with these, of course, such as applying different styles to alternating rows, but I'll leave this as good enough to get you started (I hope).
-David -
SQL Report with 1 updatable column - help urgent
Hi,
I have a SQL report. I am using collection to store value of selected record by link column.
I have a updatable text item (NULL) in the column. I am able to store that value in the collection.
Any clue?
Code
1. Creating a collection in parent page:
apex_collection.create_or_truncate_collection
(p_collection_name => 'ORDER');
2. Query to populate item rows with option to key 'QTY' before pressing 'Add to Order' link.
select
itemcode,
description,
NULL AS qty,
'Add to Order' add_to_order
from itemtab
3. Made 'QTY' to Text item -- to allow users to key value
4. Created 'hidden & protected' items P1_ITEMCODE, P1_QTY
5. Set values of itemcode, qty in add_to_order link
6. Created a process to add values into collection:
for x in (select * from itemtab where itemcode = :P1_ITEMCODE)
loop
apex_collection.add_member(p_collection_name => 'ORDER',
p_c001 => x.ITEMCODE,
p_c002 => x.DESCRIPTION,
p_c003 => :P1_QTY
end loop;
7. Display value of itemcode, description, qty in report region
select c001, c002, c003
from apex_collections
where collection_name = 'ORDER'
Probem: The value of qty is not being stored in the collection and not appearing in the #7 report. itemcode and description values are fine.
Thanks,
DipDip,
I'm guessing here as I can't see your application, I think your missing the page process to collect the data from your QTY field.
I created a quick demo of what i think your trying to achieve on apex.oracle.com
http://apex.oracle.com/pls/apex/f?p=19923:2
I added this to the html expression on the report Field add to:
<input type="button" onclick="doSubmit(#RANDOM_ID#)" value="Add To" />
Then the page process to collect and set the page item:
DECLARE
l_qty number;
BEGIN
FOR i in 1..APEX_APPLICATION.G_F03.COUNT LOOP
l_qty := nvl(APEX_APPLICATION.G_F03(i),0);
IF l_qty > 0
THEN
:P2_QTY := l_qty;
:P2_RANDOM_ID := :REQUEST;
EXIT;
END IF;
END LOOP;
END;
Let me know if this helps
Mark
Don't forget to mark reply as helpful or correct as this may help others reading this thread in the future!
Edited by: cptbutcher on Mar 25, 2010 10:40 PM -
Hi,
I am trying to call a procedure from a SQL report query. Please let me know if this is correct.
SELECT gb.period_name,
cc.segment1 uec,cc.segment2 dept, cc.segment3 other,
cc.segment4 acct,cc.segment5 subacct, cc.segment6 activity,
cc.segment7 cec, cc.segment8 subelement,cc.segment9 geo,
cc.segment10 usind,cc.segment11 affiliate,cc.segment12 mpc,
DECODE ( NVL (gb.begin_balance_dr_beq, 0)
- NVL (gb.begin_balance_cr_beq, 0),
0, ( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
NULL, ( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
NVL (gb.begin_balance_dr_beq, 0)
- NVL (gb.begin_balance_cr_beq, 0)
) AS Begining_balance_functional,
DECODE ( NVL (gb.period_net_dr_beq, 0)
- NVL (gb.period_net_cr_beq, 0),
0, ( NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0)
NULL, ( NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0)
NVL (gb.period_net_dr_beq, 0)
- NVL (gb.period_net_cr_beq, 0)
) AS period_to_date_functional,
(DECODE ( NVL (gb.begin_balance_dr_beq, 0)
- NVL (gb.begin_balance_cr_beq, 0),
0, ( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
NULL, ( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
NVL (gb.begin_balance_dr_beq, 0)
- NVL (gb.begin_balance_cr_beq, 0)
+ (DECODE ( NVL (gb.period_net_dr_beq, 0)
- NVL (gb.period_net_cr_beq, 0),
0, ( NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0)
NULL, ( NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0)
NVL (gb.period_net_dr_beq, 0)
- NVL (gb.period_net_cr_beq, 0)
) AS ending_balance_functional,
NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0) AS begining_balance_entered,
NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0) AS period_to_date_entered,
( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
+ (NVL (gb.period_net_dr, 0) - NVL (gb.period_net_cr, 0)
) AS ending_balance_entered,
gb.currency_code,gb.period_year, gb.period_num,
apps.afl_gl_acct.get_value_description('ALCOA UEC',cc.segment1) UEC_Description, apps.afl_gl_acct.get_value_description('ALCOA Cost Center',cc.segment2) Cost_center_Description,
apps.afl_gl_acct.get_value_description('ALCOA Other',cc.segment3) Other_Description,
apps.afl_gl_acct.get_value_description('ALCOA Account',cc.segment4) Account_Description,
apps.afl_gl_acct.get_value_description('ALCOA SubAccount',cc.segment5) SubAccount_Description,
apps.afl_gl_acct.get_value_description('ALCOA Activity',cc.segment6) Activity_Description,
apps.afl_gl_acct.get_value_description('ALCOA CEC',cc.segment7) CEC_Description,
apps.afl_gl_acct.get_value_description('ALCOA SubElement',cc.segment8) SubElement_Description,
apps.afl_gl_acct.get_value_description('ALCOA GEO',cc.segment9) GEO_Description,
apps.afl_gl_acct.get_value_description('ALCOA US Ind',cc.segment10) US_Ind_Description,
apps.afl_gl_acct.get_value_description('ALCOA Affiliate',cc.segment11) Affil_Description,
afl_gl_acct.get_value_description('ALCOA MPC',cc.segment12) MPC_Description
FROM GL.GL_BALANCES GB, GL.GL_CODE_COMBINATIONS CC,
GL.GL_Budget_Versions GBV, GL.GL_SETS_OF_BOOKS GSB
WHERE GB.CODE_COMBINATION_ID = CC.CODE_COMBINATION_ID
-- And CC.SEGMENT1 = (se
And GB.BUDGET_VERSION_ID = GBV.BUDGET_VERSION_ID (+)
And GSB.SET_OF_BOOKS_ID = GB.SET_OF_BOOKS_ID
and decode(gb.TRANSLATED_FLAG,'Y','Translated','Entered') =:p_currency_type
AND cc.segment1 =:p_uec
AND GSB.NAME = :p_sob_name
AND gb.PERIOD_NAME= :p_period
AND cc.segment2= nvl(:p_dept,cc.segment2)
AND cc.segment3=nvl(:p_other,cc.segment3)
AND cc.segment4= nvl(:p_acct,cc.segment4)
AND cc.segment5= nvl(:p_subacct,cc.segment5)
AND cc.segment6 = nvl(:p_activity,cc.segment6)
AND cc.segment7 = nvl(:p_cec,cc.segment7)
and cc.segment8= nvl(:p_subelement,cc.segment8)
and cc.segment9= nvl(:p_geo,cc.segment9)
and cc.segment10=nvl(:p_usind,cc.segment10)
and cc.segment11=nvl(:p_affil,cc.segment11)
and cc.segment12=nvl(:p_mpc,cc.segment12)
AND gb.ACTUAL_FLAG = 'A'
AND gb.CURRENCY_CODE = :p_currency;
I am not completely sure of the syntax.
Regards,
JAPlease let me know if this is correct.Does it compile? Does it run? Does it return the correct result.
Please bear in mind we do not have access to your data models so we cannot run it. Nor do we know your business requirements so we cannot assess whether it implements them correctly. And it is way too big a hunk o' code for us to go through it manually.
As a rule of thumb it is better to build a small query and get that working correctly before adding tables to it rather than building an incomprehensibly large monolith.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/ -
Urgent help - Updateable column in SQL Report
Hi,
I have a SQL report. The collection is being used to manipulate values.
I have a updatable text item QTY. When someone enter the value of 'QTY' and press
the link 'Add to order', it should store value of QTY to the collection and display same
in another region (SQL Report).
Demo Application: http://apex.oracle.com/pls/apex/f?p=26306:11:2820041747530998
Workspace :ORAAPPS07
User ID :[email protected]
Password :gonena
Key the 'QTY' value in the Page 12 and click on 'Add to Order'.
Problem: The value of QTY is not being populated.
Thanks in Advance.
DipHi,
I have a SQL report. The collection is being used to manipulate values.
I have a updatable text item QTY. When someone enter the value of 'QTY' and press
the link 'Add to order', it should store value of QTY to the collection and display same
in another region (SQL Report).
Demo Application: http://apex.oracle.com/pls/apex/f?p=26306:11:2820041747530998
Workspace :ORAAPPS07
User ID :[email protected]
Password :gonena
Key the 'QTY' value in the Page 12 and click on 'Add to Order'.
Problem: The value of QTY is not being populated.
Thanks in Advance.
Dip -
I created a SQL Report,the report asked me if i would like to add a search feature, i said yes,
the search function queryies ID numbers 1-50,
when i run the application and ask for id number 4; the query responds to id # 4,14, 34,and 44.
If i'm asking for id # 4 shouldn't i get just 4,
why is it giving me these other numbers???
Is there a code that just shows the number i'm asking for???
thanks in advancejo,
The SQL Report appears to only you to Enable Search on non-key columns of the table and assumes that you are going to search for any porition of the string that you provide in the search item of the page.
You could try altering your SQL and replace the instr line with something like this:
WHERE ( :px_report_search IS NULL
OR UPPER (your_column_name) = UPPER (:px_report_search)
The upper may not be necessary if you are not searching a character string.
Jeff -
Pop up text on clicking link on a sql report
Hi
I'm using apex 3.2
I've a sql report like below
taskId(edit) Task_details Notes owner .....
What I want to do is if I click on taskId which is edit link ,pop up text box should open where I can add notes to that row.
How can I achive this?
Thanks in advanceHi,
Take a look at the following blog posts and see if they can help you get what you are looking for (there are sample applications in them showing the functionality):
http://monkeyonoracle.blogspot.com/2010/07/modal-pop-up-with-dynamic-actions.html
http://www.danielmcghan.us/2008/12/popup-in-report.html
Hope that's useful for you.
Regards,
Sergio -
Add Image column in classic sql report to open a pop page
I have sql report I want to add a new column which will have image to click, Once user clicks the image a popup page should open.
Hi Vikram,
Sorry to bother you, I am very new to apex. Here is my sql query for sql report. Can you please help me.
<xmp>select
case
when ISUPPORT_NUMBER is null or ISUPPORT_NUMBER = 'N/A' then '<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Enter SR Number</p></a>'
else '<span style="background-color:red;font-weight:bold">'
|| ISUPPORT_NUMBER
|| '</span>'
end ISUPPORT_NUMBER,
case
when ISUPPORT_NUMBER is not null and ISUPPORT_NUMBER != 'N/A' then '<a href="javascript:myFunc4(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#FF0000;font-size:14px;">'|| MACHINE_NAME ||'</p></a>'
else '<a href="javascript:myFunc4(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:14px;">'|| MACHINE_NAME ||'</p></a>'
end MACHINE_NAME,
FUNCTION,
VERSION,
VENDOR_CLUSTER,
case when used_by is null then '<a href="javascript:myFunc2(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Avaliable</p></a>'
when upper(used_by)=v('APP_USER') then '<a href="javascript:myFunc5(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:blue;font-size:12px;">' || used_by || '</p></a>'
else used_by
end used_by,
case
when loaned_to is null and ( upper(used_by)=v('APP_USER') or used_by is null) then '<a href="javascript:myFunc(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Avaliable</p></a>'
when upper(used_by)=v('APP_USER') then '<a href="javascript:myFunc6(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:blue;font-size:12px;">' || loaned_to || '</p></a>'
else loaned_to
end loaned_to,
LOANED_TO_EXPIRY_DATE,
LOAN_INFO,
decode(SCAN_NAME,null,'<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">More Details</p></a>','<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">More Details</p></a>') SCAN_NAME,
USERNAME,
VNC_PASSWORD,
LAST_UPDATED_BY , </xmp>
<b>Here I want to add a image column where I can give a link like above to open popup </b>
from install_dbqa_machines
Edited by: Sivaramaraju on Jun 19, 2012 9:06 AM
Edited by: Sivaramaraju on Jun 19, 2012 9:07 AM
Edited by: Sivaramaraju on Jun 19, 2012 9:08 AM -
Date syntax for MySql query in SQL Reporting Services
I am currently trying to link a mysql Stored Procedure to a Microsoft SQL Reporting Server. It is coming up with a Syntax error. I believe this is down to the
Date_from and Date_to Parameters. The query is below any help would be appreciated
DELIMITER $$
USE `mydb`$$
DROP PROCEDURE IF EXISTS `DTI`$$
CREATE DEFINER=`linkeduser`@`%` PROCEDURE `DTI`(IN date_from DATETIME,
IN date_to DATETIME)
BEGIN
SELECT title,gender,firstname,lastname,address1,town,postcode,dob,IF(co.start_date = '00-00-0000', '', CAST(DATE(co.start_date) AS DATE)) AS 'StartDate'
FROM cf_user AS us
JOIN ca_compliance AS co ON co.user_id = us.user_id
WHERE co.start_date BETWEEN date_from AND date_to;
END$$
DELIMITER ;Hello,
The dataset query runs on the external data source.
In your case, you create a report by retrieve data from MySQL database with a stored procedure. The stored procedure will run on MySQL Server and return the result in the Report designer or Report Builder. To solved this issue, please execute the stored
procedure on the MySQL database and check the syntax error.
Regards,
Fanny Liu
Fanny Liu
TechNet Community Support -
Upgrade 2010 to 2013 with SQL Reporting Services
I'm getting ready to upgrade to 2013.
When I run the Test-SPContentDatabase I get:
Category : MissingWebPart
Error : True
UpgradeBlocking : False
Message : WebPart class [ab6d9dad-e23c-ce4f-ff98-f6575a1ccf4c] (class [
Microsoft.ReportingServices.SharePoint.UI.WebParts.ReportView
erWebPart] from assembly
[Microsoft.ReportingServices.SharePoint.UI.WebParts,
Version=10.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91]) is referenced [24] times
in the database [is-sharepoint], but is not installed on the
current farm. Please install any feature/solution which
contains this web part.
Remedy : One or more web parts are referenced in the database
[is-sharepoint], but are not installed on the current farm.
Please install any feature or solution which contains these
web parts.
Locations :
Category : MissingAssembly
Error : True
UpgradeBlocking : False
Message : Assembly
[Microsoft.ReportingServices.SharePoint.UI.ServerPages,
Version=10.50.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91] is referenced in the
database [is-sharepoint], but is not installed on the
current farm. Please install any feature/solution which
contains this assembly.
Remedy : One or more assemblies are referenced in the database
[is-sharepoint], but are not installed on the current farm.
Please install any feature or solution which contains these
assemblies.
Locations :
Category : Configuration
Error : False
UpgradeBlocking : False
Message : The [is.photomask.com] web application is configured with
claims authentication mode however the content database you
are trying to attach is intended to be used against a
windows classic authentication mode.
Remedy : There is an inconsistency between the authentication mode of
target web application and the source web application.
Ensure that the authentication mode setting in upgraded web
application is the same as what you had in previous
SharePoint 2010 web application. Refer to the link
"http://go.microsoft.com/fwlink/?LinkId=236865" for more
information.
Locations :
The first two have to do with reporting services. I'm trying to workout how to go about getting these errors to go away. I don't want to remove SQL reporting or migrate a broken site and fix it later. FYI it does migrate but reporting services
is of course broken.
So what I was wanting to do was to upgrade SQL Reporting Services for SharePoint 2010 from 2008 SQL to 2014 SQL first. This would be in the hopes that it would make the migration to SharePoint 2013 work as the assemblies would change to the proper
version.
Can anyone elaborate on my upgrade path?
I'm still looking up the "Claims Based" authentication thing. I've found an article on how to migrate it so not a big deal. I do wonder however if this is tied to the issue I saw with default.aspx and home.aspx being denied to all users
after I did migrate a content db.
David JenkinsHi David,
The following sections describe the basic steps needed to upgrade or migrate from 2008 versions of Reporting Services SharePoint mode to 2014 version.
SQL Server 2008 R2 to SQL Server 2014
Starting environment: SQL Server 2008 R2, SharePoint 2010.
Ending environment: SQL Server 2014, SharePoint 2010.
In-place upgrade is supported and there is no down time for your SharePoint environment.
Install the SQL Server 2014 version of the Reporting Services add-in for SharePoint on each web front-end in the farm. You can install the add-in by using the SQL Server 2014 installation wizard or by downloading the add-in.
Run SQL Server 2014 installation to upgrade SharePoint mode for each “report server”. The SQL Server installation wizard will install the Reporting Services Service and create a new Service application.
If you also want the ending environment to run SharePoint 2013, you need to complete a database-attach upgrade of the SharePoint 2010 to SharePoint 2013.
For more scenarios information, please refer to:
http://msdn.microsoft.com/en-us/library/ms143747.aspx#bkmk_sharePoint_scenarios
Per the supported combinations of SharePoint and Reported Services Components, I’d recommend you firstly upgrade Reporting Services to 2014, then upgrade SharePoint to 2013.
For more information:
http://msdn.microsoft.com/en-us/library/gg492257.aspx
The link below is the reference for migrating a Reporting Services:
http://msdn.microsoft.com/en-us/library/hh759331.aspx
Regards,
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected] .
Rebecca Tu
TechNet Community Support -
SQL Report not showing data - available in SQL Workshop and SQL Developer
I am having an issue with developing a SQL Report in APEX 3.2.1. I run the code in both SQL developer and SQL Workshop and I get data pulled back (both against my development environment). When I run the same code in a SQL Report region, it returns no data available. Does anyone have any idea what would be causing this? Other regions on the page accessing different tables in the same schema return data without issue. Any help would be appreciated.
Thanks
FreddieCould you explain the last comment a bit more. Here is a bit more info just in case I touch on the info with it. The db schema is BPAMGR, the Workspace is BPAMGR. We use the same schema for all of our reporting. All of our tables are in the same schema. We don't use any tables outside of this schema. Our APEX workspace has been associated to only this schema. The tables are able to be queried by SQL Workshop in the same APEX instance that the report application is under.
Freddie -
Creating tabs for a single SQL report type region
I would like to find a way to use tabs in a single SQL report type region. The problem I have is that there are too many columns to be displayed so the report looks very cluttered. I would like to find a way to assign say columns 1 - 5 to tab 1, 6-10 to tab 2 etc so the user can find the columns they need by simply clicking on the various tabs without having to execute the query again.
I have looked at JQuery tabs but that seems to only be applicable to more or less unrelated regions. I tried to create different regions using the same query with different columns and that kind of works, but the regions don't stay in sync if say the user change the order for column 2 in tab 1, when they click on tab 2 everything displays in a different order.
Another wrinkle is that this is an updatable report so some of the columns are updatable.
I also looked at the hide / display column solution which is described in a few threads and that may also sort of work, but it is also not quite what I am looking for.
Any help is greatly appreciatedDoes anybody know if this can be accomplished using APEX? What I am really looking for is very similar to an old fashioned client / server screen developed using say Oracle Forms. Consider an order line screen where say columns line number, SKU and SKU description is to the left of the tabs so these columns are visible no matter which tab is active. Then the first tab has say pricing information including UOM, quantity, list price, unit selling price, price list. The next tab has say customer information including customer number, name, bill to and ship to addresses. the next tab has say shipping information with say the warehouse, shipping instructions and shipping method.
-
Conditional display in a SQL-Report/Report Region
Hi,
here I have an example for "Conditional display in a SQL-Report/Report Region". I figured it out in Firefox 3.6.2 using Firebug as development tool on Apex 3.2.1.00.12.
First you have to put the following javascript code in the Page HTML-Header:
<script type="text/javascript">
<!--
// SOURCE
// W:\oracle\PRJ DWLS\javascript.07.js
// Beispiel Funktion zur bedingten Formatierung einer Tabellenzelle.
// Help (Substitution Strings):
// http://htmldb.oracle.com/pls/otn/wwv_flow_help.show_help?p_lang=de&p_session=2412201185523196&p_flow_id=4003&p_step_id=420,4003
// HTML Expression:
// <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#DFT_COND1#
function ex_conditional_td
( p_id
, p_rownum
, p_cellnum
var l_td;
l_td = vd_getColumn(p_id, p_rownum, p_cellnum);
// hier die Bedingung definieren
if (true) {
l_td.style.color = '#808080';
} // -- eof ex_conditional_td -- //
// Beispiel Funktion zum Abstellen der onMouse Funktionalität der Tabellenzeile
// HTML Expression:
// <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#DFT_ID#"
function ex_conditional_tr
( p_id
, p_rownum
var l_tr; // TABLE.TR
var l_td; // TABLE.TR.TD
if (true) {
l_tr = vd_getRow(p_id, p_rownum);
l_tr.onmouseover = null;
l_tr.onmouseout = null;
for (var i=0; i<l_tr.cells.length; i++) {
l_td = l_tr.cells;
l_td.style.backgroundColor = '#DDDDDD';
} // -- eof ex_conditional_tr() -- //
var g_DEBUG = false;
var g_TBODY = null;
// Liefert das Body-Element der Tabelle mit der ID <p_id>.
// Parameter
// p_id - die Id der HTML-Tabelle
// Return
// das Body-Element oder NULL, wenn die Zeile nicht gefunden wurde
function vd_getBody
( p_id
if (g_TBODY == null) {
var l_table = null;
l_table = document.getElementById( p_id );
if (l_table == null) {
l_table = document.getElementByName( p_id );
if (l_table != null) {
if (vd_debug()) {
alert("Tabelle gefunden, " + l_table.nodeName);
g_TBODY = vd_search( l_table, 'TD', 't10data', 'TBODY');
return g_TBODY;
} // -- eof vd_getBody() -- //
// Liefert die Zeile <p_rownum> der HTML-Tabelle mit der Id <p_id>.
// Parameter
// p_id - die Id der HTML-Tabelle
// p_rownum - die Zeilennummer
// Return
// die Zeile oder NULL, wenn die Zeile nicht gefunden wurde
function vd_getRow
( p_id
, p_rownum
var l_body = vd_getBody(p_id);
if ( l_body != null
&& l_body.nodeName == 'TBODY'
&& l_body.children[p_rownum].nodeName == 'TR') {
return l_body.children[p_rownum];
else {
return null;
} // -- eof vd_getRow() -- //
// Liefert die Spalte <p_column> der Zeile <p_rownum> der HTML-Tabelle mit der
// Id <p_id>.
// Parameter
// p_id - die Id der HTML-Tabelle
// p_rownum - die Zeilennummer
// p_column - der Index der Spalte / Zelle
// Return
// die Zelle oder NULL, wenn die Zelle nicht gefunden wurde
function vd_getColumn
( p_id
, p_rownum
, p_column
var l_tr = vd_getRow(p_id, p_rownum);
if ( l_tr != null
&& l_tr.nodeName == 'TR'
&& l_tr.children.length >= p_column
&& l_tr.children[p_column].nodeName == 'TD') {
return l_tr.children[p_column];
else {
return null;
} // -- eof vd_getColumn() -- //
// Rekursives Suchen nach einem Node.
// Zweck: Das bedingte Formatieren einer Tabellenzelle in einem Apex Standard
// SQL-Report.
// Diese Funktion durchsucht rekursiv, ab einem Ausgangsknoten <p_node>, alle
// darunter befindlichen Elemente, ob in dem Element <p_seachIn> sich die
// Klasse <p_class> befindet.
// Bei Standard-Reports ist die Reportzelle (TD) mit der Klasse
// "t10data" formatiert.
// Zunächst muss dazu die Tabellenzelle (TD) selbst, die übergeordnete
// Tabellenzeile (TR), der Tabellenbody (TBODY) oder die Tabelle (TABLE)
// selbst ermittelt werden.
// Der Beispielaufruf:
// var l_body;
// var l_node = document.getElementById( 'R112233' );
// l_body = search( l_node, 'TD', 't10data', 'TBODY');
// durchsucht also das mit der Id "R112233" versehene Element [der Report, für
// den in Apex eine statischen ID vergeben werden musste] rekursiv, bis er
// die [erste] Tabellenzelle "TD" findet, die als Klasse "t10data"
// definiert hat. Für diese ermittelt er dann das übergeordnete TBODY-Element.
// Parameter
// p_node - das Ausgangselement
// p_searchIn - der Knotenname, der durchsucht werden soll
// [node.nodeName == p_searchIn]
// p_class - der Name der CSS Klasse
// [node.classList[<index>] == p_class
// p_parentName - der Name [node.parentNode.nodeName == p_parentName]
// des Elements, das zurückgeliefert werden soll. Wird als
// p_parentName der Suchname p_searchIn angegeben, wird
// das Element selbst zurückgegeben.
// Return
// das per p_parentName gesuchte Element (TD, TR, TBODY, TABLE)
function vd_search
( p_node
, p_searchIn
, p_class
, p_parentName
var LN = "vd_search";
var l_element = null;
// DEBUG
if (vd_debug()) {
alert(LN + ":" + "Untersuche " + p_node.nodeName + ", id=" + p_node.id);
// 1) der aktuelle Knoten ist der, der durchsucht werden soll
if (p_node.nodeName == p_searchIn) {
if (p_node.classList.length > 0) {
for(var c=0; c<p_node.classList.length; c++) {
if (p_node.classList[c] == p_class) {
// Parent Node dynmisch suchen
l_node = p_node;
if (l_node.nodeName == p_parentName) {
return l_node;
while(l_node != null && l_node.parentNode != null) {
if (l_node.parentNode.nodeName == p_parentName) {
return l_node.parentNode;
else {
l_node = l_node.parentNode;
// 2) wenn nicht 1) oder nicht in 1) gefunden, dann in den Kindelementen
// weitersuchen
if (p_node.children.length > 0) {
var i = 0;
while (i<p_node.children.length && l_element==null) {
l_element = vd_search( p_node.children[i], p_searchIn, p_class, p_parentName);
i++;
return l_element;
} // -- eof vd_search() -- //
// Gibt an, ob Debug ein- (true) oder ausgeschaltet (false) ist.
// Return
// true - debug ist eingeschaltet
// false - debug ist ausgeschaltet
function vd_debug()
return g_DEBUG;
-->
</script>
Maybe you have to modify the "vd_getBody" function. I'm searching the table cell with having the class "t10data". When you use another theme, there's maybe another class used.
Second is, that you set an static id for your report region. I prefer this structure:
R<app-id><page-id><seq> (Raaaaappppsss) e.g. R094260001010.
First example is to turn off the onMouse-Effect. Maybe on the first or last column definition you put this code in the "HTML-Expression" area:
<script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#ID#This will call the example function ex_conditional_tr with the parameter
a) the region id
b) the rownum (as oracle always starts with 1 this is the first data row [rownum=0 is the table header row])
Second example is the conditional formatting of a table cell. Put this in the HML-Expression area:
<script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#ENAME#This will call the example function ex_conditional_tr with the parameter
a) the region id
b) the rownum
c) the cellnum (here we have to subtract 1 to get the "real" cell index)
The "ex_conditional" functions are just a representation of how to get the row or cell node.
Hope this help a bit.
TomI would use a CASE statement in the select....
each CASE would be an img src tag for a different button if the button is an image.
does that make sense? I can include an example if you would like... -
Items is a region displayed after a sql report region!
Hello everybody!
I have 3 regions :
1/ HTML text region with some items : sequence 10, column1
2/ SQL report region : sequence 20, column1
3/ HTML text region with some items : sequence 30, column1
I have many problems and errors when submitting the page and saving data into tables, I think that htmldb is not getting the correct values corresponding to the correct items.
If I change the column diplay of the sql report region to "2", or if I change the sequence of the SQL report region to 40, all is ok!!!
(I am using wwv_flow.g_f10(i) to retreive data from the report).
Any idea ?Hello Raju,
Ok, My example is more complexe, but I have succed to reproduce the error in a sample example in my oracle htmldb workspace,
My access info have bee sect to : [email protected]
You will find the example in application 21275_TEST page 2.
I have 3 regions, the second is a report sql region in witch I have a popkeyfrom query item.
My submit button, update a table with a text field (item P2_IT, region1) and a date(item P2_MONTH ,region3).
You will see that when submitting, you will get an error : not a valid month....
I have not understand what is being done at save, but I am sure that the value of P2_MONTH is not correctly setted when updating the table!
Just, changing the sequence of the report region from 10 to 30 resolve the problem,
but I must have this region between the two others!!!
Thanks for the help!
Maybe you are looking for
-
Unable to finish off video.
I've just finished making a video and its unable to finalize, or export or publish etc. and it says that the project is unable to load because of an error or something? ("The movie could not be exported because an error occurred. (-108)")
-
MSI K7N2 Delta-ILSR (MS-6570) BSOD problems grrr
I recently purchased this board and although it is an awesome product, I'm having a problem with BSOD's when I play a game for a certain period of time Specs: MSI K7N2 Delta-ILSR (7.6 BIOS) AMD Athlon XP 2800+ Barton 512MB (2x256MB) Samsung PC-2700
-
I just updated my itunes after receiving an alert through my windows 8. My laptop automatically restarts after an update to secure the changes in setting and applications. But a minute after opening itunes and its loaded, a windows alert pops up stat
-
MIRO Invoice Goes to Payment Block
Hi Posting the MIRO document by default goes to Payment Block. No price difference or error/ Checked Vendor master/Price difference percentage settings. How to make remove the Default payment block settings ? Other than above any other settings? Appr
-
AME suddenly started output corrupted AvidDNxHD
So I was working away. ploughing through upwards of a hundred renders from separate AE-projects yesterday. All of which rendered through AME and used the 440 Avid DNxHD preset. No problem. Exported from AE CC to AME CC and then imported to the Premie