Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Reports: Break on Deptno

Posted on 2004-09-30
2
Medium Priority
?
694 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
Helena Marková earned 150 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 150 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

688 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