Solved

Another QReport Question... Keeping stuff together

Posted on 2000-02-19
6
517 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
  • 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 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