Open a Report in Acumatica

Hi All,

Following a previous post about redirection architecture I want to show you an example of how can you use it to open a report.

Here we need to use PXReportRequiredException, as it designed to open reports. But also we need to provide a report name and report parameters.

  • Report Name is just a Screen ID that you can find in the sitemap
  • Report Parameters is a Dictionary<string, string> that is basically a key-value pair. Key is a parameter name and value is a value. Parameter names are taken directly from the report.

Here is the example code to create a button for report. I get this code from Receipt Screen in Inventory Module.

public PXAction<INRegister> iNEdit;
[PXUIField(DisplayName = Messages.INEditDetails, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXLookupButton]
public virtual void INEdit()
{
      if (receipt.Current != null)
      {
            // create the parameter for report
            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters["DocType"] = receipt.Current.DocType;
            parameters["RefNbr"] = receipt.Current.RefNbr;
            parameters["PeriodTo"] = null;
            parameters["PeriodFrom"] = null;
            
            // using Report Required Exception to call the report
            throw new PXReportRequiredException(parameters, "IN611000", Messages.INEditDetails);
      }
}

Hope it helps!

6 Replies to “Open a Report in Acumatica”

  1. Hi Sergey,

    I want to show table structure in Acumatica reports.
    This table structure is saving in our database table in html string format. (using RichTextBox control)

    Could you please suggest me some solution?

    Thanks,
    Gaurav Katiyar

  2. Hi Sergey,

    I want to show table structure in Acumatica reports.
    This table structure is saving in our database table in html string format.

    Could you please suggest me suggestion ?

    Thanks,
    Gaurav Katiyar

  3. Hi Sergey,

    How can i add my report into existing Action without writing a code.
    i.e. Vendor want to add his report into the Action of our page.

    Can he do this without package deployment ?

    Thanks & Regards,
    Gaurav Katiyar

Leave a Reply

Your email address will not be published. Required fields are marked *