Solved

Reports: Break on Deptno

Posted on 2004-09-30
2
679 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.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Salary Amount Format 13 56
Bulk insert into global temporary table 2 43
UNIX SCP 5 48
one-way data "masking" MD5 sql 26 103
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now