Wednesday, March 7, 2012

mail merge problem

Hi there,
maybe you can help me. is there way to
skip lines in the mail sticker? we
are using 20 mail stickers/page paper and
usually the user uses only 4-5 stickers
we want to maximize the use of the unprinted
stickers is there way to skip the already
printed sticker by passing parameter "no. of skips"?
we are connected to an oracle database and uses
pl-sql with cursor ref.
thanks.Maybe you could just put something in the report header to skip the relevant amount of space. Here's two things I can think of:
1) A formula that writes 'n' * 'parameter' empty lines, assuming you can exactly match 'n' lines to a sticker.
2) An 'empty' sticker in a subreport, and force 'parameter' detail records to skip the space by using the command statement
select * from (select level from dual connect by level <= {?parameter})

(Beware, DO NOT run that statement without the <= clause!)|||thanks for your reply.
actually thats what i did below is current program running,
just asking maybe other solution by not doing this like for loop etc.

SELECT
FROM DUAL
where 1 <= p_noskip
union all
SELECT
FROM DUAL
where 2 <= p_noskip
union all
SELECT
FROM DUAL
where <till 19> <= p_noskip|||So replace those 19 unioned select from dual statements with one single statement:

select * from (select level from dual connect by level <= {?parameter})

Remember to create the parameter in the add command screen, not the field explorer/|||ThanksJagan, it works! I just added connect by level.
select '' from dual connect by level <= <parameter>|||Yeah, that'll work too - you don't need the extra select around the outside if you just want 'n' records as you do.
However, the nice thing about the full statement is that you get an ordered, contiguous set of values from 1..n
As level's a reserved word, I suppose it's more correct to actually write

select x from (select level as x from dual connect by level <= {?parameter})

so that you don't have to select * (literally, the * character)
If you write
select level from (select level from dual connect by level <= {?parameter})
then you find that you get 'parameter' records all with value 0

But hey, this is a Crystal forum not an Oracle one...but someone might find this useful...

No comments:

Post a Comment