Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Monday, September 23, 2013

Job to save the SSRS in PDF at given location in Dynamic AX

Hi,
static void SaveSSRSasPdfCode(Args _args)
{
     SrsReportRun srsReportRun;

    srsReportRun = new SrsReportRun("ReportName.PrecisionDesign1");

    srsReportRun.init();
    srsReportRun.reportCaption("ReportName.PrecisionDesign1");
    //Parameter to be passed
    srsReportRun.reportParameter("TableNameused").value("Parameter");
    srsReportRun.showDialog(false);

    // Print to a file as ur name and location in HTML/PDF format.
    srsReportRun.printDestinationSettings().printMediumType(SRSPrintMediumType::File);
    srsReportRun.printDestinationSettings().fileFormat(SRSReportFileFormat::PDF);
    srsReportRun.printDestinationSettings().overwriteFile(true);
    srsReportRun.printDestinationSettings().fileName(@"C:\UrReportName.pdf");

    if( srsReportRun )
    {
        srsReportRun.executeReport();
    }
}

Sunday, September 22, 2013

Job to run reports without knowing the used class names in Dynamic AX

static void PrintSSRSthroughCode(Args _args)
{
    SrsReportRun srsReportRun;
    srsReportRun = new SrsReportRun ("ReportName.PrecisionDesign1");
    srsReportRun.init();
    srsReportRun.reportCaption("ReportName.PrecisionDesign1");
    // set parameters
    srsReportRun.reportParameter("TableName").value("Parameter");
    // Dialog for failure (if)
    srsReportRun.showDialog(false);
    if( srsReportRun )
    {
             srsReportRun.executeReport();
    }
}

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...