Skip to main content
Answer

How can I programmatically combine reports with different orientations?

  • December 30, 2021
  • 9 replies
  • 685 views

darylbowman
Captain II
Forum|alt.badge.img+15

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?

Best answer by Hughes Beausejour

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

9 replies

Hughes Beausejour
Acumatica Employee
Forum|alt.badge.img+2
  • Acumatica Developer Support Team
  • Answer
  • December 30, 2021

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


darylbowman
Captain II
Forum|alt.badge.img+15
  • Author
  • December 30, 2021

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

 

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


Forum|alt.badge.img+8
  • Semi-Pro I
  • January 2, 2022

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


darylbowman
Captain II
Forum|alt.badge.img+15
  • Author
  • January 3, 2022

@ChandrasekharM - I can confirm this does NOT work.


  • Freshman I
  • September 4, 2025

Hi, ​@darylbowman is there any workaround or solution to this issue?


darylbowman
Captain II
Forum|alt.badge.img+15
  • Author
  • September 4, 2025

Not a great one. If you're printing them, you can send one after the other to the printer and make it feel like a single job, but if you're viewing them, not so much.


  • Freshman I
  • September 4, 2025

Thank you ​@darylbowman  for clarifying! That makes sense — I’ll try the printing workaround. Appreciate the quick response.


  • Freshman I
  • September 4, 2025

@darylbowman I just wanted to clarify: is there any way to print the two reports in two different tabs—in other words, can we throw two separate PXReportRequiredException instances in a single action call?


darylbowman
Captain II
Forum|alt.badge.img+15
  • Author
  • September 4, 2025

I'm not actually sure. Maybe you could from within two separate PXLongOperations.

 

I was talking about sending two DeviceHub jobs one after the other.