Skip to main content

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>();
parametersm"DocType"] = apInvoice.DocType;
parametersm"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?
 

 

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.

 

 

 


Hi @Leonardo Justiniano Thank you for your suggestions. 


Reply