how do I calculate the page number is greated than 1 [message #417781] |
Tue, 11 August 2009 09:25 |
csphard
Messages: 8 Registered: February 2009
|
Junior Member |
|
|
I have seen the following code for displaying and not displaying boilerplated items. How do I use it if the page is greater than 1?
I saw this here. displays it on last page
IF srw.get_page_num() = :total_number_of_pages THEN
RETURN FALSE;
ELSE
RETURN TRUE;
END IF;
I saw this on oracle. displays on every other page
function XXX_FormatTrigger return boolean is page_num number;
begin
srw.get_page_num(page_num);
if mod(page_num, 2) = 0 then
return(false);
else
return (true);
end if;
end;
howard
|
|
|
|
Re: how do I calculate the page number is greater than 1 [message #417804 is a reply to message #417795] |
Tue, 11 August 2009 10:40 |
csphard
Messages: 8 Registered: February 2009
|
Junior Member |
|
|
I tried using the following code. However when I get to the next page the text does not display because printing objects on is set to the first page but the boiler plated item still takes up the space. I was trying to use the below code to get rid of it on the second page. Was that not right?
function B_18FormatTrigger return boolean is page_num number;
begin
srw.get_page_num(page_num);
if mod(page_num, 2) > 1 then
return(false);
else
return (true);
end if;
end;
Howard
|
|
|
|
|
Re: how do I calculate the page number is greated than 1 [message #417822 is a reply to message #417818] |
Tue, 11 August 2009 11:35 |
csphard
Messages: 8 Registered: February 2009
|
Junior Member |
|
|
I have been searching for examples and found this an example on
oracles site that show the code above for turning on and off
boiler plated items. It was called Creating a boilerplate object for text that displays every other page.
This seem to be away to turn it on and off. So I thought if I configure out if I was on the first page then turn return(false)
and the items would not be completely gone. Where now they are not displayed but they are still there.
Howard
|
|
|
|
|
Re: how do I calculate the page number is greated than 1 [message #417832 is a reply to message #417831] |
Tue, 11 August 2009 12:31 |
|
vamsi kasina
Messages: 2112 Registered: October 2003 Location: Cincinnati, OH
|
Senior Member |
|
|
MOD.
1. Write your own code.
2. Copy paste others' code blindly (without knowing what it is doing) is not recommended/dangerous/senseless.
Have you tried the following?Quote: | Can you write a pl/sql block to check whether x (is a number, which you get as input) is greater than 1 or not and print yes/no accordingly?
Then you can go to reports coding part.
|
By
Vamsi
[Updated on: Tue, 11 August 2009 12:33] Report message to a moderator
|
|
|
Re: how do I calculate the page number is greated than 1 [message #417845 is a reply to message #417832] |
Tue, 11 August 2009 16:28 |
csphard
Messages: 8 Registered: February 2009
|
Junior Member |
|
|
I think I now understand the following and that is SRW.GET_PAGE_NUM(page_num) will return the value of the page number in page_num. I am able to use this to display or not to display an item. My problem is that when the item is not displayed I want the items below it to move up and take that space so that I do not have blank white space where the item was.
How do I do that. Is that an anchor. Do I have to anchor it or everything above it to everything below it?
code being used
function F_3FormatTrigger return boolean is page_num number;
begin
srw.get_page_num(page_num);
if page_num > 1 then
return(true);
else
return (false);
end if;
end;
Howard
|
|
|
|