News combit Dev Blog

Combine Different Projects into One Print Job

Posted: Thursday, August 20, 2020 | 0 comment(s)
 
This has been another FAQ without a really good answer – how can I get a report with completely different parts like a cover sheet, a table of contents, some tabular reports, some charts and images, then a text block and so on? 

While it has been possible to get to this result using different preview files and combining them into a single preview, this approach isn't as flexible as it could get. And collecting a common table of contents was just impossible that way. List & Label 26 will help with a feature called "combination print" that allows to combine arbitrary projects into one print job.

Usage of this feature is quite simple – you pass the required project files semicolon separated to LlPrintWithBoxStart or – when using one of our componentes – to AutoProjectFile. This feature requires a data provider implementation as data source, i.e. it can be used from .NET, VCL or C++.

Let's do a quick walkthrough. For this sample, I've prepared three reports, a cover sheet, a dashboard and a detail section. The code to get these three in a single print out would simply be:

LL.DataSource = GetMyDataSource();
LL.AutoProjectFile = @"C:\Reports\Cover Sheet.lst;c:\Reports\Dashboard.lst;c:\Reports\Details.lst";
LL.AutoShowSelectFile = false;
LL.Print();

That's it – the setter for AutoProjectFile tells List & Label to print these three reports in a row and the result in the preview then looks like expected:

Combination Print List & Label

There are huge advantages of this approach compared to printing different reports and appending the respective preview files, which would have been the way to achieve a similar result before:

  • Incremental display of preview during the print just like a "normal" report
  • Support for progress just like a "normal" report
  • Report-spanning page count, including correct TotalPages$ counter: This was not easily possible before for combined reports and required a time consuming two pass approach.
  • Report-spanning table of contents and index: Simply add a table of contents or index project to the list of projects to be printed. This was impossible before.

In order to add even more flexibility. there's also a callback/event ("NextCombinationPrintStep" or LL_NTFY_COMBINATIONPRINTSTEP) whenever the next project triggers which gives you the current project's index and full path. This can then be used to adapt options, add additional data etc. as required. 
 

Discover more new Features in List & Label 26:
Powerful, Reusable Sub-Reports
New Drag & Drop Features for the Table




Author: Jochen Bartlau
Head of Development List & Label

Jochen Bartlau leads the development at combit as Managing Director. He's a Microsoft .NET enthusiast driving innovation & agile project management. The mobile devices geek who used to be a physicist in his first life loves to spend his spare time with his family.


  

RSS
combit Development BlogRSS
What’s this blog for?
A place to share updates about the ongoing development of our products. General musings on the software industry included.
Archive
April 2021 (1)
March 2021 (1)
February 2021 (2)
January 2021 (1)
December 2020 (2)
November 2020 (1)
October 2020 (2)
September 2020 (1)
August 2020 (2)
July 2020 (1)
June 2020 (1)
May 2020 (2)
April 2020 (2)
March 2020 (2)
February 2020 (1)
January 2020 (1)
December 2019 (1)
November 2019 (2)
October 2019 (2)
September 2019 (2)
August 2019 (2)
July 2019 (2)
June 2019 (2)
May 2019 (1)
April 2019 (0)
April 2019 (1)
March 2019 (1)
February 2019 (1)
January 2019 (1)
December 2018 (1)
November 2018 (2)
October 2018 (4)
September 2018 (4)
August 2018 (2)
July 2018 (2)
June 2018 (2)
May 2018 (1)
April 2018 (1)
March 2018 (1)
February 2018 (2)
January 2018 (1)
December 2017 (1)
November 2017 (2)
October 2017 (3)
September 2017 (3)
August 2017 (2)
July 2017 (2)
June 2017 (1)
May 2017 (2)
April 2017 (1)
March 2017 (1)
February 2017 (1)
January 2017 (2)
December 2016 (1)
November 2016 (1)
October 2016 (4)
September 2016 (5)
August 2016 (2)
July 2016 (2)
June 2016 (3)
May 2016 (2)
April 2016 (3)
March 2016 (3)
February 2016 (1)
January 2016 (2)
December 2015 (2)
November 2015 (1)
October 2015 (4)
September 2015 (5)
August 2015 (2)
July 2015 (2)
June 2015 (2)
May 2015 (1)
April 2015 (2)
March 2015 (1)
February 2015 (1)
January 2015 (1)
December 2014 (2)
November 2014 (1)
October 2014 (1)
September 2014 (2)
August 2014 (1)
July 2014 (2)
June 2014 (1)
May 2014 (2)
April 2014 (1)
March 2014 (2)
+1 800 256 3608 (toll-free North America only)