The solution is an automated multi-pass printing. We made sure to make this as flexible as possible. You can decide to show the passes in the result, which enables similar things like the issue printing. However, this time offering full flexibility and not being restricted to just showing or hiding objects. You can also hide passes, e.g. all except the last, and work with SetVar() and GetVar() to talk to your future self. Sounds crazy? Let’s dive into it.
Example: Page References
As an example, let’s take a sales report for which we’ll add a management summary. The (hypothetic) report consists of a cover sheet with a management summary and two pages of charts. The challenge is to reference the page numbers of the charts in the summary. The basic layout looks like this:
The solution now is simple. Just add a SetVar to the headline of the respective charts, e.g. like this:
"Sales by customers"+SetVar("Reference.Chart1", Page$(), false)
SetVar is a powerful function that allows to store arbitrary values for future reference. The first parameter can be named arbitrarily. Setting the third parameter to “false” makes sure nothing is actually printed. In the “Summary” object, we can then reference this variable like this:
Now all we have to do is to set the pass count to 2. This will result in SetVar() being called before the actually visible GetVar() in pass two, even though the GetVar() is printed first. This way, we get the required page references:
Example: Flexible Copies
List & Label already supports a kind of similar feature – printing multiple issues. If you set the issue count e.g. to two, you’ll get a copy of the original print but can add a “Display Condition for Issue Print” to an object. The cool part is, this will just need one pass and still allow to show or hide certain objects in the copy. However, this is the only thing you can do – the copy is identical in every other means. A typical usage for issue printing is e.g. printing a “Copy” watermark on an invoice.
If you need more flexibility, the passes are here for the rescue. The origin of this feature comes from Idea Place, our portal for user innovation. As an example, let’s have a combined invoice and delivery note print. While they’re quite similar, you need somewhat different informations on the slip.
Let’s change the header from “Invoice” to Delivery Note” for the second pass. It’s simple:
Cond(PrintPassIndex()==1, "Invoice", "Delivery Note")
This reads “if we’re in the first pass, print “Invoice”, otherwise print “Delivery Note”. As for the item table itself, it’s easier to add an entire new table to the report container and adjust the appearance conditions:
For this example I just copied the invoice table but removed all prices for the delivery note. Here’s the result in a side-by-side-view:
Internally, this feature makes use of the combination print feature that’s also new in List & Label 26. Thus, it has the same requirements – a DataProvider implementation which is available for .NET, VCL and C++.
I’m looking forward very much to seeing what else this feature will be used for – it’s an all-purpose-answer for many requests we’ve received in the past.