Solved

Generate "Check Form with Remittance" Report(ap641000.rpx) Programmatically

  • 26 July 2023
  • 2 replies
  • 92 views

Userlevel 4
Badge +1

Hi all,

 

I want to generate “Check form with remittance”(ap641000.rpx) Report Programmatically. But in the usual way, I was unable to do that as it has no key parameters. 

Schema Builder of the report - Parameters Tab

I used to do report generation in the following way. But I can not apply this approach here as there are no key parameters here. Is there any alternative approach of doing this?

Dictionary<String, String> parameters = new Dictionary<String, String>();
parameters["DocType"] = apInvoice.DocType;
parameters["RefNbr"] = apInvoice.RefNbr;

//Report Processing
PXReportSettings settings = new PXReportSettings("MA105000");

PX.Reports.Controls.Report report = ReportLoader.CheckIfNull(nameof(ReportLoader)).LoadReport("MA105000", null);
ReportLoader.InitReportParameters(report, parameters, settings, false);

PX.Reports.Data.ReportNode reportNode = ReportDataBinder.CheckIfNull(nameof(ReportDataBinder)).ProcessReportDataBinding(report);

byte[] data = PX.Reports.Mail.Message.GenerateReport(reportNode, RenderType.FilterPdf).First();

string filename = "Test Report";

PX.SM.FileInfo file = new PX.SM.FileInfo(filename, null, data);

 

Additionally, there are few filters as below. But how can we pass values there?
 

 

icon

Best answer by Leonardo Justiniano 29 July 2023, 21:23

View original

2 replies

Userlevel 4
Badge +1

Hi @Leonardo Justiniano Thank you for your suggestions. 

Userlevel 6
Badge +4

Hi @charithalakshan49 

Report implementation is low level stuff in Acumatica and the filtering you are asking to access has no evident references.

I see 2 possible options:

  • Modify the report (A copy with another ID) and add the parameters and filtering you need (I would do this one)
  • Work with result sets compatible with the entities of the report. You have the option to generate the records in code and pass them to the report.

 

 

 

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 — 2024  Acumatica, Inc. All rights reserved