Solved

Another QReport Question... Keeping stuff together

Posted on 2000-02-19
6
513 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

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

19 Experts available now in Live!

Get 1:1 Help Now