Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Yet Another QReportQuestion - CompositeReport..

Posted on 2000-02-21
16
Medium Priority
?
512 Views
Last Modified: 2012-06-27
Hi,

I was trying to make a Composite report of two reports, but it doesn't print anything.. not even in preview.. I gues I'm doing smth wrong..
Besides, how do I know in front how many pages a report is going to be?
Can anybody give me a code example?

Thanks,

Lizzzard
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
  • 9
  • 7
16 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 2544062
you've to add reports to your composite quickreport :

Thus in the AddReports event of the Composite Report component you add your Quickreports, eg.

procedure TfrmQR3Demo.QRCompositeReport1AddReports(Sender: TObject);
begin
  // The OnAddReports event is called by the CompositeReport
  // to add the reports to list of reports
  with QRCompositeReport1.Reports do
  begin
    Add(frmMasterDetail.QuickRep1);
    Add(frmBasicMD.QuickRep1);
    Add(frmImageRpt.QuickRep1);
  end;
end;

Preview/Print it like

QRCompositeReport1.Preview;

QRCompositeReport1.print;

This is the example of QR itself. I've one at my work also. Also note that the composite report only works on preview and printing (not exporting to html,...)

Zif.
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 2544137
Oops, forgot a question :

About pagecount :

I think the only way is  to use the Prepare method. This method creates the
report (thus time of report-making increases! timex2) but doesn't show or print it.
Then look at QuickReport1.QRPrinter.PageCount which will then be accurate.
Be sure to free the QRPrinter object and set it to nil after you access the
variable but before you preview it.

eg.

QuickRep1.Prepare;
TotalPages := QuickRep1.QRPrnter.PageCount;
QuickRep1.QRPrinter.Free;
QuickRep1.QRPrinter := nil;


I think there is no other way. eg, If you set a TQRSysData to qrsPageCount, you've also set the report's Options property to TwoPass

Regards, Zif.

0
 

Author Comment

by:lizzzard
ID: 2549871
Hi, Zif,

Which version and edition are you working with??

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 8

Expert Comment

by:ZifNab
ID: 2550150
D4/D5 and latest QR.

Doesn't it work?
0
 

Author Comment

by:lizzzard
ID: 2550174
Nope...

TotalPages := QuickRep1.QRPrnter.PageCount;

gives me wrong number of pages. Lookes like the
pagelength differs from this method in relation to the print method of the report. Besides I dont have a qrsPageCount..
I'm using D5, with QReport that comes with Delphi.
Do you have professional?
0
 

Author Comment

by:lizzzard
ID: 2550182
This is my first time I have to make smething with qreport (you already guessed huh?) and the project has to be finished soon, so I don't have too much time to sort it all out. A position I certainly don't like to be in...
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2551415
But have you first prepared the report, before you checked the pagecount?

I've Enterprise version of D5.

argh, it was qrsPageNumber. Oops sorry.
0
 

Author Comment

by:lizzzard
ID: 2551861
Hm...

I used Prepare.. yes.. But sometimes the number of pages just isn't right. Most of the time one less than it really is...

Strange....

I thought it had to be PageNumber, but it didn;t work, so I thought maybe you had another version...

Still. I'm up sh*t creek...
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2552493
yes strange indeed.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2552548
mmmm, well you've a PageNumber... this is at QuickRep1.PageNumber. (this is at record generation).

It's funny, but it looks like this property contains the latest PageNumber (after Prepare)... I tested it and it seems to give the correct amount of pages (=is last PageNumber).

What does it in your application?

Zif.

0
 

Author Comment

by:lizzzard
ID: 2553728
Hi, Zif..

Thanks for your time..
After prepare,PageNumber just gives me one page too less. When I print it or preview it, there's one page extra. I did a QuickRep1.QRPrnter.Preview and noticed that there was more data on a page... However, I don´t like to mess around with the paper length, because it ought to be right.. just A4..

What do you suggest?

Lizzz...
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2553748
uck!
0
 

Author Comment

by:lizzzard
ID: 2553977
Thanks! I'll try that...
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2557597
lizzard,

what happens if you explecitely set the paperlength (in source code)  before calling prepare?

Zif.
0
 

Author Comment

by:lizzzard
ID: 2622791
Hi,

Thanks for your help on this Zif and sorry you haven't heard from me in awhile.. but you know busy...busy..

Anyway, after all I solved this problem by setting the papersize to A4 every time it's printed, What the f**k is going on why I have do do this...
Anyway.. it's solved now..

Thanks again,

Regards,

Lizzz.....SSSSSSSSSSSsssssssssssssssss.........
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2625648
Hi lizzard,

from my experience QR isn't that very good, however it's also the only reporting tool I've used, so I don't know how other reporting tools are.

Zif.
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

636 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