Simple Invoice
Hi.
I'm trying to print a universal government form. You may think of it as an invoice.
My "invoice" is very simple:
1. header band with fixed information.
2. DetailData band with up to 25 rows from detailData source x.
3. DetailData band with up to 5 rows from detailData source y.
4. Page footer with summary information.
1 and 4 are working as expected.
The problem is that in order to show 25 rows on the detaildata band regardless if there are less than 25 detail data records, I am having to detached the data source from the band. After band is detached from a data source, I only get empty line numbers 1 thru 25 with no data. If I attach the data source back to the detaildata band, then it will only show as many rows as detail records are found on the data source, thus shrinking the detail area when less than 25 and moving up other bands below. If more than 25 detail records, then it pushes the other bands to the next page. I need each segment to be at a fixed positon on the page.
Please find attached my .fr3 file as it might help explain what I'm trying to do.
Thank you,
Reinaldo.
I'm trying to print a universal government form. You may think of it as an invoice.
My "invoice" is very simple:
1. header band with fixed information.
2. DetailData band with up to 25 rows from detailData source x.
3. DetailData band with up to 5 rows from detailData source y.
4. Page footer with summary information.
1 and 4 are working as expected.
The problem is that in order to show 25 rows on the detaildata band regardless if there are less than 25 detail data records, I am having to detached the data source from the band. After band is detached from a data source, I only get empty line numbers 1 thru 25 with no data. If I attach the data source back to the detaildata band, then it will only show as many rows as detail records are found on the data source, thus shrinking the detail area when less than 25 and moving up other bands below. If more than 25 detail records, then it pushes the other bands to the next page. I need each segment to be at a fixed positon on the page.
Please find attached my .fr3 file as it might help explain what I'm trying to do.
Thank you,
Reinaldo.
Comments
How this all happens depends on your database. What are you using?
I'm using Sybase ADS. But the detail data comes to FR as a userdataset as it is already stored on an array. Your post has help me figure out an idea, that I think will work. I could just fill the array with empty lines up to 25 if necessary.
Not only do I need the detail line to be of fixed height, I also need to print alternating gray bars on that space. Sort of what's called a "pijama effect". The pijama effect I got to work ok. But since it only prints as many lines are the data source has rows, the rest of the space is not filled with the alternating gray bars.
The idea of filling the array with empty lines is not pleasant. But I suppose that it will work.
BTW - I could not find fr3 samples of invoices anywhere. Can someone point to them?
Thank you,
Reinaldo.
I don't have any sample invoices. But, I have had a need to accomplish something similar using another report system. It was accomplished using report design concepts basic to all report systems, specifically detail bands and grouping.
I attached 3 examples (PDF files) to show how it can be done.
I mean - no matter of how many rows I get from ADOQuery I can print no more 7 lines (rows) per each page.
And if you find those examples interesting then you may follow my solution included in FR file below.
Mick
Thank you for helping. Unfortunately I can't download from any of the links. Would you please email them as attachment? I'd love to look at them.
reinaldo dot crespo at gmail dot com
thank you very much,
Reinaldo.
Mick
I'm sorry I never responded. Yes I did. I studied your solution to finally come up with a similar one. Thank you very much.
Basically, what I did is to detach the detail band from the data source and assign a fixed number of rows to the detail data band. Then with code, I skipped an internal counter. Something like this:
In the code above, I used memoOnBeforePrint for before print event of all memos on the detail band. The detail band itself executes ItemsOnAfterPrint on the after print event. This idea worked really nice.
Again, thank you for your help.
Reinaldo.
I am also in the same situation.
I Need to print 15 rows in Detail Band. But some times there are 2-3 records in database then it shrinks everything up and does not look good.
Please suggest me what to do, i could not understand from your conversation how you solved your problem.
here is attached my report file.
Thanks,
Balbir
Thank you dear GPI, you saved me and gave me this valueable solution. I was looking for this since long.
Thanks Alot Alot for your help.