public static void print_skilt(ItemId ID)
{
SrsReportRunController controller;
controller = new SrsReportRunController();
controller.parmLoadFromSysLastValue(false);
controller.parmReportName("mi_prisskilt.a5"); //name of report to print
controller.parmReportContract().parmPrintSettings().landscape(true);
controller.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File);
controller.parmReportContract().parmPrintSettings().fileFormat(SRSReportFileFormat::PDF);
controller.parmReportContract().parmPrintSettings().overwriteFile(true);
controller.parmReportContract().parmPrintSettings().fileName(strFmt("\\\\shop3\\AxaptaPDF\\P%1.pdf",ID)); //filename to print pdf to
controller.parmReportContract().parmPrintSettings().fromPage(1);
controller.parmReportContract().parmPrintSettings().toPage(1);
controller.parmReportContract().parmRdlContract().setValue("mi_prisskilt_ItemId",ID); //parameters to send to report
controller.runReport();
}
{
SrsReportRunController controller;
controller = new SrsReportRunController();
controller.parmLoadFromSysLastValue(false);
controller.parmReportName("mi_prisskilt.a5"); //name of report to print
controller.parmReportContract().parmPrintSettings().landscape(true);
controller.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File);
controller.parmReportContract().parmPrintSettings().fileFormat(SRSReportFileFormat::PDF);
controller.parmReportContract().parmPrintSettings().overwriteFile(true);
controller.parmReportContract().parmPrintSettings().fileName(strFmt("\\\\shop3\\AxaptaPDF\\P%1.pdf",ID)); //filename to print pdf to
controller.parmReportContract().parmPrintSettings().fromPage(1);
controller.parmReportContract().parmPrintSettings().toPage(1);
controller.parmReportContract().parmRdlContract().setValue("mi_prisskilt_ItemId",ID); //parameters to send to report
controller.runReport();
}
Hello ,
ReplyDeleteCan you specify what exactly "ItemId ID" is in this code?
I have seen the same code at various places, but still not able to execute my report with parameter. Without passing parameter's it's working fine but with parameter it's not working.
I am always getting the below error.
ReplyDeleteMicrosoft.Dynamics.AX.ManagedInterop.ErrorException: Parameter CustListReportDS_DynamicParameter does not exist.