Solved

Two invoices for page with Quick Report

Posted on 1998-06-25
13
731 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
ID: 1355901
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
ID: 1355902
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
ID: 1355903
Edited text of question
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 8

Expert Comment

by:ZifNab
ID: 1355904
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
ID: 1355905
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
ID: 1355906
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
 

Author Comment

by:gaona
ID: 1355907
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
ID: 1355908
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
ID: 1355909
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
ID: 1355910
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
ID: 1355911
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
ID: 1355912
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
ID: 1355913
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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 …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 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