Home » Developer & Programmer » Reports & Discoverer » How to display parameter in the reports  () 1 Vote
How to display parameter in the reports [message #351800] Fri, 03 October 2008 04:22 Go to next message
suhasbr
Messages: 23
Registered: April 2008
Location: Chennai
Junior Member

Hi,

I have a parameter that i am passing it to the Query. Report is getting generated.

I want the parameter that i have passed in the Heading of the report. For that what i did is i created a Field and i assigned the source as parameter.
Till this it is Okay. But i can pass NULL also as a parameter input. So when it is displayed on the report i need it as a message. How to do this

Please help me its urgent Embarassed Embarassed Embarassed
Re: How to display parameter in the reports [message #351807 is a reply to message #351800] Fri, 03 October 2008 04:59 Go to previous messageGo to next message
smithagirish
Messages: 10
Registered: March 2008
Location: kochi
Junior Member
just try this
suppose that u'r parameter is ':P1'

create a formula column :cf_1
in the formula column give
declare
v_msg varchar2(20);
begin
if nvl(:p1,'X') <> 'X' then
v_msg := 'the message';
else
v_msg := :p1;
end if;
return v_msg;
end;
now give :cf_1 as the source of the field
Re: How to display parameter in the reports [message #351828 is a reply to message #351807] Fri, 03 October 2008 06:57 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There's no need to use that much of a code; it would be enough to put it as
function CF_1Formula return char is
begin
    return (nvl(:p1, 'the message'));
end;
Re: How to display parameter in the reports [message #353589 is a reply to message #351800] Tue, 14 October 2008 04:51 Go to previous messageGo to next message
jaganerp@gmail.com
Messages: 63
Registered: April 2008
Member
if your pass any value in report parameters then you nead to get value or if you are not passing (you are passing null) value
then also you need to get value i am right in your query write like this where you are passing parameters there

SELECT AIA.INVOICE_ID
,AIA.INVOICE_NUM
,TO_DATE(AIA.INVOICE_DATE,'DD-MON-RRRR')INVDATE
,AIA.DOC_SEQUENCE_VALUE
,AIA.INVOICE_AMOUNT
,NVL(AIA.AMOUNT_PAID,0) AMOUNT_PAID
,(AIA.INVOICE_AMOUNT - NVL(AIA.AMOUNT_PAID,0)) OUTSTND
,APS.GROSS_AMOUNT
,APS.IBY_HOLD_REASON
,APS.HOLD_FLAG
,aia.vendor_id
FROM AP_INVOICES_ALL AIA
,AP_PAYMENT_SCHEDULES_ALL APS
,PO_VENDORS PV
WHERE AIA.DOC_SEQUENCE_VALUE IS NOT NULL
-- AND AIA.INVOICE_DATE BETWEEN NVL(:P_FROM_DATE,AIA.INVOICE_DATE)AND NVL(:P_TO_DATE,AIA.INVOICE_DATE)
AND AIA.INVOICE_DATE BETWEEN NVL(TO_DATE( :P_FROM_DATE,'DD-MON-RRRR'),AIA.INVOICE_DATE) AND NVL (TO_DATE( :P_TO_DATE,'DD-MON-RRRR'),AIA.INVOICE_DATE)
AND PV.VENDOR_ID= NVL(:P_VENDOR_ID,PV.VENDOR_ID)
AND APS.INVOICE_ID = AIA.INVOICE_ID
AND AIA.PARTY_ID IN (SELECT PARTY_ID
FROM PO_VENDORS
WHERE PARTY_NUMBER IN (SELECT PARTY_NUMBER
FROM PO_VENDORS
WHERE ENABLED_FLAG = 'Y'))
AND AIA.INVOICE_AMOUNT - NVL(AIA.AMOUNT_PAID,0) > 0
GROUP BY AIA.INVOICE_ID
,AIA.INVOICE_NUM
,AIA.INVOICE_DATE
,AIA.DOC_SEQUENCE_VALUE
,AIA.INVOICE_AMOUNT
,AIA.AMOUNT_PAID
,APS.GROSS_AMOUNT
,APS.IBY_HOLD_REASON
,APS.HOLD_FLAG
,aia.vendor_id
ORDER BY AIA.DOC_SEQUENCE_VALUE ASC
,AIA.INVOICE_NUM ASC
Re: How to display parameter in the reports [message #353764 is a reply to message #353589] Wed, 15 October 2008 00:55 Go to previous message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Whoa! What is this ugly, unformatted SELECT statement supposed to mean? Where did you take it from? Why did you comment one of the lines? If it is unnecessary, why did you post it? Which part of it should help @suhasbr to solve his/her problem?
Previous Topic: report triggers
Next Topic: How to use a procedure
Goto Forum:
  


Current Time: Mon May 06 00:24:41 CDT 2024