I've included a sample report .xpo and a job to call it.
1 scroll down to the first row of ****s, copy the text between the two rows of starts and paste to a file called "Report_demoPrintDymoLabelScannable.xpo". Then import this file into your AOT.
2 scroll down to the first row of ####s, copy the text between the two rows of #'s. Create a new Job, then paste the text.
3 execute the new job.
Copy the text between the ***s and past to a file called "Report_demoPrintDymoLabelScannable.xpo", then import into AOT
*********************************************************************************************************************************************
Exportfile for AOT version 1.0 or later
Formatversion: 1
***Element: RG
; Microsoft Dynamics AX Report: demoPrintDymoLabelScannable unloaded
; --------------------------------------------------------------------------------
VERSION 1
REPORT #demoPrintDymoLabelScannable
PROPERTIES
Name #demoPrintDymoLabelScannable
Interactive #No
ENDPROPERTIES
METHODS
Version: 3
SOURCE #classDeclaration
#public class ReportRun extends ObjectRun
#{
# str printString;
# boolean testMode; //if True, will also print args().lookupValue in Arial font.
#}
ENDSOURCE
SOURCE #fetch
#public boolean fetch()
#{
# boolean ret;
#
# ret = true; //= super();
#
# return ret;
#}
ENDSOURCE
SOURCE #run
#public void run()
#{
# ;
# if(this.args().parm() == '')
# {
# throw error(strFmt('%1 called with nothing to print', this.name() ));
#
# }
#
#
# if(this.args().parmEnum() == 1)
# testMode = True; // will print legible copy of this.args().lookupValue()
# else
# testMode = False;
#
#
# this.report().design().printJobSettings().copies(1);
#
# super();
#
#
# label_Body.executeSection();
# element.print();
#
#}
ENDSOURCE
SOURCE #init
#public void init()
#{
# str printerName;
# int loopInt;
# int tempInt;
# ;
# printerName = '';
# tempInt = this.printJobSettings().getNumberOfClientPrinters();
# for(loopInt = 1; loopInt <= tempInt; loopInt++)
# {
# if(this.printJobSettings().getPrinter(loopInt) like '*DYMO*')
# printerName = this.printJobSettings().getPrinter(loopInt);
# }
# if(printerName == '')
# {
# this.setTarget(PrintMedium::Screen);
# }
# else
# {
# this.printJobSettings().deviceName(printerName);
# this.setTarget(PrintMedium::Printer);
# }
# this.printJobSettings().copies(1);
# this.printJobSettings().suppressScalingMessage(True);
# this.suppressReportIsEmptyMessage(True);
# printString = '';
# super();
#
#}
ENDSOURCE
ENDMETHODS
QUERY #Query
PROPERTIES
Name #Query
UserUpdate #No
Version #84
Interactive #No
NextUniqueId #1007
ENDPROPERTIES
METHODS
Version: 3
SOURCE #classDeclaration
#public class QueryRun extends ObjectRun
#{
#}
ENDSOURCE
SOURCE #run
#public void run()
#{
# super();
#}
ENDSOURCE
SOURCE #prompt
#public boolean prompt()
#{
# boolean ret;
#
# ret = true; //super();
#
# return ret;
#}
ENDSOURCE
ENDMETHODS
BLOCKS
ENDBLOCKS
DEPENDENTS
ENDDEPENDENTS
COMPOSITEQUERIES
ENDCOMPOSITEQUERIES
ENDQUERY
DESIGNS
DESIGN
PROPERTIES
Name #PrintDymoLabel
AutoDeclaration #Yes
Caption #Print Dymo Label
EmptyReportPrompt #Label Print String Not Found
ArrangeWhen #Never
ResolutionX #0.05 inch
ResolutionY #0.05 inch
Ruler #Inch
TopMargin #0.20 inch
BottomMargin #0.20 inch
LeftMargin #0.25 inch
RightMargin #0.25 inch
Orientation #Landscape
FitToPage #No
ENDPROPERTIES
AUTOBODIES
PROPERTIES
ENDPROPERTIES
ENDAUTOBODIES
GENERATEDDESIGN
SORTKEY
PROPERTIES
Name #Label
Table #SalesLine
ENDPROPERTIES
BODYBLOCK
PROPERTIES
Name #Label_Body
AutoDeclaration #Yes
Top #0.00 inch
Height #0.75 inch
ArrangeMethod #Vertical
TopMargin #0.00 inch
BottomMargin #0.00 inch
LeftMargin #0.00 inch
RightMargin #0.00 inch
Ruler #Inch
ENDPROPERTIES
METHODS
Version: 3
SOURCE #ScanText1
#display str ScanText1()
#{
# str prStr;
# ;
# prStr = strFmt('*%1*', element.args().parm() );
# return prStr;
#}
ENDSOURCE
SOURCE #LegibleText
#display str LegibleText()
#{
# str prStr;
# ;
# if(testMode)
# {
# prStr = strFmt('%1', element.args().lookupValue() );
# }
# else
# prStr = '';
# return prStr;
#}
ENDSOURCE
ENDMETHODS
STRFIELD
PROPERTIES
Name #ScanText
Left #0.00 inch
Top #0.00 inch
Width #1.50 inch
Height #0.40 inch
ShowLabel #No
DataMethod #ScanText1
Font #BC C39 3 to 1 HD Medium
FontSize #53
Bold #Normal
ENDPROPERTIES
ENDSTRFIELD
STRFIELD
PROPERTIES
Name #LegibleText
Left #0.00 inch
Top #0.40 inch
Width #1.47 inch
ShowLabel #No
DataMethod #LegibleText
Thickness #pt1
Font #arial
FontSize #8
Bold #Normal
ENDPROPERTIES
ENDSTRFIELD
ENDBODYBLOCK
ENDSORTKEY
ENDGENERATEDDESIGN
ENDDESIGN
ENDDESIGNS
ENDREPORT
***Element: END
*******************************************************************************************************************************************
#############################################################################################
static void demoScannableLabel(Args _args)
{
Args parmLabel = new Args();
ReportRun printLbl;
;
//NOTE: BC C39 3 to 1 character set:
// 0-9, -, $, %, ., /, +, and A-Z
// * is the field start/stop - cannot be used in scan data.
// NO lower case, comma, or space characters.
// demoPrintDymoLabelScannable is set up for 1.5" x 1" labels.
parmLabel.name(reportstr(demoPrintDymoLabelScannable));
parmLabel.parm('TEST.DATA');
parmLabel.parmEnum(NoYes::Yes);
parmLabel.lookupValue('TEST.DATA');
printLbl = classfactory.reportRunClass(parmLabel);
printLbl.init();
printLbl.run();
}
#############################################################################################