blogs.bojensen.eu

bloggerier fra bojensen.eu

Some reports in Dynamics AX 2012 do not fit to page properly when printed | ERP Technician

With the release of Microsoft Dynamics AX 2012, the report design and delivery platform changed significantly from the previous version. Reporting has shifted away from native X++ reports designed in MorphX to SSRS reports designed in Visual Studio. While working with AX 2012, some of the new SSRS reports will not render as expected when a hard copy is printed.

Some reports in Dynamics AX 2012 do not fit to page properly when printed | ERP Technician

AX2012 Sales Invoice SSRS Reporting Error identified

 

While working and testing modifications to the Layout of the “Sales Invoice“ report in AX 2012, I have found a rather annoying error with language translation of the SSRS report.

When you are printing a Sales Invoice, the report prints all labels according to the Language set in the Sales Invoice Header. (Found under the Setup Fast Tab).

However there is an error in the class “SalesInvoiceDP”, which is responsible for invoking the SalesInvoiceReport from Reporting Services.

Continue reading

Playing with SSRS report in dynamics ax 2012

 
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();
}

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();
}

 

Playing with SSRS report in dynamics ax 2012 – Amir’s Microsoft Dynamics Ax Space – AX Technical Blogs – Microsoft Dynamics Community

Ax 2012 Deploy reports through code « Shashi’s Ax.Net Space

These lines deploys SSRS Reports with X++ Code – Remember not to run this code in CIL or you will get runtime error.

SRSReportManager srsRptMgr = new SRSReportManager();
SSRSReportConceptNode node = new SSRSReportConceptNode();

node = TreeNode::findNode(@"\\SSRS Reports\Reports\SalesInvoice");

srsRptMgr.deploymentStart();
srsRptMgr.deployReport(node);
srsRptMgr.deploymentEnd();

 

Ax 2012 Deploy reports through code « Shashi’s Ax.Net Space

How to loop through a Map in AX 2012

 

Map iim = new Map(Types::Integer, Types::Class);
MapIterator it;
// Add some elements into the map
iim.insert(1, new query());
iim.insert(2, new query());
iim.insert(4, new query());

// Create a map
iterator it = new MapIterator (iim);

// Print "[int -> class] iterator"
print it.definitionString();

// Go on for as long as elements are found in the map
while (it.more())
{
  // Print each key (1, 2, 4)
  print it.key();

  // Print text representation of each value
  print it.value().toString();

  // Fetch next element in map
  it.next();
}
pause;

MapIterator Class [AX 2012]