Home » Developer & Programmer » Reports & Discoverer » Collapsing a Frame Vertically
Collapsing a Frame Vertically [message #259838] Thu, 16 August 2007 11:39 Go to next message
GHott
Messages: 8
Registered: August 2007
Junior Member
I have a small problem that I can't seem to figure out.

I am currently formatting a report, and there is a frame that contains information that needs shown only when the fields within the frame contain data. If those fields within the frame are NULL, then I want the frame to collapse and hide, like its not there at all. The frame is right in the middle of the report, so just hiding it isn't an option. It still leaves a huge blank space in the middle of the report that doesn't need to be there.

I've searched around these forums for about an hour...and I did find some ideas to try on the subject. Someone had suggested that I use the conditional formatting for the frame, that when a value is NULL inside the frame, the frame is hidden.

That works well, but, just hiding the frame leaves a big blank space on the report; like I stated above.

I also saw where someone suggested to anchor it to another frame within the report, and set the anchor to collapse vertically and horizontally. I tried this with a number of various different frames, but it always seems to mess up the formatting completely. Or it would tell me that the child frame would never fit horizontally.

I am hoping I can just put a conditional formatting trigger on the frame that I want collapsed...just using PL-SQL and be done with it..

(This is with Oracle Reports 9i)

Any suggestions?

[Updated on: Thu, 16 August 2007 12:27]

Report message to a moderator

Re: Collapsing a Frame Vertically [message #259905 is a reply to message #259838] Thu, 16 August 2007 16:49 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
GHott
I am hoping I can just put a conditional formatting trigger on the frame that I want collapsed...just using PL-SQL and be done with it.

And I'd say you are right.

I wrote a sample report based on Scott's schema; it contains two linked queries (departments and their employees). For testing purposes, I created two FORMULA columns which compute
a) for numeric columns (as COMM is) sum(comm)
b) for character columns (as JOB is) sum(length(job))

There are also two format triggers: one to hide frame contents and another to hide column labels. They both look the same:
function M_G_EMPNO_GRPFRFormatTrigger return boolean is
begin
  IF :CF_1_COMM IS NULL 
     AND 
     :CF_2_JOB IS NULL
  THEN 
     RETURN (FALSE);     --> i.e. don't display this object
  END IF;
  RETURN (TRUE);         --> display it
end;

I hope you'll be able to figure it out by viewing the report itself. For testing purposes, you'll need to update EMP table, columns JOB and COMM, by making them NULL per certain departments in order to either display those frames or not.

If you are satisfied with such a solution, you'll have to perform check for all columns - it is up to you how it will be done; I was checking numerics summary and characters length; you may choose to check something else. Also, you didn't mention tables' description. DATE columns can also be converted to characters, if you have any of those.

Please, do not object report's beauty - I didn't pay any attention to it.
  • Attachment: brisime.rdf
    (Size: 96.00KB, Downloaded 1097 times)
Re: Collapsing a Frame Vertically [message #260090 is a reply to message #259838] Fri, 17 August 2007 07:06 Go to previous message
GHott
Messages: 8
Registered: August 2007
Junior Member
Thank you very much!
Previous Topic: The formula col refers a field in a Qry..pl help
Next Topic: How to send report output to Excel? (renamed by LF)
Goto Forum:
  


Current Time: Fri Jul 05 05:39:30 CDT 2024