Home » Developer & Programmer » Reports & Discoverer » Help with Decode
Help with Decode [message #294414] Thu, 17 January 2008 08:57 Go to next message
petis
Messages: 9
Registered: November 2007
Junior Member
Hi
Need help on how to get this to work.

What I really want to do is to choose which copies to print depending on if I send the print to printer or to screen.

REPORT_COPIES.COPY_NO IN (1,2,3,6,10) This works but it sends those copies out no matter what the variable DESTYPE is.

Now
REPORT_COPIES.COPY_NO IN DECODE(:DESTYPE,'Cache',(6) ,(10))
Also works, if DESTYPE is set to 'Cache' it produces only the sixth report onto my screen, and if it is set to 'printer' report number 10 is printed.

Problem is that I want multiple pages to go out when DESTYPE is set to 'printer' and
REPORT_COPIES.COPY_NO IN DECODE(:DESTYPE,'Cache',(6) ,(1,2,3,6,10)) doesn't work at all, as the decode thinks that the comma is part of the decode.

Any suggestions for how to get around this?
Been trying with ;:.[]{} but nothing seems to work.
This is in the SQL QUERY STATEMENT that I need to get this in.
Re: Help with Decode [message #294581 is a reply to message #294414] Fri, 18 January 2008 01:14 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Try lexical parameters.

By
Vamsi
Re: Help with Decode [message #294599 is a reply to message #294414] Fri, 18 January 2008 02:14 Go to previous messageGo to next message
petis
Messages: 9
Registered: November 2007
Junior Member
Thanks,
Been looking that up now, but can't seem to get it to work, Could someone please explain in abit more detail how to use them?

I Either want to send in just one number (6) or several (2,3,4,5,6,7,Cool

I can fix the one number, but the problem is when I want ot use multiple numbers.

[Updated on: Fri, 18 January 2008 02:18]

Report message to a moderator

Re: Help with Decode [message #294602 is a reply to message #294599] Fri, 18 January 2008 02:40 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Where you have coded
Quote:
REPORT_COPIES.COPY_NO IN (1,2,3,6,10)
change this to
REPORT_COPIES.COPY_NO IN &v_copy_no

I think DESTYPE will get populated in parameter form.
So, In the afterparameterform trigger you can assign the value to the lexical parameter v_copy_no as
IF :DESTYPE = 'Cache' THEN
   v_copy_no := '(6)';
ELSE
   v_copy_no := '(1,2,3,6,10)';
END IF;
Have a look at this.

By
Vamsi
Re: Help with Decode [message #294604 is a reply to message #294602] Fri, 18 January 2008 03:01 Go to previous message
petis
Messages: 9
Registered: November 2007
Junior Member
Thanks alot!

I almost had it but now I nailed it.

Thank you for the help.
Previous Topic: Matrix Reports - Spreadsheet output
Next Topic: How to print arabic font in reports - when I tried it is printing junk characters instead of arabic
Goto Forum:
  


Current Time: Fri Dec 09 09:47:59 CST 2016

Total time taken to generate the page: 0.09828 seconds