Solved

Another QReport Question... Keeping stuff together

Posted on 2000-02-19
6
525 Views
Last Modified: 2010-04-04
Hi,

I havea group in my report (header - sub detail - footer) and I NEVER want them to be separated over two pages..
Now I tried the Footer.Linkband = Header it didn't work
I tried Footer.linkband = Detail and Detail.LinkBand = Header. didn't work too..

What do I try next?



0
Comment
Question by:lizzzard
[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
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 2538650
mmm, i'm not sure but can reprintonnewpage not help you? ie. that the header is reprinted on the other page.

Otherwise, you've to use NewPage to be sure that you always start a newpage.

Zif
0
 

Author Comment

by:lizzzard
ID: 2538723
Hi, Zif

Ehr.. I don't want to REprint it.. I just want it to print once.. as a group.. So if the  Header - Detail - Footer combo doesn't fit on the page, THEN it has to go to a new page...
Ofcourse, I can calculate how much space is left and how much space I need, but I gather QReport has to do it by itself if I want too...

Regards,
Alex
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2538864
mmm, don't know if this is possible in QR.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 9

Expert Comment

by:ITugay
ID: 2539701
You right, you need to write BeforePrint method for your groupheader. There you need to calculate detail section size. If it's not possible to finish section before end of page, then you must start new page manually. QR can't do it itself.

Cheers,
Igor.
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 2552566
hey lizzzard,

I read something on how to implement a widow/orphan feature in QR :

There is no support for a Window/orphan feature, but you can do this with some minor code.
There is a function in the report called AvailableSpace that returns the amount of space left on the page.  You can compare that value to the band's Size.Length property and call NewPage when There is not enough space for the band.  AvailableSpace is a protected function so you can not call it directly.  If you subclass the report, you can access the function by casting the report to the subclass.
First, add the following declaration in the type section of your report form declaration:
  TMyQuickRep = class(TQuickRep)
  end;

To use this function to keep a band from being split over a page:
procedure Tfrm.DetailBand1BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
  if TMyQuickRep(QuickRep1).AvailableSpace >= round(Sender.Size.Length) then
    Sender.ParentReport.NewColumn;
end;

Zif.
0
 

Author Comment

by:lizzzard
ID: 2607796
Thanks, Zif

Sorry for the delay.. I used something like you proposed.

Regards,

Lizzz..
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month4 days, 3 hours left to enroll

630 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