Skip to main content
Solved

How can I programmatically combine reports with different orientations?

  • December 30, 2021
  • 4 replies
  • 551 views

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

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

View original
Did this topic help you find an answer to your question?

4 replies

Hughes Beausejour
Acumatica Employee
Forum|alt.badge.img+2
  • Acumatica Developer Support Team
  • 91 replies
  • 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+13
  • Author
  • 1712 replies
  • 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
  • 715 replies
  • January 2, 2022

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


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

@ChandrasekharM - I can confirm this does NOT work.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings