Solved

How can I programmatically combine reports with different orientations?

  • 30 December 2021
  • 4 replies
  • 60 views

I am using the following code to combine two reports programmatically:

public PXAction<BAccount> Print1099Reports;
[PXButton(CommitChanges = true, Category = "Actions")]
[PXUIField(DisplayName = "Print 1099 Cover", )]
protected virtual void print1099Reports()
{
var reportParams = new Dictionary<string, string>();
string bAccountID = Base.CurrentBAccount.Current.AcctCD;
reportParams.Add("BAccount.BAccount", bAccountID);

PXReportRequiredException ex = null;
ex = PXReportRequiredException.CombineReport(ex, "ZRLTTX03", reportParams, false);
ex = PXReportRequiredException.CombineReport(ex, "ZRLTTX04", reportParams, false);

if (ex != null)
{
ex.Mode = PXBaseRedirectException.WindowMode.New;
throw ex;
}
}

However, the reports have different portrait/landscape orientation, and this is not taken into account.

 

Is this possible, and if not, when will it be?

icon

Best answer by Hughes Beausejour 30 December 2021, 17:07

View original

4 replies

Userlevel 5
Badge

To my knowledge, this is not possible because Acumatica renders report with a single page settings object. You can create a feature request for it here: Ideas | Community (acumatica.com)

 

Alternatively you can try rolling your own if you render Acumatica report to PDF file.

Get PDF file from Report using Code - Acumatica Developers Blog


And combine the output PDF file with a third party PDF library.

Merging multiple PDFs using iTextSharp in c#.net - Stack Overflow
c# - Merging PDFs with different orientations with iTextSharp - Stack Overflow

Not the answer I wanted, but it is what I expected. Thank you.

 

The feature request is here: Render reports with different page orientations

Userlevel 6
Badge +4

Hi @Deetz  and @Hughes Beausejour , Did you try with sub reports? 

@ChandrasekharM - I can confirm this does NOT work.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2020  Acumatica, Inc. All rights reserved