Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 143529

Dynamics ax and ssrs report automatically print a pdf but suppressing the screen preview

$
0
0

I have the following code which send the delivery note directly to a folder successfully.

However at the moment even though I have set the following

    SalesPackingSlipController.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File);

it still prints to screen.

is there any way to suppress the screen preview?

 static void SR_SaveReportToPDFFromController(Args _args)
{
    SalesPackingSlipController SalesPackingSlipController;
    SalesPackingSlipContract SalesPackingSlipContract;
    salesTable salesTable;
    Args                    args = new Args();
    SrsReportRunImpl        srsReportRun;
    CustPackingSlipJour       CustPackingSlipJour;
    ReportName              reportName = "SalesPackingSlip.Report";   
    str invoiceFileName;


    ;

 select firstOnly CustPackingSlipJour
            where CustPackingSlipJour.SalesId == 'SO011043';
            
    salesTable = SalesTable::find(CustPackingSlipJour.SalesId);
    args.record(CustPackingSlipJour);
    SalesPackingSlipController = new SalesPackingSlipController();
    SalesPackingSlipController.parmReportName(reportName);
    infolog.setInfoLogLevel(SysInfoLogLevel::None);
    SalesPackingSlipContract = SalesPackingSlipController.parmReportContract().parmRdpContract();
    SalesPackingSlipContract.parmRecordId(CustPackingSlipJour.RecId); // Record id must be passed otherwise the report will be empty
    SalesPackingSlipController.parmArgs(args);
    srsReportRun = SalesPackingSlipController.parmReportRun() as SrsReportRunImpl;
    SalesPackingSlipController.run();
    SalesPackingSlipController.parmReportRun(srsReportRun);
    SalesPackingSlipController.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File);
    SalesPackingSlipController.parmReportContract().parmPrintSettings().overwriteFile(true);
    SalesPackingSlipController.parmReportContract().parmPrintSettings().fileFormat(SRSReportFileFormat::PDF);
    invoiceFileName = "AX_" + CustPackingSlipJour.SalesId + ".pdf";       
    SalesPackingSlipController.parmReportContract().parmPrintSettings().fileName('c:\\lori\\' + invoiceFileName);
     SalesPackingSlipController.runReport();
    infolog.setInfoLogLevel(SysInfoLogLevel::All);    

}


Viewing all articles
Browse latest Browse all 143529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>