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.

Tuesday, December 17, 2013

Create Var layer Visual studio

right click edit Visual studio short cut
paste the following link, edit correct path link.

"E:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /AxConfig C:\VAR_INCEIF_STG_FINAL.axc
pause

Open Client auto clash

go to C:\Users\sj.lee(UserName)\AppData\Local

delete all file name start with ax_...

Deploy all report

Open Windows PowerShell as an administrator by following these steps:

1. Click Start > Administrative Tools.

2. Right-click the Microsoft Dynamics AX 2012 Management Shell option.

3. Click Run as administrator.

4. To deploy a specific report, enter the name of the report. For example, to deploy the CustTransList report, enter the following command:

Publish-AXReport -ReportName CustTransList

5. To deploy two or more specific reports, enter the names of the reports. For example, to deploy the CustTransList and CustTransOpenPerDate reports,
   enter the following command:

Publish-AXReport -ReportName CustTransList, CustTransOpenPerDate


6. To deploy all reports, enter the following command:

Publish-AXReport ReportName *

Duplicate Object

Duplicate type with name 'Dynamics.Ax.application.<My Object Name>' in assembly
'Dynamics.Ax.application, version=6.0.947.280, culture...

You can try the solution:
1. import twice the object, second time system will prompt you object exist, overwrite it? click Yes to all.
2. Full CIL