Highlight an item in a SQL-report
Hello,
I have a table in which items are stored with a column "name" and a column "correct".
I need to highlight an item (put backgroundcolor in red) in a SQL-report based on the fact if the value of the column "correct" of the item is False. I don't know how I can do this? Can anyone help?
Thanks in advance,
Bram.
Hello Bram,
Something like:
select "DEMO_PRODUCT_INFO"."PRODUCT_ID" as "PRODUCT_ID",
CASE WHEN PRODUCT_AVAIL='N'
THEN '<span style="background:red">'||product_name||'</span>'
ELSE product_name
END "PRODUCT_NAME",
"DEMO_PRODUCT_INFO"."PRODUCT_AVAIL" as "PRODUCT_AVAIL"
from "DEMO_PRODUCT_INFO" "DEMO_PRODUCT_INFO"Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-)
Similar Messages
-
How To Use a Hidden Page Item within an SQL Report Query without Submitting
Hi,
Using: Oracle ApEx 3.0.1
I have an sql report region that contains a hidden page item as part of the "where clause". My problem is, based on a value entered by the user, I need to assign this value enetered to my hidden item, so that it can be used within the where condition of my sql but this would need to be done without actually submitting the form.
At the moment, I can set the value via an on-demand process but my SQL is still not returing any values as the hidden page item within the query is not set (as page has not been submitted).
Can anybody please assist as I am not sure how to do this and whether in actual fact, this is possible to do, without having submitted the page.
Thanks.
Tony.
Edited by: Tony F. on Nov 12, 2011 1:39 AMYou can set a session value using a dummy ajax call e.g:
Add the following to the 'Function and Global Variable Declaration' region
function f_set_item(pThis){
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',1);
get.add('P1_ID',pThis.value)
gReturn = get.get();
get = null;
}Where P1_ID is the session value to be set. Then call the function in the usual way e.g.
javascript:f_set_item(this);
I hope that helps
Shunt -
Multiselect item in a SQL/Report received No data found msg
I am having a problem with retrieving rows from a table with a multiselect item.
I am using the INSTR function in my SELECT but it only works for one value not two values.
I am use an anonymous PL/SQL block in a report region:
Begin
V_Q:= 'select "ID","FIRMID","FIRM_NAME","ADDRESS1","ADDRESS2","CITY","COUNTY","STATE","ZIP",
decode("PHONE",null,null,''('' || SUBSTR("PHONE",1,3)|| '') '' || SUBSTR("PHONE",4,3)||''-''|| SUBSTR("PHONE",7,4)) as "PHONE",
decode("FAX",null,null,''('' || SUBSTR("FAX",1,3)|| '') '' || SUBSTR("FAX",4,3)||''-''|| SUBSTR("FAX",7,4) )as "FAX","EMAIL","ETHNICITY","GENDER"
from "FIRMS" "F"
where 1=1 ';
/********************* this is the code in which I am having a problem ***********/
If V('P1_COUNTY') is not null then
v_Q := v_Q || ' AND ' ||'INSTR('':''||v(''P1_COUNTY'')||'':'', '':''||"COUNTY"||'':'') > 0';
end if;
APEX_COLLECTION.DELETE_COLLECTION (
p_collection_name => v_collection_name );
:P1_Q := v_q;
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
v_collection_name,
v_q );
End;
I am using APEX 2.2 with Oracle 9.2
I ran the same query in SQL*Plus and it worked. I received data for multiple selections (2).
Why did it work in SQL*plus and not in APEX?
Was this a reported bug in APEX 2.2? Was this corrected in APEX 3.0(.1)?
Can someone please help, I am completely perplexed!
RobertOops...
I found the error. INSTR works perfectly. The problem was that I used where clause referencing the COLLECTION which did not have the INSTR builtin function.
Sorry about that.
This is now closed. -
Hi,
Hoping someone can please assist but I am unsure how to highlight a row within my SQL Report based on a condition, i.e. either a DECODE or CASE statement being true - if so, would like that report highlighted light blue say.
Any help, links,examples would be much appreciated.
Thanks.
Tony.This should help
Conditional item formatting (color)
you will have to tweak it a bit, but its a way forward for you. -
RRS Feed as a SQL Report in HTMLDB?
Hi
I'd like to generate RSS file as a standard SQL Report in HTMLDB (i.e. no public access to db procedures needed as in AskTom RSS example mentioned in this forum).
I've created:
- Page template with "<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>....</channel></rss>" stuf.
- Report template of row type with <item><title>#1#</title><link>#2#</link><description>#3#</description></item> stuf.
- SQL Report utilizing these two templates (region has no template) having three relevant columns.
Page is generated OK but for whatever reason a web browser nor a RSS Feed reader do not recognize it as a valid XML content.
Any suggestions?
Roman
P.S. Is there any intention to support RRS feed as a standard report type in next version of HTMLDB?Carl
That was exactly what I was looking for. Thanks a lot!
Summary of steps for others:
1.) Choose Create Application/Shared Components/Application Processes,
2.) Set the process name e.g. "RSSProcess", select type OnDemand and create the code generating the RSS file, e.g.
DECLARE
title varchar2(4000);
link varchar2(4000);
description varchar2(4000);
CURSOR c1 IS
select
opportunity_name as title,
'' as link,
opportunity_name as description
from opportunities
where rownum<=20 and MASTER_OPPORTUNITY='N' and issue_date is not null
order by issue_date desc;
begin
owa_util.mime_header( ccontent_type => 'text/xml', bclose_header => TRUE, ccharset => 'utf-8');
htp.prn('<?xml version="1.0" encoding="UTF-8"?>');
htp.prn('<rss version="2.0">');
htp.prn('<channel>');
htp.prn('<title>iActiveLife - novinky</title>');
htp.prn('<link>http://www.iactivelife.cz/</link>');
htp.prn('<description>Zajímavý ivot snadněji</description>');
htp.prn('<language>cs</language>');
htp.prn('<pubDate></pubDate>');
OPEN c1;
LOOP
FETCH c1 INTO title,link,description;
EXIT WHEN c1%NOTFOUND;
htp.prn('<item>');
htp.prn(' <title>' || title || '</title>');
htp.prn(' <link>' || link || '</link>');
htp.prn(' <description>' || description || '</description>');
htp.prn('</item>');
END LOOP;
CLOSE c1;
htp.prn('</channel></rss>');
end;
3.) Create the RSS link "f?p=&APP_ID.:0:&SESSION.:APPLICATION_PROCESS=RSSProcess" at the suitable place
Roman -
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! -
Highlight search string in a pl/sql report
Hi all,
I followed the example of QBE by Scott Spendolini. I got it working. But I am trying to add the highlight search string functionality, in the report created. The report is created from a dynamic pl/sql query. Can you give me any ideas or an example? Thank you for your time in advance,
Rgds,
Suma.Hi Suma,
Your Search button runs a process called "RUN_REPORT". Presumably, this process picks up the values from the tabular form to construct the new SQL statement.
Given that you don't have a normal report definition - ie one that you can use the Highlight Words option - the only other possibility is to adjust the SQL query results.
Let's assume that you have in your RUN_REPORT process a variable called vJOB that holds the JOB value from your QBE grid. Your SQL statement could then be adjusted to something like:
SELECT EMPNO,
ENAME,
'<span style="color:red">' || JOB || '</span>',
etc
FROM EMPTABLE
WHERE JOB = vJOB;
Obviously, without seeing your code, I can not say exactly how it should be constructed to highlight the word(s), but the above should give you an idea of what you need to do. If you're still not sure, can you please paste into this thread the RUN_REPORT code.
Regards
Andy -
Passing sql report query field value to hidden item in javascript
I have sql report which has in each row one html button. Let us say that query SHOULD look like (two columns, to be easy to get the point):
select 1 SECURITY_ID
, '<input type="BUTTON" value="Top10" onClick="javascript:Top10Click ('||SECURITY_ID||');" >' BTN
FROM DUAL;
function Top10Click (vValue) {
html_GetElement('P31_PROCESS_VALUE').value = vValue;
doSubmit('GO_BACK');
} <br><br>
where P31_PROCESS_VALUE is hidden item where i want to store value of row where click happened.
<br><br>
In every button i want to pass row value "SECURITY_ID" to Top10Click function for each row differently.
<br><br>
Problem is that when I place double qoute then js is not working, else js is ok but "SECURITY_ID" is passed as constant not as live SQL value.
<br><br>
Any help...THX!
<br>
Demo is on oracle:
http://htmldb.oracle.com/pls/otn/f?p=26216:1
Workspace entry:
WK: FUNKY
UN: [email protected]
PW: qwertzI have tried to unify the solution, so it looks like:
select 1 SECURITY_ID
, '<input type="BUTTON" value="Top10" onClick="javascript:Top10Click ('||'"_X;'||SECURITY_ID||'"_X;'||');" >' BTN
FROM DUAL;change '"_X;' (remove "_X" part ... so it can be seen in HTML properly!
THX Denes for great ideas... -
Refresh SQL Report (Submit Page Item)
I want to add a search field in a SQL Report. I have something like this
SELECT * FROM emp
WHERE emp_no LIKE :P1_SEARCH || '%'I want to do the search asynchronous, on keypress. The problem is that a SQL Report doesn't have a "Submit Items:" atribute like a interactive report.
So after i refresh the report:
$a_report($x('P1_REPORT_ID').value,'1','10','100');The report is refreshing (the circle icon on top of the screen) but nothing changes cause the :P1_SEARCH doesn't submits.
How could i submit a page item from JS ?
King Regards,
Cearnau Dan
PS: I'm using APEX 4 and using dynamic actions it's the same like the Javascript call.(still doesn't submits the :P1_SEARCH item)Hi Dan,
I would suggest not to use the undocumented
$a_report($x('P1_REPORT_ID').value,'1','10','100');It's very likely that it will be changed in APEX 4.1
Dan.Cearnau wrote:
PS: I'm using APEX 4 and using dynamic actions it's the same like the Javascript call.(still doesn't submits the :P1_SEARCH item)That's true, but have a look at Anthony's blog posting http://anthonyrayner.blogspot.com/2010/07/report-filtering-with-apex-40-dynamic.html which explains a workaround to pass the new values for a classic report as well.
Regards
Patrick
My Blog: http://www.inside-oracle-apex.com
APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Report based on a ITEM (which has SQL statement)
Hi everyone,
I have a created a form based on a table which has 1 column that stores SQL statement in the database.And i am displaying the SQL statement in TEXT AREA FILED.
What i want to do is to create a report based on that SQL statement (Which is in the TEXT AREA field on the same page).I tried to create a report region with
:P25_SQL_STATEMENT.But i am getting an error
----->invalid query, no select statement found.
How can i do a report based on the item which has SQL query in it.
Thanks
phani
.Hi Jkallman,
Thanks for the reply.I have a (FORM WITH REPORT) on a table which has column of SQL_STMNT VARCHAR2(2000 BYTE) which takes the SQL statement entered from the FORM.
1.I have a report which shows all the records in the above mention table on page 10
2.If i hit the edit button in the report i go to page 11 which i have the FORM on the above mentioned table.In that form i have a field :P11_SQL_STMNT.
3.I am trying to create a report on the same page 11 based on the SQL query of that :P11_SQL_STMNT.
4.I did the follwoing steps
--> create a region
----> report
---->sql report
and entered the following code.
begin
return (:P11_SQL_STMNT);
end;
but it is giving me the error which i mentioned in the previous post.If u need any more details i can provide
Thanks in advance
phani -
Not an interactive report, just a normal SQL report.
What I want, and I just can not figure it out, is have a row highlighted if columnA=0.
So, if I have 80 rows in a report, and value for columnA=0 I want that row highlighted, say a red or a yellow back ground. Can not depending on sorting as users can sort the data, columnA can be hidden or a new column added.
How would I go about doing that?The following solution worked for me:
Re: Change color of row background when a column in that row meets a condit
Mike -
Pass Page 0 TextBox item value to populate SQL Report on another page.
Hi,
I have created one textbox and one Template Based Button on page 0.
And i have coded (On Button Display Attributes)
I want to pass Page 0 TextBox value into the SQL Report on Page100.
For this i planed to pass the value entered on Page 0 (TextBox) by coping the entered value into clipboard and assign this value to a hidden textbox(P100_SEARCH), which is on page 100. so that i can pass this value to the SQL Report.
I have coded (On Button Display Attributes) in Page 0.
onclick="javascript:window.clipboardData.setData('Text', document.getElementById('P0_SEARCH').value);redirect('f?p=229:100:&APP_SESSION.::NO:::');"
So its copying the entered value into clipboard and redirecting to page 100.
But here i am facing the problem
how to assign the save clipboard value into Hidden TextBox(P100_SEARCH) on page 100, so that data is
populated on page100 according to the enterd value from page 0.
Please help me . Its urgent.
Thanks
--PMHi,
I think it is the button templates that are causing the problem as they a normally designed to submit the page and you need to do a redirect.
I would suggest doing the following:
1 - Go to Shared Components, Templates
2 - Click Create
3 - Select Button
4 - Select "As a Copy of an Existing Template"
5 - Click Next until you get to a list of existing button templates
6 - Change the name of the "Copy of ..." for the template that you are using (to something like "Button for javascript") and select Yes in Copy?
7 - Click Copy Button Template
8 - When it has been created, you are returned to the templates list - click the edit link for your new button
9 - Update the "Template" setting. How you change this depends on your Theme and the Button Template you are using. But, as an example, in Theme 19 and using the Button button template, change:
<input onclick="#LINK#" class="t19Button" value="#LABEL#" type="button" />to:
<input #BUTTON_ATTRIBUTES# class="t19Button" value="#LABEL#" type="button" />So, the onclick="#LINK#" setting is removed and the #BUTTON_ATTRIBUTES# one is added in instead.
Now, go back to Page 0 and change your button to use this new template.
Change the Button Attributes setting to:
href="javascript:void(0);" onclick="javascript:redirect('f?p=&APP_ID.:100:&SESSION.::NO::P100_SEARCH:' + $v('P0_SEARCH'));"and Apply Changes
Now try your page again
Andy -
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; -
SQL report link to another report
Hello,
I am using Apex 4 and trying to link an sql report with another report. If I were able to use an interactive report I could easily link that to another page, but that would require me to have a primary key. The problem is that I need to link a few tables. So two questions:
1.) Can I link these via an HTML link to my other page? I would have a HTML link in my report that would link via URL parameter passing. So can I use HTML in a report?
2.) What is the syntax for a parameter passing via URL? Here is my link that would be:
a href= f?p=107:40:&APP_SESSION::::P40_NAME:MARK: Are there any other ways to accomplish this?
Thanks,
Mark
Edited by: LondonMark on 23-May-2011 04:18
Edited by: LondonMark on 23-May-2011 04:20I am using Apex 4 and trying to link an sql report with another report. If I were able to use an interactive report I could easily link that to another page
It's easy in standard reports< /a>. (Ignore the "Interactive Report" typo in step 1.)
1.) Can I link these via an HTML link to my other page? I would have a HTML link in my report that would link via URL parameter passing. So can I use HTML in a report?You can, but it's better practice to keep data retrieval and HTML structure separate when possible—in this case by using declarative Column Links.
2.) What is the syntax for a parameter passing via URL?This is also covered in the documentation.
Here is my link that would be: a href= f?p=107:40:&APP_SESSION::::P40_NAME:MARK:
{quote}
That looks to have the order of the parameters correct, but it's missing some syntax:<a href="f?p=107:40:&APP_SESSION.::::P40_NAME:MARK">...</a>
The static text exact substitution method of referencing the value of an APEX item requires a terminating dot ("."): <tt>&APP_SESSION.</tt> -
Controlling the page of an SQL report region
I have an SQL report region containing 70 rows. It shows the status of a bidding process that takes place in sequence, from the guy in the first row to the guy in the last. I use a "red light/green light" technique in each row to show who is currently eligible.
Typically users will login and then hit the next button to get to where the action is once the first 15 folks are done (number of rows = 15). Is there some way to set which set of rows first appears?
I looked at the URLs. When I first logged in I got:
http://htmldb.ciscoinc.com/bill/f?p=173:3:15341208186623218430::NO:::
After clicking "Next" I got:
http://htmldb.ciscoinc.com/bill/f?p=173:3:15341208186623218430:pg_R_4821423314714801953:NO&pg_min_row=16&pg_max_rows=15&pg_rows_fetched=15
How do I come up with:
pg_R_4821423314714801953 ?
Any thoughts? Thanks.
BillBill,
I would suggest using a dynamic query thatâs referencing a page item to limit the result set so that the correct records are shown when the user branches to the report page. Manually modifying the pagination URL is not supported. The URL contains the internal region ID, and is setting some internal pagination variables. The internal workings of report pagination could change in future versions of HTML DB, so manually manipulating those values could cause your report to break duing a future upgrade.
Regards,
Marc
Maybe you are looking for
-
Reader plugin Internet Explorer 11
Hello there, We have a problem with the adobe reader plugin for opening pdf-files in the Internet Explorer 11. Scenario: Citrix Xen App 6.5 IGEL thinclients model UD2-D210 It's only occuring on the thinclients with citrix sessions, all other clients
-
PayPal to create ecommerce site, also nested widgets.
My client wants a shop. Essentially it will be an online gallery offering print sales. The Gallery is to contain 8 main gallery folders containing 12 images each and the client wants to offer 3 types of print sale for each image (Postcard, poster and
-
I'm using Raphael to draw some dynamic curves and it works basically. http://raphaeljs.com/ But one problem I found is that the mouseover/click events of all elements will not trigger if they are inside the Raphael paper area. Who deal with this prob
-
I'm still on 10.4.11 on my mac (because I want to) Firefox will not open sense the last update. I want my fox back, what do I need to do. and don't tell me to update the mac, Grrrr!
-
Brand new macbook won't run off battery, only when plugged in
I just go my new macbook last week and being new to mac computers, I didn't realize that it won't run from just the battery power until last night. The battery light shows it's fully charged. If i'm working with it plugged in and it becomes unplugged