AVG Calculation in sql Report
Fyi,
I have Pl/sql returning sql query in oracle apex report. i use sum and avg in report using union.
In Report ordering enable in all fields.
when i use ordering in this report the the sum and avg row comes first.
Problem is i dont want to ordering on that Sum and Avg row. it must at last of the report.
kindly help me. it's urgent.
Thanks
Harry wrote:
Fyi,
I have Pl/sql returning sql query in oracle apex report. i use sum and avg in report using union.
In Report ordering enable in all fields.
when i use ordering in this report the the sum and avg row comes first.
Problem is i dont want to ordering on that Sum and Avg row. it must at last of the report.See +{thread:id=2336820}+
kindly help me. it's urgent.It's no more or less urgent than any other question on these forums.
Similar Messages
-
Exclude NULL values from SUM and AVG calculation
Hi,
I have column in report that contains some NULL values. When i perform SUM,MAX,MIN or AVG calculation on this column the NULL values are treated as '0' and included in calculation. Is there any way to exclude them while calculating aggregate functions?
As a result MIN calculation on values (NULL,0.7,0.5,0.9) gives me output as 0 when it should have been 0.5
Can someone please help ?
Thanks and Regards,
Oliver D'melloHi Oliver,
According to your description, you want to ignore the NULL values when you perform aggregation functions.
In this scenario, aggregate functions always ignore the NULL values, because their operation objects are non-null values. So I would like to know if you have assigned “0” for NULL values. I would appreciate it if you could provide some screenshots about
your expressions or reports.
Besides, we have tested in our environment using Min() function. The expression returns the minimum value among the non-null numeric values. Please refer to the screenshots below:
Reference:
Min Function (Report Builder and SSRS)
Aggregate Functions Reference (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu -
Hi All,
I built a SQL report showing some counts in it.
-- I have 2 Date picker items(:P10_FROM_DATE and :P10_TO_DATE) on this page for filtering between the range of dates.
-- My report has two columns 1st column shows the COUNT between the Date range selected in the item. And the 2nd column shows YTD(beginning of the year to :P10_TO_DATE)
My SQL is working fine in tools like SQL Developer and TOAD but its showing Random counts in the report.
For example, i selected :P10_FROM_DATE = '01-JAN-2012' and :P10_TO_DATE = '27-JUL-2012'. This should show the same COUNT in both 1st and 2nd columns.
COUNTS | 1000 | 1000
But my report is showing wrong data in the YTD column.
COUNTS | 1000 | 2167
Is this a bug? Because , the COUNTs were accurate when I run in Toad or SQL Dev.
Version 10g DB, Apex 4.1
P.S. I already have 6 SQL reports in this page. And this error is not occurring in any of the other reports.
Thank you All in Advance,
DanielHi VC,
My SQL looks something like below.
select t1.type,
t1.monthly_total,t2.YTD
from(select 'SAMPLE' type,
count() total*
from(select - - - - - - -
from emp emp
where
and to_date(emp.hire_dt,'DD-MON-YY')>= to_date(:P10_from_date,'DD-MON-YY')
and to_date(emp.hire_dt,'DD-MON-YY')<= to_date(:P10_to_date,'DD-MON-YY')
*)t1,*
*(select 'SAMPLE' type,*
count() YTD*
from(select - - - - - - - -
from emp emp
where - - - - - - -
and to_date(emp.hire_dt,'DD-MON-YY')>= '01-Jan-'||to_char(to_date(:P10_to_date,'DD-MON-YY'),'YY')
and to_date(emp.hire_dt,'DD-MON-YY')<=to_date(:P10_to_date,'DD-MON-YY')
*) t2*
where t1.type=t2.type
I also deleted this region and created again but still this error exists. For my other reports in this page also, I used the same conditions for calculating YTD.
Thanks,
Daniel -
Packet loss higher than 100% in SQL Reporting
One of our customers is having network problems and packet loss in their network - according to Lync. The network guys claim these values are unrealistic and there've been no dropped packets on their WAN network.
On the other side, I'm looking at a Call Details Report from Lync SQL Reporting and see this in the gateway leg information:
Audio Stream (Caller -> Callee)
Codec:
PCMU
Sample rate:
8000
Packet utilization:
285
Avg. packet loss rate:
51.20%
Max. packet loss rate:
79.52%
Avg. jitter:
0 ms
Max. jitter:
0 ms
Burst duration:
5980 ms
Burst gap duration:
1890 ms
Burst density:
100.00%
Burst gap density:
0.00%
Avg. concealed samples ratio:
60.00%
Avg. stretched samples ratio:
0.00%
Avg. compressed samples ratio:
0.00%
Avg. network MOS:
1.50
Min. network MOS:
1.50
Avg. network MOS degradation:
2.21
Max. network MOS degradation:
2.21
NMOS degradation (jitter):
0.00%
NMOS degradation (packet loss):
100.00%
Audio Stream (Callee -> Caller)
Codec:
PCMU
Sample rate:
8000
Audio FEC:
False
Bandwidth estimates:
Packet utilization:
146
Avg. packet loss rate:
900.00%
Max. packet loss rate:
900.00%
Avg. jitter:
1540 ms
Max. jitter:
4406 ms
Avg. round trip:
178 ms
Max. round trip:
179 ms
From this I feel there are things to troubleshoot. :-) but how come that Lync reports a 900% packet loss?
I thought that a 100% packet loss was everything... can someone tell me what exactly are these 100+ percentages?
Thanks in advance.latest patch level :) are you not seeing these values in your Server Performance reports?
The other thing that bugs me is when you have 1 call for 1 second with "900% loss", that would average down to get red values in the summary columns for the other 100 calls as well, as the calls are not counted for seconds, but just piece by piece.
So 8 perfect calls to this one above would average "100% packet loss per call" in the summary, which is just unusable... -
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 -
Dublicate Value In HTML PL/SQL Report
hi,
i have to enter item name and item Price iinto transaction_details by using a form and labour Work, labour amount into LAB_WORK_DTL table using a form .
Now Problem is when i fetch these value in to PL/SQL Report then it's shows me double value like My Total Amount is 100 Then It show Me 200 and if there is two Values eg A , B then in report it's shows me A ,B , A, B, these two Value Shows Me in four Rows .How can i remove Dublicate Values .Why it does show me that double value . My code is below
How can i remove this problem .
declare
SA NUMBER;
tot number;
TH NUMBER;
va number;
am number;
lst number;
tst number;
st NUMBER;
cursor c2 is select
T.VAT,
SUM(T.AMOUNT) AMOUNT,
SUM(T.VAT_AMOUNT) VAT_AMOUNT
from transaction_details T FULL JOIN LAB_WORK_DTL L
ON T.BILL_NO = L.BILL_NO
WHERE T.BILL_NO = :P27_BILL_NO
GROUP BY T.bill_no,t.vat, T.bill_date, T.vehicle_no, T.PARTY_NAME;
BEGIN
FOR x IN(SELECT t.item_name, t.qty,t.rate, t.bill_no
FROM transaction_details t,LAB_WORK_DTL l where t.bill_no=l.bill_no(+) and t.bill_no=:p27_bill_no
LOOP
HTP.P('<tr>
<td width="2%"> </td>
<td width="55%" align="left"> '|| HTF.escape_sc (x.item_name)||'</td>
<td width="15%" ALIGN="right">'|| HTF.escape_sc (x.qty)||'</td>
<td width="15%" ALIGN="right">'|| HTF.escape_sc (x.rate)||'</td>
<td width="25%" ALIGN="right">'|| HTF.escape_sc (x.qty)* HTF.escape_sc (x.rate)||'
</td>
</tr>');
END LOOP;
tot:=0;
bc:=0;
KA:=0;
open c2;
loop
FETCH c2 INTO va,am,vat_am;
exit when c2%notfound;
tot:=nvl(tot+am,0);
bc:=nvl(bc+vat_am,0);
end loop;
close c2;
HTP.P('<tr>
<td width="38"> </td>
<td width="29"> </td>
<td width="447"> </td>
<td> </td>
<td width="173">
<p align="Right">-------------------</td>
</tr>
<tr>
<td width="38"> </td>
<td width="447"> TOTAL</td>
<td> </td>
<td width="95"></td>
<td width="172">
<p align="right">'
|| nvl(HTF.escape_sc (tot),0)
||'</td>
</tr>');
</table></body>
</html>');
END;
Thanks
Manoj Kaushik
Edited by: Manoj Kaushik on Apr 8, 2010 11:01 PMhi,
this is my Complete Code But I facing Dublicate Value Error .
In that Code In Total Amount Of All Item Price Show me Jus Double.
How Can I remove it.
declare
a number;
bd date;
b varchar2(20);
c varchar2(50);
d varchar2(50);
e varchar2(50);
f varchar2(50);
g varchar2(50);
h varchar2(4000);
la NUMBER;
p NUMBER;
SA NUMBER;
K NUMBER;
FA NUMBER;
HA NUMBER;
KA NUMBER;
KH NUMBER;
MA NUMBER;
cnt NUMBER;
tot number;
l number;
TH NUMBER;
FS NUMBER;
va number;
am number;
vat_am number;
bc NUMBER;
lst number;
tst number;
st NUMBER;
c_tra number;
c_lab number;
cursor c1 is select T.bill_no,T.bill_date,T.vehicle_no,T.PARTY_NAME
from transaction_details T FULL JOIN LAB_WORK_DTL L
ON T.BILL_NO = L.BILL_NO
WHERE T.BILL_NO = :P27_BILL_NO
GROUP BY T.bill_no, T.bill_date, T.vehicle_no, T.PARTY_NAME;
cursor c2 is select
T.VAT,
SUM(T.AMOUNT) AMOUNT,
SUM(T.VAT_AMOUNT) VAT_AMOUNT
from transaction_details T FULL JOIN LAB_WORK_DTL L
ON T.BILL_NO = L.BILL_NO
WHERE T.BILL_NO = :P27_BILL_NO
GROUP BY T.bill_no,t.vat, T.bill_date, T.vehicle_no, T.PARTY_NAME;
cursor c3 is select L.service_tax,SUM(L.LABOUR_AMT) LABOUR_AMT,
SUM(L.SERVICE_TAX_AMT) SERVICE_TAX_AMT
from transaction_details T FULL JOIN LAB_WORK_DTL L
ON T.BILL_NO = L.BILL_NO
WHERE T.BILL_NO = :P27_BILL_NO
GROUP BY T.bill_no,L.service_tax, T.bill_date, T.vehicle_no, T.PARTY_NAME;
cursor c4 is select
T.VAT,
SUM(T.AMOUNT) AMOUNT,
SUM(T.VAT_AMOUNT) VAT_AMOUNT
from transaction_details T FULL JOIN LAB_WORK_DTL L
ON T.BILL_NO = L.BILL_NO
WHERE T.BILL_NO = :P27_BILL_NO
GROUP BY T.bill_no,t.vat, T.bill_date, T.vehicle_no, T.PARTY_NAME;
cursor c5 is select L.service_tax,SUM(L.LABOUR_AMT) LABOUR_AMT,
SUM(L.SERVICE_TAX_AMT) SERVICE_TAX_AMT
from transaction_details T FULL JOIN LAB_WORK_DTL L
ON T.BILL_NO = L.BILL_NO
WHERE T.BILL_NO = :P27_BILL_NO
GROUP BY T.bill_no,L.service_tax, T.bill_date, T.vehicle_no, T.PARTY_NAME;
BEGIN
select chasis_no,ENGINE_NO,MAKE,MILEAGE into c,d,e,f from VEHICLE_DETAILS where vehicle_no =:P27_VEHICLE_NO;
select ADDRESS into h from PARTY_DETAILS where PARTY_NAME =:p27_PARTY_NAME;
open c1;
FETCH c1 INTO a,bd,b,g;
htp.p('<html>
<body leftmargin="0" rightmargin="0">
<table border="1" width="100%" bordercolorlight="#003366" cellspacing="0" bordercolordark="#003366" id="table1">
<tr>
<td colspan="2">
<table border="1" width="100%" cellspacing="0" cellpadding="0" id="table3">
<tr>
<td width="50"> </td>
<td width="21"> </td>
<td> </td>
</tr>
<tr>
<td width="50"><b>
</b></td>
<td width="21"><b></b></td>
<td align ="left">
<font size="4" face="Arial Black">'||HTF.escape_sc(g)||'</font></td>
</tr>
<tr>
<td width="50"> </td>
<td width="21"> </td>
<td> </td>
</tr>
<tr>
<td width="50"><b>
</b></td>
<td width="60"><b></b></td>
<td rowspan="4">
<font size="4" face="Arial Black">'||HTF.escape_sc(h)||'</font></td>
</tr>
<tr>
<td width="50"> </td>
<td width="21"> </td>
</tr>
<tr>
<td width="50"> </td>
<td width="21"> </td>
</tr>
<tr>
<td width="50"> </td>
<td width="21"> </td>
</tr>
</table>
</td>
<td width="44%" colspan="3">
<table border="1" width="100%" cellspacing="0" cellpadding="0" id="table4">
<tr>
<td width="53"> </td>
<td width="104"><b></b></td>
<td width="10"></td>
<td ><font size="5" face="Arial Black"> ' || HTF.escape_sc(a) ||'</font> </td>
</tr>
<tr>
<td width="53"> </td>
<td width="104"><b></b></td>
<td width="10"></td>
<td ><font size="5" face="Arial Black"> ' || HTF.escape_sc(bd) ||'</font></td>
</tr>
<tr>
<td width="53"> </td>
<td width="104"><b>
</b></td>
<td width="10"></td>
<td ><font size="5" face="Arial Black"> '|| HTF.escape_sc(b) ||'</font> </td>
</tr>');
CLOSE c1;
htp.p('<tr>
<td width="53"> </td>
<td width="104"><b>
</b></td>
<td width="10"></td>
<td ><font size="5" face="Arial Black"> ' || HTF.escape_sc (c) ||'</font></td>
</tr>
<tr>
<td width="53"> </td>
<td width="104"><b>
</b></td>
<td width="10"><b></b></td>
<td ><font size="5" face="Arial Black"> ' || HTF.escape_sc (d) ||'</font></td>
</tr>
<tr>
<td width="53"> </td>
<td width="104"><b>
</b></td>
<td width="10"><b></b></td>
<td ><font size="5" face="Arial Black"> ' || HTF.escape_sc (e) ||'</font></td>
</tr>
<tr>
<td width="53"> </td>
<td width="104"><b>
</b></td>
<td width="10"><b></b></td>
<td ><font size="5" face="Arial Black"> ' || HTF.escape_sc (f) ||'</font></td>
</tr>
</TABLE>
</td>
</tr>
<tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr>
<tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr>
<tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr>
<tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr>
select count(*) into c_tra from transaction_details where bill_no=:p27_bill_no;
select count(*) into c_lab from lab_work_dtl where bill_no=:p27_bill_no;
if c_tra>0 and c_lab=NULL then
FOR x IN(SELECT distinct t.item_name, t.qty,t.rate, t.bill_no
FROM transaction_details t,LAB_WORK_DTL l where t.bill_no=l.bill_no(+) and t.bill_no=:p27_bill_no
LOOP
HTP.P('<tr>
<td width="2%"> </td>
<td width="55%" align="left"> '|| HTF.escape_sc (x.item_name)||'</td>
<td width="15%" ALIGN="right">'|| HTF.escape_sc (x.qty)||'</td>
<td width="15%" ALIGN="right">'|| HTF.escape_sc (x.rate)||'</td>
<td width="25%" ALIGN="right">'|| HTF.escape_sc (x.qty)* HTF.escape_sc (x.rate)||'
</td>
</tr>');
END LOOP;
tot:=0;
bc:=0;
KA:=0;
open c2;
loop
FETCH c2 INTO va,am,vat_am;
exit when c2%notfound;
tot:=nvl(tot+am,0);
bc:=nvl(bc+vat_am,0);
end loop;
close c2;
KA :=nvl(tot+bc,0);
HTP.P('<tr>
<td width="38"> </td>
<td width="29"> </td>
<td width="447"> </td>
<td> </td>
<td width="173">
<p align="Right">-------------------</td>
</tr>
<tr>
<td width="38"> </td>
<td width="447"> TOTAL</td>
<td> </td>
<td width="95"></td>
<td width="172">
<p align="right">'
|| nvl(HTF.escape_sc (tot),0)
||'</td>
</tr>');
open c4;
loop
FETCH c4 INTO va,am,vat_am;
exit when c4%notfound;
HTP.P('<tr>
<td width="38"> </td>
<td width="446"> VAT '||nvl(HTF.escape_sc (va),0)||'% OF Rs.'||nvl(HTF.escape_sc (am),0)||'</td>
<td width="116"> </td>
<td></td>
<td width="172">
<p align="right">'
|| nvl(HTF.escape_sc (vat_am),0)
||'</td>
</tr>');
end loop;
CLOSE c4;
HTP.P('<tr>
<td> </td>
<td width="30"> </td>
<td width="118"> </td>
<td width="95"> </td>
<td width="173">
<p align="Right">------------------</td>
</tr>
<tr>
<td> </td>
<td width="446" align="left"> TOTAL</td>
<td width="118"> </td>
<td width="95"></td>
<td width="173">
<p align="right">'
|| nvl(HTF.escape_sc (KA),0)
||'</td>
</tr>
<tr>
<td> </td>
<td width="446" align="left"> LABOUR CHARGES :-</td>
<td width="118"> </td>
<td width="95"></td>
<TD width="173"></td>
</tr>');
elsif c_lab>0 and c_tra=NULL THEN
FOR Y IN(SELECT l.WORK_DETAIL,l.LABOUR_AMT
FROM transaction_details t,LAB_WORK_DTL l WHERE t.bill_no(+) =l.bill_no and l.bill_no =:P27_BILL_NO
LOOP
HTP.P('<tr>
<td> </td>
<td width="446" align="left"> '||nvl(HTF.escape_sc (Y.WORK_DETAIL),0)||'</td>
<td width="118"> </td>
<td width="95"></td>
<td width="173">
<p align="right">'|| nvl(HTF.escape_sc(Y.LABOUR_AMT),0)||'</td>
</tr>');
END LOOP;
HTP.P('
<TR>
<td> </td>
<td width="30"> </td>
<td width="118"> </td>
<td width="95"></td>
<td width="173"> </td>
</tr>');
HTP.p ( '<tr>
<td width="36"> </td>
<td width="445"> </td>
<td> </td>
<td width="97"> </td>
<td width="172">
<p align="Right">------------------</td>
</tr>');
sa:=0;
lst:=0;
open c3;
loop
FETCH c3 INTO st,la,p;
exit when c3%notfound;
sa:=nvl(sa+la,0);
lst:=nvl(lst+p,0);
end loop;
close c3;
TH:=nvl(sa+lst,0);
FS:=KA+TH;
htp.p('<tr>
<td width="36"> </td>
<td width="445"> TOTAL</td>
<td> </td>
<td width="97"></td>
<td width="172">
<p align="right">'
||nvl(ROUND(HTF.escape_sc (sa),2),0)
||'</td>
</tr>');
open c5;
loop
FETCH c5 INTO st,la,p;
exit when c5%notfound;
htp.p('<tr>
<td width="36"> </td>
<td width="445"> SERVICE TAX '||nvl(HTF.escape_sc (st),0)||' OF Rs.'||nvl(ROUND(HTF.escape_sc (la),2),0)||'</td>
<td> </td>
<td width="97"></td>
<td width="172">
<p align="right">'
|| nvl(ROUND(HTF.escape_sc(p),2),0)
||'</td>
</tr>');
end loop;
close c5;
htp.p('<tr>
<td width="36"> </td>
<td width="445"> </td>
<td> </td>
<td width="97"> </td>
<td width="172">
<p align="Right">------------------</td>
</tr>');
htp.p('<tr>
<td width="36"> </td>
<td width="445" align="left"> BILL AMOUNT</td>
<td> </td>
<td width="97"></td>
<td width="172" align="right">
<p >'||ROUND(HTF.escape_sc (FS),2)||'</td>
</tr>
<tr>
<td width="36"> </td>
<td width="445">
<p align="left"> '|| f_words(HTF.escape_sc (FS))||'</td>
<td> </td>
<td width="97"> </td>
<td width="172">
<p align="Right">------------------</td>
</tr>');
ELSE
FOR x IN(SELECT t.item_name, t.qty,t.rate, t.bill_no
FROM transaction_details t where t.bill_no=:p27_bill_no
LOOP
HTP.P('<tr>
<td width="2%"> </td>
<td width="55%" align="left"> '|| HTF.escape_sc (x.item_name)||'</td>
<td width="15%" ALIGN="right">'|| HTF.escape_sc (x.qty)||'</td>
<td width="15%" ALIGN="right">'|| HTF.escape_sc (x.rate)||'</td>
<td width="25%" ALIGN="right">'|| HTF.escape_sc (x.qty)* HTF.escape_sc (x.rate)||'
</td>
</tr>');
END LOOP;
tot:=0;
bc:=0;
KA:=0;
open c2;
loop
FETCH c2 INTO va,am,vat_am;
exit when c2%notfound;
tot:=nvl(tot+am,0);
bc:=nvl(bc+vat_am,0);
end loop;
close c2;
KA :=nvl(tot+bc,0);
HTP.P('<tr>
<td width="38"> </td>
<td width="29"> </td>
<td width="447"> </td>
<td> </td>
<td width="173">
<p align="Right">-------------------</td>
</tr>
<tr>
<td width="38"> </td>
<td width="447"> TOTAL</td>
<td> </td>
<td width="95"></td>
<td width="172">
<p align="right">'
|| nvl(HTF.escape_sc (tot),0)
||'</td>
</tr>');
open c4;
loop
FETCH c4 INTO va,am,vat_am;
exit when c4%notfound;
HTP.P('<tr>
<td width="38"> </td>
<td width="446"> VAT '||nvl(HTF.escape_sc (va),0)||'% OF Rs.'||nvl(HTF.escape_sc (am),0)||'</td>
<td width="116"> </td>
<td></td>
<td width="172">
<p align="right">'
|| nvl(HTF.escape_sc (vat_am),0)
||'</td>
</tr>');
end loop;
CLOSE c4;
HTP.P('<tr>
<td> </td>
<td width="30"> </td>
<td width="118"> </td>
<td width="95"> </td>
<td width="173">
<p align="Right">------------------</td>
</tr>
<tr>
<td> </td>
<td width="446" align="left"> TOTAL</td>
<td width="118"> </td>
<td width="95"></td>
<td width="173">
<p align="right">'
|| nvl(HTF.escape_sc (KA),0)
||'</td>
</tr>
<tr>
<td> </td>
<td width="446" align="left"> LABOUR CHARGES :-</td>
<td width="118"> </td>
<td width="95"></td>
<TD width="173"></td>
</tr>');
FOR Y IN(SELECT l.WORK_DETAIL,l.LABOUR_AMT
FROM LAB_WORK_DTL l where l.bill_no =:P27_BILL_NO
LOOP
HTP.P('<tr>
<td> </td>
<td width="446" align="left"> '||nvl(HTF.escape_sc (Y.WORK_DETAIL),0)||'</td>
<td width="118"> </td>
<td width="95"></td>
<td width="173">
<p align="right">'|| nvl(HTF.escape_sc(Y.LABOUR_AMT),0)||'</td>
</tr>');
END LOOP;
HTP.P('
<TR>
<td> </td>
<td width="30"> </td>
<td width="118"> </td>
<td width="95"></td>
<td width="173"> </td>
</tr>');
HTP.p ( '<tr>
<td width="36"> </td>
<td width="445"> </td>
<td> </td>
<td width="97"> </td>
<td width="172">
<p align="Right">------------------</td>
</tr>');
sa:=0;
lst:=0;
open c3;
loop
FETCH c3 INTO st,la,p;
exit when c3%notfound;
sa:=nvl(sa+la,0);
lst:=nvl(lst+p,0);
end loop;
close c3;
TH:=nvl(sa+lst,0);
FS:=KA+TH;
htp.p('<tr>
<td width="36"> </td>
<td width="445"> TOTAL</td>
<td> </td>
<td width="97"></td>
<td width="172">
<p align="right">'
||nvl(ROUND(HTF.escape_sc (sa),2),0)
||'</td>
</tr>');
open c5;
loop
FETCH c5 INTO st,la,p;
exit when c5%notfound;
htp.p('<tr>
<td width="36"> </td>
<td width="445"> SERVICE TAX '||nvl(HTF.escape_sc (st),0)||' OF Rs.'||nvl(ROUND(HTF.escape_sc (la),2),0)||'</td>
<td> </td>
<td width="97"></td>
<td width="172">
<p align="right">'
|| nvl(ROUND(HTF.escape_sc(p),2),0)
||'</td>
</tr>');
end loop;
close c5;
htp.p('<tr>
<td width="36"> </td>
<td width="445"> </td>
<td> </td>
<td width="97"> </td>
<td width="172">
<p align="Right">------------------</td>
</tr>
<tr>
<td width="36"> </td>
<td width="445" align="left"> BILL AMOUNT</td>
<td> </td>
<td width="97"></td>
<td width="172" align="right">
<p >'||ROUND(HTF.escape_sc (FS),2)||'</td>
</tr>
<tr>
<td width="36"> </td>
<td width="445">
<p align="left"> '|| f_words(HTF.escape_sc (FS))||'</td>
<td> </td>
<td width="97"> </td>
<td width="172">
<p align="Right">------------------</td>
</tr>');
END IF;
HTP.P('</table>
</body>
</html>');
END; -
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 -
[Interface] - Passing variety parameters/input to PL/SQL report
Hi,
I've the PL/SQL report which can allow passing in the parameter, i use '&'.
the report is given to the end user who do not have the IDE for PL/SQL. the machanism of the report is generated into the spool file and import into excel format.
now i am wondering how to create a tool using SQL or PL/SQL to allow the end user to choose the parameter(s) dynamically and passing into the PL/SQL to generate the report based on the input selected.
the parameters like below:
package code :
week no :
year :
department :
all the above parameters, the data would be selected from the existing lookup table. the user is allow to select more than 1 input for specified parameter for instance i want to spool report for week 1 until week 5.
pls advise any solution on this topic. thankshi scoot,
thank for reply.
yep, i'm using sql*plus and also sql navigator 4.0 .
the user don't have the software to interact. i'm thinking of build an simple interface using VB and passing in the parameter then initiate the sql*plus to run the program in background mode.
but if you have any other solution which not need to use other software to wirte such program , pls let me know immediately. thank -
Hi,
I am using apex 4.0.1 and I have a page with several SQL Report regions. The user can edit the data in the report regions by clicking a column that uses a href link to open a DML page in a modal window. The user can then amend some data in the modal window, press save which closes the modal window and uses the partial page refresh process to refresh the SQL report region. (Using apex.event.trigger('#SOME_REGION'),'apexrefresh')).
If I navigate through the report to show rows 31-45 and then click on a href to edit a record. On pressing save, the report is refreshed but the rows displayed goes back to 1-15.
How can I get the report to stay showing the rows 31-45?
Cheers
Paul.I believe this answers my question
http://monkeyonoracle.blogspot.com/2010/11/refresh-report-region-and-pagination.html
Edited by: pjturley on Jan 10, 2012 1:14 PM -
How to Convert MM/DD/YYYY to YYYY/MM/DD in SQL Reporting Services
i am having difficulty of converting a parameter field, called @startdate, on sql reporting services report to YYYY/MM/DD format. the parameter @Startdate was set to Data/Time. @Startdate is 6/1/2014 12:00:00 and I want to convert it
to 2014/06/01. I want to compare @Startdate with a column in database called Begindate which is in format of YYYY/MM/DD hh:mm:ss. I tried the followings
select * from Atable where cast(Atable.Begindate as date) >= cast(@Startdate as date)
select * from Atable where cast(Atable.Begindate as date >= cast(convert(datetime, @Startdate) as date)
SQL Reporting Services only gives me Text, Boolean, Date/Time, Integer and Float.
Regards,Hi Elmucho,
Sorry for the delay. I tested with the sample data you provided, however everything works well in-house. Could you please creste a new report and check the result. Here are the steps I performed:
1. Create a table and insert the following data:
Name (varchar(50)) Begindate (datetime, not null)
Lastdate (datetime, not null)
bob
2008-01-01 08:08:08.000 2010-10-10
10:10:10.000
alice
2010-10-10 10:10:10.00 2011-11-11
11:11:11.000
smith
2011-11-11 11:11:11.00 2012-12-12
12:12:12.000
2. Open SQL Server Data Tools, create the data source and add the dataset with the below query:
SELECT Name, Begindate, Lastdate
FROM [tablename ]
WHERE (CAST(Begindate AS date) >= CAST(@Startdate AS date)) AND (CAST(Lastdate AS date) <= CAST(@Enddate AS date))
3. Then, click execute button, it prompts for inputting the parameter value.
@Startdate
6/1/2008
@Enddate
5/1/2014
Enter the date and press OK.
4. Here is the result in the query designer:
Insert a table and fields. Save the report and preview:
Thanks.
Tracy Cai
TechNet Community Support -
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 -
Shared DateVar in Subreport and datediff calculation in Main Report?
Hello experts,
I am using CRXI sp2. I have a report that contains two subreports for different dates in the same date field that are identified by a Service Code. The subreports have been placed in the same group footer 1a to be displayed and the calculation resides in the main report group footer 1b. The shared variables are as follows:
whileprintingrecords;
shared datevar Codedate5473;
Codedate5473:={@Codedate5473};
and
whileprintingrecords;
shared Datevar Codedate5623;
Codedate5623:={@Codedate5623}
The main report has the following calculation is in group footer 1a.
Whileprintingrecords;
Shared numbervar daysbetween;
if (isnull({@Shared 5623})or isnull({@Shared 5473})) then 0
else daysbetween:= datediff("d",{@Shared 5623},{@Shared 5473})
This returns negative numbers as well as calculations where one of the shared variables is null.
I reset the calculation in the report header as well.
Thanks for your help in advance.
KevinHi Kevin,
I can reproduce your issue, As per my knowledge the crystal will make some issues in null value computation as well as shared variable computation
In your report i can see , you tried to access values from subreport to main report through shared variable. that will make problem. we can access values from main report to subreport without any issue using shared..dont ask me the reason..i am not the right person to say that... lol.
The another wrong thing i was found in your formula is , you are not resetting the shared variable any where.. so once the date field is null, the shared variable returning the previous value.
So this is the solution for you..
1,You have to add one more subreport for displaying your result., Lets say 'Sub report3'
and create a formula, like.(Same which you have write before for the result)
shared datevar Codedate5473;
shared Datevar Codedate5623;
numbervar daysbetween;
WhilePrintingRecords;
daysbetween:= datediff("d",Codedate5473,Codedate5623);
daysbetween;
2, Re- write your first two formulas like this
For Subreport1,
WhilePrintingRecords;
shared dateVar Codedate5473;
if isnull({Codedate5473}) then
Codedate5473:=date(0,0,0)
else
Codedate5473:=date({Codedate5473});
For subreport2
WhilePrintingRecords;
shared dateVar Codedate5623;
if isnull({Codedate5623}) then
Codedate5623:=date(0,0,0)
else
Codedate5623:=date({Codedate5623});
Hope this will works for you,
Cheers,
Salah.
Edited by: salahudheen muhammed on Aug 7, 2009 1:05 PM -
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 -
Currently, my SharePoint 2013 Farm has Workflows 2013 and SQL Report Services installed on app servers, along with other applications. Workflows 2013 isn't working correctly (installed prior to my coming on board with the organization), I'm assuming it
is a configuration issue, but rather than re-configure, I've read that is recommended to be a standalone server. It was also recommended by a MSFT rep that our report services have its own independent server. Currently, Report Services is also installed on
an app server that runs other applications on the farm.
Has anyone had any experience with installing Workflows 2013 and/or SQL Report Services on independent vs. existing application servers?
Additionally, my existing application servers have 24 GB of RAM (I believe the recommendation for SharePoint production environments is 12 GB), should I plan for the potentially new servers (Workflows and Report Services) to also have 24 GB of RAM? Not really
sure if it will be needed if they have dedicated tasks.
Thanks for any input you can provide!It entirely depends on load. WFM will work just fine installed on servers in the SharePoint farm. SSRS preferably should go on the end-user facing servers for better performance.
The questions you're asking are all "it depends" :)
Trevor Seward
Follow or contact me at...
  
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs. -
How to show the break totals and NOT the report totals in an SQL report
APEX 4.0.1
In an normal SQL report (Not interactive) with a break applied on the first column, how do you just show the break totals and NOT the extra full report totals?
Next, Is it possible to display only some of the row totals and not for all columns that have the sum option checked against them?
PaulPPaulP wrote:
APEX 4.0.1
In an normal SQL report (Not interactive) with a break applied on the first column, how do you just show the break totals and NOT the extra full report totals?Instead of using the APEX break feature, try doing all of this in the query using <tt>GROUPING SETS</tt> or <tt>ROLLUP</tt> to get the break rows, and <tt>GROUPING_ID</tt> in the <tt>HAVING</tt> clause to suppress the unwanted rows.
Next, Is it possible to display only some of the row totals and not for all columns that have the sum option checked against them?Don't really understand what's meant here?
Maybe you are looking for
-
Trying to move a file based on file name
ok, so i feel like this should be an easy thing to accomplish, but sadly, i can't seem to get it. here's what i got...i have an automator app that will take a file that has been scanned in (pdf) and rename it to the name in a field in one of my filem
-
Older Cinema Display to New MacBook
I bought a 20 inch LCD Cinema Display (A1081) from a friend. I have a brand new MacBook Pro (15" screen) that I want to connect it to. However, the cords from the monitor do not match up to the ports I have on the MacBook. The monitor comes with a DV
-
Getting error message when trying to update to 10.6.8
I'm trying to update a 10.6.7 computer to 10.6.8 But I get an error message everytime. The error messages read:The installation failed! The installer encountered an error that caused the installation to fail. Contact the software manufacturer for ass
-
Using java.io.* in JSPs
What are the minimum requirements (Oracle user access permissions, Solaris file system permissions, etc.) for reading files through java.io in a JSP in Oracle 8.1.6? My code can read a local file when deployed as a standalone app on NT (using thin dr
-
How to include planned customer consignment pick-up in availability check
We create customer consignment pick-up orders and want the availability check to take this qty into account as available qty from the planned pick-up date. We also want the consignment pick-up orders to be shown in MD04. Can anybody guide us with a s