web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Create printout to file in postscript

(0) ShareShare
ReportReport
Posted on by

Hi to all,

we are migrating some custom AX2009 X++ code to AX2012 R3 CU13.

In AX2009 we had the requirement to use generate a post script file from an xpp report. The file needs to be processed afterwards in some integration, I will not go into detail of it here.

In order to do this in AX2009 we did the following:

- set up a generic printer on the domain controller using a post script driver

- Using PrintJobSettings class and pass a given file destination using the methods .setTarget(PrintMedium::Printer), .outputToPrnFile(true), .filename(outputFilePath)

This generated a postscript file in the outputFilePath.

Here the sample code of AX2009:

    printJobSettings = new PrintJobSettings();

    printJobSettings.deviceName(“\\myprintserver01\DAX_KyoUni_PS”); 

    printJobSettings.setTarget(PrintMedium::Printer); //print to printer

    printJobSettings.preferredTarget(PrintMedium::Printer);

    printJobSettings.outputToPrnFile(true); //redirect output to file

    printJobSettings.fileName(outFilePath); //temporary file name

    printJobSettings.suppressScalingMessage(true);

    printJobSettings.warnIfFileExists(false);

I could not find a way in order to migrate this solution to SSRS reports. Is there a another way to achieve this these functions for SSRS reports in AX2012 ?

Many thanks for any input.

*This post is locked for comments

I have the same question (0)
  • Crispin John Augustine Profile Picture
    37,081 on at

    In AX 2012, you can simply generate a Report using the Controller class, and in the Controller class, you can set the printJobSettings.

    Have you considered this?  or have I understood your requirement incorrect?

  • Community Member Profile Picture
    on at

    Hi Crispin,

    thanks for the answer. Yes I considered this but how to generate the post script file?

    What I'm especially missing is a replacement for this function:

    printJobSettings.outputToPrnFile(true); //redirect output to file

    Regards

    Thomas

  • Crispin John Augustine Profile Picture
    37,081 on at

    You may have to execute the Controller twice, once printing from Printer, and the other save to file. You can manage this with Parameters.

  • Community Member Profile Picture
    on at

    Hi Crispin,

    just to explain a little bit better the requirement:

    The printer used here is just a "virtual"printer there is no paper output produced by this printer, the only intention here is to generate the printout in Post script (PS) format.

    The question is how to redirect the printer output (the raw data generated) to a file.

    There are only the following options in SRSPrintMediumType (Screen, Printer, File, Email, Custom, Archive). When choosing the file options I ony have the following image file types (Base Entum SRSImageFileformat) BMP, EMF, GF, JPEG, PNG, TIFF).

    So is there something equivalent in AX2012 as in AX2009 to achieve the same goal (creating a PS file).

  • Crispin John Augustine Profile Picture
    37,081 on at

    I see. I mis-understood "post-script" earlier.

    In this case, I am not Aware if AX 2012 - SSRS reporting has this Feature.

    But, the new WHS reporting has a similar process. You can read the following links and check if you can implement it this way,

    www.milesdata.com/.../4-ways-to-print-labels-from-dynamics-ax-in-the-warehouse

    community.dynamics.com/.../printing-labels-with-the-new-warehouse-management-solution

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans