Good morning.
In our software we have the possibility, for each "Supplier order", to add some attachments (eg. jpeg images).
We need to print, in the same report, the "Supplier order" and, after that, the attachments (images, one for each page).
Actually we print 2 separated reports, one for the order and one for the attachments; our need is to print them in a single report.
Please note that in the data source we may have different orders and, for each one, their attachments. So there must be a new page before any new order (and before any attachment).
The order page is formed by an header, the body, and a footer: the footer is printed only on last page of the order. Then, after the order, we must have the attachments images (one for each page). At the end of the attachments there must be a new page and, after that, must begin the next order (header, body, footer, then the attachments of the order). At each order the page number must be reset.
Example:
Header order 1 (page 1)
Body order 1
- page break
Header order 1 (page 2)
Body order 1
Footer order 1 (totals)
- page break
Image of attachment 1 of order 1
- page breask
Image of attachment 2 of order 1
- page break
Header order 2 (page 1)
Body order 2
...and so on.
May you kindly give me an advice about design and how to structure dataset dictionary?
Thank you.
Advice about design of "Supplier order" with attachments
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Re: Advice about design of "Supplier order" with attachments
Hello,
Please send us a sample reports with test data for analysis.
Also please try to use the SubReport component for this task.
Thank you.
Please send us a sample reports with test data for analysis.
Also please try to use the SubReport component for this task.
Thank you.
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Re: Advice about design of "Supplier order" with attachments
Good morning. I have done some test, and I think I have solved, so now I write below the result, for future references.
I assume that in the data source I have only one supplier order: this is different from my original requirements, that possibly had more orders in the datasource, but actually is not a problem for us, but this may have been a problem in the design, so for us it's actually ok to have only one order in the datasource.
Given an already existing designed "Supplier order" report with the following structure (as reported in the original post) and given that the order is long so I have many pages (eg. 2):
Order header (page 1)
Order body (page 1)
- page break
Order header (page 2)
Order body (page 2)
Order footer (page 2, with totals)
The data source has one record in the order header table and many records in the order body table (with relation between them), the necessity was to print after the "Supplier order" some images that comes from another related table.
The task was accomplished as follows.
In the data source we have added a third table (say "DataDocumentiAllegati") containing the images to print after the "Supplier order", related to the "Order header" table (which has only one record, containing the order header informations).
Now the modifications to the already designed "Supplier order" report:
- Create a second page, for the images.
- In page properties set "Reset page number=True"
- Create a data band pointing to the images table
- In the databand, design the image field pointing to the image column of the images table
- In the databand, set the properties "New page before=True" and "Can grow=False" ("Can grow=False" is needed else a blank page will be printed after the image, don't know why)
- In the image field, set "Can grow=True" if not setted yet
- If necessary, set a sort order in the databand source (to honour the images sequence coming from the data source)
- In the page, set the condition to not show itself if there are no rows in the images table, expression "Count(DataDocumentiAllegati)==0"
- In report properties set "Pass numbers=Double pass" (else the last page won't be correctly calculated, according to page 837 of StimulReport manual about "IsLastPage")
- In the first page, where I already designed the "Suppliers order", the footer totals must be set with "Print on = Only last page", just in case the "Supplier order" is composed by many pages and the totals must be printed only on last page of the order (that's why we need the "Reset page number" on images page and the double pass setting).
This way, I obtained the "Supplier order" printed with its totals in the last order page and then the images printed in the subsequent pages.
I've attached here the designed report, for future references.
As said above, the only limitation is that in the dataset I must have only one supplier order, actually my designed report doesn't support more supplier orders.
Thank you.
I assume that in the data source I have only one supplier order: this is different from my original requirements, that possibly had more orders in the datasource, but actually is not a problem for us, but this may have been a problem in the design, so for us it's actually ok to have only one order in the datasource.
Given an already existing designed "Supplier order" report with the following structure (as reported in the original post) and given that the order is long so I have many pages (eg. 2):
Order header (page 1)
Order body (page 1)
- page break
Order header (page 2)
Order body (page 2)
Order footer (page 2, with totals)
The data source has one record in the order header table and many records in the order body table (with relation between them), the necessity was to print after the "Supplier order" some images that comes from another related table.
The task was accomplished as follows.
In the data source we have added a third table (say "DataDocumentiAllegati") containing the images to print after the "Supplier order", related to the "Order header" table (which has only one record, containing the order header informations).
Now the modifications to the already designed "Supplier order" report:
- Create a second page, for the images.
- In page properties set "Reset page number=True"
- Create a data band pointing to the images table
- In the databand, design the image field pointing to the image column of the images table
- In the databand, set the properties "New page before=True" and "Can grow=False" ("Can grow=False" is needed else a blank page will be printed after the image, don't know why)
- In the image field, set "Can grow=True" if not setted yet
- If necessary, set a sort order in the databand source (to honour the images sequence coming from the data source)
- In the page, set the condition to not show itself if there are no rows in the images table, expression "Count(DataDocumentiAllegati)==0"
- In report properties set "Pass numbers=Double pass" (else the last page won't be correctly calculated, according to page 837 of StimulReport manual about "IsLastPage")
- In the first page, where I already designed the "Suppliers order", the footer totals must be set with "Print on = Only last page", just in case the "Supplier order" is composed by many pages and the totals must be printed only on last page of the order (that's why we need the "Reset page number" on images page and the double pass setting).
This way, I obtained the "Supplier order" printed with its totals in the last order page and then the images printed in the subsequent pages.
I've attached here the designed report, for future references.
As said above, the only limitation is that in the dataset I must have only one supplier order, actually my designed report doesn't support more supplier orders.
Thank you.
- Attachments
-
- EsempioConAllegati.mrt
- (352.84 KiB) Downloaded 323 times
Re: Advice about design of "Supplier order" with attachments
Hello.
The pages of the report template are rendered separately. At first you see all pages of one page of report temaplte, then all pages from another.
Please, try to avoid using different pages. Try to place the images on the same page of report template.
As we see you didn't set the Relation property for the DataBand1. Please, watch next tutorial video.
Thank you.
The pages of the report template are rendered separately. At first you see all pages of one page of report temaplte, then all pages from another.
Please, try to avoid using different pages. Try to place the images on the same page of report template.
As we see you didn't set the Relation property for the DataBand1. Please, watch next tutorial video.
Thank you.