Thursday, January 23, 2014

How to save the SSRS report to PDF/HTML through code in dynamics ax 2012.

SrsReportRun srsReportRun; srsReportRun = new SrsReportRun("InventTruckTransactionReport.PrecisionDesign1"); srsReportRun.init(); srsReportRun.reportCaption("InventTruckTransactionReport.PrecisionDesign1"); srsReportRun.reportParameter("TruckTransDS_JournalId").value("000161_070"); srsReportRun.showDialog(false); // Print to a file named ReportExample in HTML/PDF format. srsReportRun.printDestinationSettings().printMediumType(SRSPrintMediumType::File); srsReportRun.printDestinationSettings().fileFormat(SRSReportFileFormat::PDF); srsReportRun.printDestinationSettings().overwriteFile(true); srsReportRun.printDestinationSettings().fileName(@"C:\InventTruckTransactionReport.pdf"); if( srsReportRun ) { srsReportRun.executeReport(); }

How to print the SSRS report in dynamics ax 2012 from code.

SrsReportRun srsReportRun; // initiate the report. srsReportRun = new SrsReportRun ("InventTruckTransactionReport.PrecisionDesign1"); srsReportRun.init(); srsReportRun.reportCaption("InventTruckTransactionReport.PrecisionDesign1"); // set parameters name, value. srsReportRun.reportParameter("TruckTransDS_JournalId").value("000161_070"); // suppress the dialog srsReportRun.showDialog(false); if( srsReportRun ) { // run the report srsReportRun.executeReport(); }

Wednesday, January 15, 2014

DMF Error During Import

DMF Error During Import. System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (502) Bad Gateway. ---> System.Net.WebException: The remote server returned an error: (502) Bad Gateway. at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) --- End of inner exception stack trace --- Makesure the LAN SETTING of INTERNET CONNECTION is not hijacked or override by third party software, e.g. hotspot shield.