Solved

Reports: Break on Deptno

Posted on 2004-09-30
2
683 Views
Last Modified: 2013-12-12
I am using reports ver 6i.

From the emp relation when i build up a group above report, it shows department no and the its hild record. The problem is when the records increases the out put should like this....

For each deptno if it appears at the bottom, it's child moves to next page with again deptno no on the top of next page. I want if deptno appears on end of page with no child record then it sholud not appears but only it should appears if atleast one of the child record comes on first page.

I mean only headings are not acceptable on the end of page. It should moves to the next page.

Thanks
0
Comment
Question by:pupil
2 Comments
 
LVL 22

Accepted Solution

by:
Helena Marková earned 50 total points
ID: 12197781
I hope this Note:125626.1 from Metalink will help you:

How to create a conditional page break based upon column value? (SCR 993)

Overview
--------
How to create a conditional page break based upon the value of one of the columns in the query? A customer would like a master-detail report to page break based upon the value of one of the columns being retrieved by the query. The master-detail report is already breaking on each master (through setting max records per page to 1), but the customer would like to have a page break occur if the contents of a specific column are equal to a certain value.

Caution
-------
The sample program in this article is provided for educational purposes only and is NOT supported by Oracle Support Services. It has been tested internally, however, and works as documented. We do not guarantee that it will work for you, so be sure to test it in your environment before relying on it.

Solution Summary
--------------------
Draw an object in the layout and create a format trigger to check the value of the desired column.

Sample Step-by-Step Instructions :
-----------------------------------
Go to the Layout Editor and add a horizontal line to the layout. Place this line directly below the field that will be associated with the format trigger.

The line should also be within the repeating frame of the referenced column.

Apply line color to make the line white (so it won't show up in the printed report) and set the properties to Page Break Before.

Then add a format trigger on the line object to check the value of the desired column. For instance, if a master-detail report is created on the EMP table and a page break is desired whenever the value of the COMM field is not null,create a trigger as follows:

function b_1Format trigger return boolean is
begin
if :comm is not null
then
return (true);
else return (false);
end if;
end;

When the report is run a page break will occur whenever the value of COMM is not null.
0
 
LVL 8

Assisted Solution

by:sapnam
sapnam earned 50 total points
ID: 12197870
One way would be as under :

There would be a Page Protect Property for the Repeating Frame associated with DEPT group. You can make this checked.  What this will do is ensure that all details for a department print on the same page. If not the dept printing moves to the next page.

Another way would be as under :

Always start printing of a dept on a new page.  This will require setting the maximum records per page property for the repeating frame associated with DEPT group to 1.

 
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question