我正在尝试使用 x++ 2012 通过代码打印 pdf 格式的报告。该报告是银行调节摘要。我现在所做的是:
#define.ParamCheckingDate ('CheckingDate')
#define.ParamSummary ('ReconciliationSummary')
#define.ParamClearedDetails ('ClearedTransactionDetails')
#define.ParamUnclearedDetails ('UnClearedTransactionDetails')
SrsReportRunController controller = new BankReconciliationSummaryController();
SRSPrintDestinationSettings settings;
BankReconciliationSummaryRdlContract rdlContract;
controller.parmReportName("BankReconciliationSummary.Report");
controller.parmExecutionMode(SysOperationExecutionMode::ScheduledBatch);
controller.parmShowDialog(false);
rdlContract.setValue(#ParamCheckingDate,mkDate(27,05,2024));
rdlContract.setValue(#ParamClearedDetails,true);
rdlContract.setValue(#ParamSummary,true);
rdlContract.setValue(#ParamUnclearedDetails,false);
controller.parmReportContract().parmRdpContract(rdlContract);
settings = controller.parmReportContract().parmPrintSettings();
settings.printMediumType(SRSPrintMediumType::File);
settings.fileFormat(SRSReportFileFormat::PDF);
settings.fileName(@'C:\Users\spineda\Desktop\reporteTest.pdf');
controller.startOperation();
我现在面临的问题是合约类是私有的,它不允许我设置参数的值。已经有一种打印报告的方法,我正在尝试通过代码复制它。我想要的是通过代码设置参数和路径。过程是:
为什么不能设置值?下面的代码对我有用 -
rdlContract = controller.getDataContractObject(); // Add this line
rdlContract.setValue(#ParamCheckingDate, myDateTime);
rdlContract.setValue(#ParamClearedDetails,true);
rdlContract.setValue(#ParamSummary,true);
rdlContract.setValue(#ParamUnclearedDetails,false);
// controller.parmReportContract().parmRdpContract(rdlContract); // Comment out
奇怪的是,由于
\C\BankReconciliationSummaryUIBuilder\getParameterSavedValues
/date
的存储/转换方式存在问题,我不得不调整 utcDateTime
。