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!
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
Hi Gaurav, in 2020r1 there is a way to create custom actions without code.
check that one https://www.acumatica.com/blog/vlog-exploring-the-new-workflow-editor-in-acumatica-2020r1/