I'm working on reports on Navision 5.0 SP1.
I have created a report that works very well. It's a contacts list. I would like to show two columns per page just like the yellow pages. You see what I mean. But I don't know how to set it up.
Yes, this is possible. We just did this for one of our customers.
This is what we did.
We created an array for each field that needed to be printed in the section.
These arrays were very large, we used an arraysize of 9000.
Then we filled the array by reading the table for all records within the filterset.
What you will have to figure out is how many lines you can print on a page. And you need to keep track of how many lines you have printed, how many lines you need for 1 record and how many complete records will fit in 1 column on your page.
We then created an integer and printed the array using the "Number" variable from the integer table.
The range for your number will be SETRANGE(Number,1,ROUND((rec.Count / 2),1,'>')).
For your first column you can read the array with the Number variable as the Index. For the second column you add the Maximum number of records to print per page to the index. So if you can print let's say 63 lines on the page and you need 3 lines for the header and 4 lines for each record plus 1 spacer line, the number of records you can print will be (63 -3)/(4 + 1) = 60/5 = 12. So the index for the arrays in the second column will be (Number + 12).
When you go to the next page, make sure that you have added an additional number of records per page to the Number variable to compensate for the second column, in this example it would be 12.
This all works, but it does get tricky at times. We had variable headings and sections prior to the section that needed to be printed this way. If you only print 1 dataitem then it might be an option to force a new page everytime you reach a multiple of the maximum number of complete records per page. This to prevent that records are split over 2 pages.
Let me know if this pointed you in the right direction.
Regards,
Willy
Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
Comments
Take a look at the code and sections the wizard has created.
Try to do the same on your report.
exemple :
PAGE 1
record 1 record 2
record 3 record 4
PAGE 2
record 5 record 6
record 7 record 8
How can I have it like this (juste like yellow pages) :
PAGE 1
record 1 record 3
record 2 record 4
PAGE 2
record 5 record 7
record 6 record 8
This is what we did.
We created an array for each field that needed to be printed in the section.
These arrays were very large, we used an arraysize of 9000.
Then we filled the array by reading the table for all records within the filterset.
What you will have to figure out is how many lines you can print on a page. And you need to keep track of how many lines you have printed, how many lines you need for 1 record and how many complete records will fit in 1 column on your page.
We then created an integer and printed the array using the "Number" variable from the integer table.
The range for your number will be SETRANGE(Number,1,ROUND((rec.Count / 2),1,'>')).
For your first column you can read the array with the Number variable as the Index. For the second column you add the Maximum number of records to print per page to the index. So if you can print let's say 63 lines on the page and you need 3 lines for the header and 4 lines for each record plus 1 spacer line, the number of records you can print will be (63 -3)/(4 + 1) = 60/5 = 12. So the index for the arrays in the second column will be (Number + 12).
When you go to the next page, make sure that you have added an additional number of records per page to the Number variable to compensate for the second column, in this example it would be 12.
This all works, but it does get tricky at times. We had variable headings and sections prior to the section that needed to be printed this way. If you only print 1 dataitem then it might be an option to force a new page everytime you reach a multiple of the maximum number of complete records per page. This to prevent that records are split over 2 pages.
Let me know if this pointed you in the right direction.
Regards,
Willy