Home » Developer & Programmer » Reports & Discoverer » .rtf report (10g)
.rtf report [message #468928] Mon, 02 August 2010 09:14 Go to next message
ashokb21
Messages: 92
Registered: May 2010
Member
hi all,
i am having a problem that in my rtf i need address1,address2,address3 one below other but if some time my address2 is null then the place of address2 one should be filled be address3.

[Updated on: Mon, 02 August 2010 09:17]

Report message to a moderator

Re: .rtf report [message #468931 is a reply to message #468928] Mon, 02 August 2010 09:30 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
You could just do that in the query:
SELECT address1, nvl(address2, address3) address2, nvl2(address2, null, address3) address3
Re: .rtf report [message #468932 is a reply to message #468931] Mon, 02 August 2010 09:37 Go to previous messageGo to next message
ashokb21
Messages: 92
Registered: May 2010
Member
if address2 is null then address3 will return twices.
Re: .rtf report [message #468934 is a reply to message #468932] Mon, 02 August 2010 09:42 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
It won't once we've corrected the nvl2:
nvl2(address2, address3, NULL) address3
Re: .rtf report [message #468935 is a reply to message #468934] Mon, 02 August 2010 09:46 Go to previous messageGo to next message
ashokb21
Messages: 92
Registered: May 2010
Member
i dnt known which address comes null it may be(address1,address2,address3).in this case what should i do.
Re: .rtf report [message #468938 is a reply to message #468935] Mon, 02 August 2010 09:53 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Expand the logic above to cope with all the cases, it's not that complicated.
Re: .rtf report [message #469645 is a reply to message #468938] Thu, 05 August 2010 06:32 Go to previous messageGo to next message
skaundinya
Messages: 9
Registered: June 2010
Junior Member
Hi,

Please add the following condition:

<?if:SHIP_TO_ADDRESS1!=' '?><?SHIP_TO_ADDRESS1?><?end if?>

Similarly for:

<?if:SHIP_TO_ADDRESS2!=' '?><?SHIP_TO_ADDRESS2?><?end if?>
<?if:SHIP_TO_ADDRESS3!=' '?><?SHIP_TO_ADDRESS3?><?end if?>
<?if:SHIP_TO_ADDRESS4!=' '?><?SHIP_TO_ADDRESS4?><?end if?>

Rgds,
skaundinya.
Re: .rtf report [message #469648 is a reply to message #469645] Thu, 05 August 2010 06:40 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Where would you add that exactly?
Re: .rtf report [message #469758 is a reply to message #469648] Thu, 05 August 2010 13:17 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Doesn't look like Reports to me (or it is something advanced that I never saw before. Something like MODEL clause. First time I saw it here, on OraFAQ Forum, I was sure it is not Oracle. I was very wrong).
Re: .rtf report [message #469768 is a reply to message #469758] Thu, 05 August 2010 14:19 Go to previous message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
skaundinya given the reply as, .rtf file normally used in Business Intelligence.
@ashokb21, Shall we move this to above forum?
Anyway if you want to handle that in sql, I think you can use 'coalesce'.
select coalesce(:1,:2,:3) from dual;
select coalesce(:2,:3) from dual;
select :3 from dual;
@skaundinya, But if I'm not wrong you will see a blank line in between. Don't you?

By
Vamsi

[Updated on: Thu, 05 August 2010 14:25]

Report message to a moderator

Previous Topic: Getting the query text from Reports
Next Topic: discoverer
Goto Forum:
  


Current Time: Fri Apr 19 16:10:37 CDT 2024