Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 73760

Export Report is empty on batch job

$
0
0

Hi everyone, I'm having a problem with exporting a report in a batch job.  It works fine when I run the process manually but the report is empty when run in a batch job.  Can't anyone help? 

Thanks in advance!

Here's my code:

   Args = new Args(reportstr(RunRate_UM));

    runrateUm = new ReportRun(Args);

    runrateUm.init(); // added

    printJobSettings = new printJobSettings();

    printJobSettings = runrateUm.printJobSettings(); // added

    runrateUm.query().interactive(false);
    runrateUm.report().interactive(false);

    printJobSettings.setTarget(PrintMedium::File);
    printJobSettings.preferredTarget(PrintMedium::File);

    printJobSettings.Format(PrintFormat::HTML);
    printJobSettings.preferredFileFormat(PrintFormat::HTML);

    session = new session();
    servername = session.AOSName();

    if (servername == 'FFF')
    {
        tempPath = #UMReportPathFox;
    }
    ELSE
    {
        tempPath = #UMReportPathCTU;
    }

    if (isRunningOnServer())
    {
        fileName = tempPath + runrateUm.report().name() + #HTML;
    }
    else
    {
        tempPath =  winApi::getTempPath();
        fileName = tempPath + runrateUm.report().name() + #HTML;
    }


    printJobSettings.fileName(fileName);


    printJobSettings.warnIfFileExists(false);


    runrateUm.unpackPrintJobSettings(printJobSettings.packPrintJobSettings());


    info(runrateUm.printerPrinterName());

    runrateUm.run();


Viewing all articles
Browse latest Browse all 73760

Trending Articles



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