Solved

Two invoices for page with Quick Report

Posted on 1998-06-25
13
702 Views
Last Modified: 2010-04-04
In a program developed in DELPHI 2.0, I need to print invoices they be she correspondents to the customers of a company. Using Quick Report 1.1, a report Master Detail was created, being:  
- Master: Data of the company that is using the system.  
- Detail: Data of the Customer that will receive the invoice.  
- Sub-Detail: Data of the acquired products or of the rendered services.  
As the number of products or rendered services are small, the company wants that in a page, be made the 2 customers' invoices.  
I should increase that each invoice should occupy half of the page, that already comes pré-printed, that is, the data of the band sub-detail have a fixed size of 20 lines, after the one which, a band group, gives the total of the invoice in a fixed field.    Unhappily, I didn't get to find any property, event or method that it turns fixed the size of the band sub-detail.
Using Quick Report normal methods, or he prints the several customers' invoices for page, or he prints 1 invoice for page using the property 'force new page'.  
As to solve the problem (2 invoice for page).
0
Comment
Question by:gaona
13 Comments
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Hi gaona,

What about using a internal counter? It counts to 2 and when 2 is reached force new page will be set?

Regards, ZiF.
0
 

Author Comment

by:gaona
Comment Utility
Dear ZifNAB,  
 
Thank you for the comment, but the proposal of its comment was already tried without success, for the following reason:  
When he/she said that 2 invoices should be printed by page, I forgot to say that each invoice should occupy half of the page, that already comes pré-printed, that is, the data of the band sub-detail have a fixed size of 20 lines, after the one which, a band group, gives the total of the invoice in a fixed field.  
Unhappily, I didn't get to find any property, event or method that it turns fixed the size of the band sub-detail.
0
 

Author Comment

by:gaona
Comment Utility
Edited text of question
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Hi gaona,

 An idea, much work but I think you can't do it another way.... Maybe you should manually give the data to the bands in the OnNeedData event (if lesser than 20 products, just send a space). You assign the datafields to a TQRLabel on the bands... This way you've got a way to have a fixed size.


Regards, Zif.

0
 
LVL 1

Expert Comment

by:Greedy
Comment Utility
I'm can't figure out what you want...can you translate this into english?  Maby Ziffy can put it into other words?  I'll try to explain what I think you want but I'm probably wrong...

The main thing that I got from reading your question and the comments is that you want 2 detail level bands to print on one page and you want to force only 2 to print on it...What I don't understand is that you say you can't make this band the same size...can't you set the Band.Size.Height property at design time to be 1/2 of the page height...or even do that in a BeforePrintEvent.

MyDetailBand.Size.Height := (0.5 * MyQReport.Page.Length)

I think you want to do something like put the data from the subdetail into the detail band...I would use the BeforePrint event of the Detail do do a Preform to create the Sub-Detail band information and incorperate it into your detail...


0
 

Author Comment

by:gaona
Comment Utility
Dear ZifNab  
 
I believe that its idea until he/she can give right, even so, when I tried to use the event OnNeedData to send the data of the band manually Detail, the system printed the band, without passing for the routine that I created to send the data manually.  
Because?  
 
Regards, Gaona.
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).

 

Author Comment

by:gaona
Comment Utility
Dear Greedy  
 
I really already tried setar the property height of the band Detail, so that independently of the ítens number that has the invoice, he is proportional to 20 lines of impression of characterses with height the same to 17 pixels (standard size that I am using to print).  
It happens that in this case, the space among the lines will be variable (it depends on the number of ítens of the invoice), and I don't fasten in 17 pixels.  
It also happens, that for each printed line, I am using a shape of the type qrsVertLine, to separate the columns of the invoice with height it fastens of 17 pixels.  
Excuse me, if I didn't get myself to do to understand, but, my reading of English is much better than my writing.
0
 

Author Comment

by:gaona
Comment Utility
Dear ZifNab  
 
As you said, its last idea on the use of the event OnNeedData, would be difficult (I passed the dawn implementing), but it worked.  
I got to print two invoices for page with fixed dimensions, using shapes type besides VerLine to separate the columns of the itens of the invoice.  
Like you just sent a comment, he would like to know as I can transfer the points for you.  
 
Greetings Gaona
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Gaona, sorry that I don't understand you. Is it working and are you asking me to answer this question, so you can grade this answer? ...Can you explain me more of this VerLine? What so you mean by that?
Regards, Zif.
0
 

Author Comment

by:gaona
Comment Utility
Dear ZifNab  
 
The one that I meant is that got to print the two invoice in a page with fixed spacing, as you proposed, for this reason, it is that I asked as I could transfer the points for you, since the one that you did was a comment and not an answer.  
With relationship to the shape VerLine, I meant that am printing a vertical line with fixed spacing among the columns in the band DETAIL of the invoice.  
 
Thankful for the help, Gaona
0
 
LVL 2

Expert Comment

by:hrizal
Comment Utility
On the last band, on the properties.
set align to bottom = true.

if any band above last band and below on 'band sub-detail'
also set align to bottom = true.

0
 

Author Comment

by:gaona
Comment Utility
Hi hrizal  
 
After analyzing its answer, lament to inform that she doesn't assist the question that I did entirely, therefore she just works partially.  
If you test in the way that it was indicated, he will see that same just printing two invoices for page, the location of the line that prints the total of the invoice is variable, and it doesn't fasten as I am wanting.  
I should also inform, that the last comment of ZifNab (and my comment to proceed), it solved the problem. In case you want the solution, it is enough to send me an e-mail.  
 
Thankful, Gaona
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
Comment Utility
Hi gaona,

I just copied my last comment as an answer. I'm sorry that I couldn't find a better solution, but this one works, maybe some day we'll find a better, easier solution.

        An idea, much work but I think you can't do it another way.... Maybe you should manually give the data to the bands in the OnNeedData event
       (if lesser than 20 products, just send a space). You assign the datafields to a TQRLabel on the bands... This way you've got a way to have a
       fixed size.


Best regards, Zif.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

763 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

12 Experts available now in Live!

Get 1:1 Help Now