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)

Printer Output

(0) ShareShare
ReportReport
Posted on by 240

 What is the best way to send simple output to a printer from X++ code without using a report?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

     I think the printjobsettings class would work: 

    http://msdn.microsoft.com/en-us/library/aa634996.aspx

     

  • MikeHefner Profile Picture
    240 on at

    Thanks for the quick reply-I've tried to familiarize myself with PrintJobSettings but I can't figure out if and how I can output a 1 string of characters with a given font and size to a printer without going through making a report.

  • Community Member Profile Picture
    on at

     What is the requirement?  Do you want to output variables for programming purposes or do you need to output something for users?  If you need to print data from ax then I would strongly suggest using a report anyway.

  • MikeHefner Profile Picture
    240 on at

    This started as what I thought would be a pretty simple task.  I'm new to AX/X++ and I wanted to code a quick program that prompted for a string value of not more than 20 or so characters (a string value that wasn't necessarily stored in a table somewhere so writing a report where a table must be specified didn't make sense) and print it out as a barcode by using the 'BC C39 2 to 1 Medium' font.  This was to be used to test some bar coding functionality that's being added to our AX implementation-we do not have AX up and running yet.  We ended up simply printing out some bar codes from excel so no big deal but I'd still like to know how to go about writing X++ code that would output to a printer without using a report.  I realize that almost all printed output can and should be handled by reports but still ... it's one of those things that'll bother me until I find out how to do it, lol.  Thanks again.

  • MikeHefner Profile Picture
    240 on at

    Visual Basic 6 had the Printer object and VB 2008 has PrintDocument.  The closest thing I can find is PrintJobSettings for X++ but it doesn't seem to have any methods for output.  Again, I realize that most printed output can and should be handled by reports but I would still like to know how to send some simple output to the printer without having to define a report.


  • Carsten Glem Profile Picture
    275 on at

    Hi all, jumping into this conversation because I was looking for something like it.

    We have some POS cash drawers that are connected to the parallel printer port, the way they work is that by sending a specific command to them they will open, we need to be able to send that command to the printer (cash drawer) from x++.

    Any of you tried something like that ?

    thanks

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
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans