2014 Dec 12 3:47 PM
In the main window of my smartform I have to print a table consisting of Vendors and their Batches and Batch Description. Now one Vendor can have multiple Batches and the requirement is to print the Vendor in the first column ONLY ONCE and then have all the batches and the description against that vendor in new rows under the Batch Column.I have achieved this part with help of the event on Sort Begin of of the smartform table and it is working fine for one page.
However the issue arises when the Number of Vendors are large and the data flows to the second page. For the second page I can not use the command window to explicitly break to the new page coz the description column is of varying length and often span to multiple lines within the same row. But since the table itself is in the Main window I dont even have to explicitly use the command node and the data flows to the second page.
The issue here is that since I have said the Vendor should be printed only once and on Begin of new Vendor the Smartform prints it only once as desired. What happens due to this is that the last Vendor on first page is printed and few batches are printed against it on first page and the rest of the batches on page 2 but on second page the Vendor is not printed and the second page data in itself doesnt make any meaningful reading as it doesnt have the vendor number and it appears like this.
Page 1
Vendor | Batch | Description |
---|---|---|
Vendor 1 | Batch 1 | Batch Text 1 |
Batch 2 | Batch Text 2 | |
Batch 3 | Batch Text 3 | |
Vendor 2 | Batch 4 | Batch text 4 |
Batch 5 | Batch text 5 |
Page 2
Header 1 | Header 2 | Header 3 |
---|---|---|
Batch 6 | Batch text 6 | |
Vendor 3 | Batch 7 | Batch text 7 |
Batch 8 | Batch text 8 |
Now anyone viewing only page 2 of above example gets the impression that Batch 6 belongs to Vendor 3 but where as in reality it belongs to Vendor 2.
So the requirement is that the vendor should still get printed only once but if page break occurs while printing the batches of the same vendor then the Vendor should be printed on second page too. Also here I can not use folders and page protection coz some vendors have 30-40 batches and can span to 3 pages too. So am actually on my wits ends
Any Idea on how to achieve this?
2014 Dec 12 5:49 PM
I don't think you could do that in any way vía settting.
You can do it writting you own logic.
1- Saving the last printed vendor and the value showed in an auxiliar variable, so if it remains the same you clear the values printed if not you put the new vendor value in the auxiliar.
2- The new page problem, like before save the page, so you know where you are. In the first row (the first time set the page) so you now have and exception, if the value of the vendor remains the same BUT the auxiliar variable with the page is not equal to the actual page then pass the value. Update the auxiliar variable with the new page.
I hope you understand the point... My english is a little rusty.
Regards