This is a migrated thread and some comments may be shown as answers.

Invoice with shipping label(s) (different # of pages)

5 Answers 177 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 07 Nov 2016, 09:25 PM

TLDR - Is there a way to set the minimum number of pages for a report to print on, just so that the page header and footer will print a known number of times?

More detail:  I've got an issue in that I have two distinct sets of data to integrate into one report.  One is a list of invoice lines, and one is a list of shipping labels, both to be printed on the same page(s).

The simplest solution I have that is almost workable is to put a picture box in the page footer.  I have set the image URL to: = ReportItem.Report.ItemDefinition.Transaction.OrderNumber + "-" + PageNumber + ".png".  If there is only one shipping label and one page worth of transaction lines, then it will work fine.  If by some stroke of luck there are two shipping labels and two pages of transaction lines, then it will also work.  In most other cases, the user will get one shipping label and will have to open up the shipping software to "reprint" the other labels.  This isn't the worst thing in the world, because the vast majority of the orders they ship have exactly one shipping label, and just combining the shipping label and invoice/packing slip onto one page is a huge improvement in their workflow.  Is there, by chance, a way to specify a minimum number of pages for the report?  If so, I could programmatically set the number of pages equal to the number of shipping labels.  There will be some pages with no invoice lines printed, but the report would happily reprint the page header and footer and it would work perfectly for my purposes.

Alternately, if someone would like to enlighten me on the actual proper way to do this (a report with two sets of data with different page count requirements), I'd be happy to hear it.  However, it would be much easier if I could just set the minimum number of pages...

5 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 09 Nov 2016, 05:23 PM
Hi Chris,

Please post screenshots illustrating the layout you want to achieve. Include details which portion of the document will be fed by the first data source , which by the second, and where page numbers should appear.

In general, setting the number of pages is not supported. the report template is developed for the assigned data, processed and rendered as a continuous content, and finally it is paged based on the report's PageSettings properties.
Please check how each section will appear in the document - Report Structure. You can display data from different data sources by using a Table item or SubReport loading another report. Other approach to gather different content into one document is to create a ReportBook, where each report can have individual page settings and paging.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 09 Nov 2016, 06:39 PM

jpg attached.

 

Basically, I have two data sources - the number of objects in each data source is unrelated, and neither is a child object of the other.  There may be 12 invoice lines, and those might require 2 pages to display.  There may also be 3 shipping labels (necessarily requiring 3 pages to display).  In the example image, the invoice lines stretch across 2 pages (I only included the first page), so the hacked-together way I've used of displaying shipping labels is able to print 2 shipping labels, one on each page.

 

I have read the Report Structure documentation, and maybe I am misunderstanding it, but... "This section is printed once for every row in the data source."  I don't see how to rectify that with including a SubReport or a List/Table that is independent data from the first data source.

0
Stef
Telerik team
answered on 10 Nov 2016, 05:32 PM
Hi Chris,

I should say I still do not understand the scenario and the expected layout. Please elaborate how data should be visualized in the document and mark each different set of data on the page in the screenshot:
  1. Post the two data sets;
  2. Post the settings of the data items which will visualize each data set;
  3. Post and image of the expected final look of the document with marks where each data set starts and ends.
  4. Post details about the problem.

If you prefer, open a support ticket and send us the designed report(s) to check their settings, including the above requested details.


About the Report Structure:
  • when you bind data to the report's DataSource, a Detail section is produced for each record in the data set.
  • When you add a grouping by field, a group of Detail section is surrounded by GroupHeader|FooerSection.
  • Group sections have the ability to be printed on each physical page (PrintOnEveryPage) or at the bottom of the page (PrintAtBottom for the footer section).
  • Report sections can also add page breaks in the content.

There are various layouts which can be achieved.


Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 11 Nov 2016, 05:11 PM

It's really not that complicated.  I was wondering why you requested a screenshot, since I don't think a screenshot says any more than a description.  Let's see if this helps...

Each page is laid out like this:

- Header section -

- Detail lines (some # of lines, might need multiple pages) - 

- Shipping labels (some # of labels, one label per page, the number of labels is not necessarily related to the number of detail lines) -

(The physical paper has a peel-off sticker where the shipping label will have to print.)

 

I can fit somewhere around 5-10 detail lines on one page in the space reserved for detail lines (sometimes the detail lines are actually two grid rows, so that's why there's a range).  So IF there are around 12 lines of detail and 2 shipping labels, then the 12 lines of detail require 2 pages and the 2 shipping labels require 2 pages, and defining the footer-section picturebox value as ordernumber-pg#.png works.  But if there are 12 lines of detail and 3 shipping labels, then the report only prints 2 pages.  The third shipping label doesn't print because there's no 3rd page.

For what it's worth, I have in the last couple of days found a workaround for this (I determine how many pages in the exported pdf, and if the pagecount is less than the number of labels, then I create a second report with no invoice lines that just has shipping labels, then print both reports).  But it feels like there should be a RIGHT way to do this and this way doesn't feel like the right way.  If you know the right way to do it, please let me know, but if not, then I will go forward with my workaround.  Thanks.

 

0
Stef
Telerik team
answered on 16 Nov 2016, 04:57 PM
Hi Chris,

The problem is that I cannot get the idea where content is must be printed. If shipping labels are part of the report at all, or they are printed on the back of each produced page by other means.

Let assume you have two data sources:
  1. DetailLines collection of records;
  2. ShippingLables collection of records;

Records from DetailLines must be printed on uneven page numbers (front page), and an element from the ShippingLabels collection must be printed on each even page number (the back of the page).
Having into account data sources are not related, it is hard to say that there is a right way.


A custom approach I can suggest you:
  1. Create a relation between data sources e.g. make one element of the ShippingLabels to relate to let say 5 records (or the number gathering on a page) of the Detaillines collection
  2. Add a grouping by a field of the ShippingLabels collection - this will produce a GroupHeaderSection and GroupFooterSection per element of the ShippingLabels collection. So far, we ensure a number of pages enough to print the required shipping labels;
  3. Make the GroupFooterSection Height equal the physical space defined by the report's PageSettings properties (PaperKind, PaperSize, Margins, Landscape). We want the GroupFooterSection to be printed on its own page.
  4. Add a Table item in the Detail section and make it load the related DetailLines elements.
  5. Set the GroupHeaderSection.Visible property to false.


The attached video illustrates the above suggestion and the result. the video is a SWF file that can be previewed in IE browser. You can find attached also the demo TRDP file that can be previewed in the Standalone Report Designer or R3 2016 SP1.


On a side note, report section support page breaks which allows you to make new pages, if needed - Conditional Page Breaks.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Stef
Telerik team
Chris
Top achievements
Rank 1
Share this question
or