Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Another QReport Question... Keeping stuff together

Posted on 2000-02-19
6
Medium Priority
?
529 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 150 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

927 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