Показать сообщение отдельно
Старый 19.07.2012, 18:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Регистрация: 28.10.2006
ax-erp: Get list of printers in Dynamics AX 2012 for SSRS reports [Using X++]
Источник: http://microsoft-dynamics-ax-erp.blo...namics-ax.html
==============


Friends,
Below code snippet will help to get the list of available printers in AX 2012.
staticvoid SR_AvailablePrinters_SSRS(Args _args)
{
Microsoft.Dynamics.AX.Framework.Reporting.Shared.PrinterHelper printerHelper;
System.Collections.ArrayList names;
System.Collections.IEnumerator enumerator;
str name;
// BP Deviation documented
printerHelper = new Microsoft.Dynamics.AX.Framework.Reporting.Shared.PrinterHelper();
names = printerHelper.get_PrinterNames();
if (names != null)
{
enumerator = names.GetEnumerator();
while (enumerator.MoveNext())
{
name = enumerator.get_Current();
info(name);
}
}
}

However, the code which we have learnt to get the list of printers in AX 5.0 will still give the same results in AX 2012.
Just wanted to show another way of getting the printers information in AX 2012 for SSRS printer destinations.


staticvoid SR_2009AXPrinters(Args _args)
{
PrintJobSettings pjs;
SysPrintOptions options = new SysPrintOptions();
int i;
str printerName;
;


pjs = new PrintJobSettings();
<div class="MsoNormal" style="background-color: #fafcff; color: #2a2a2a; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; padding: 0px; text-align: left;"><span style="font-family: Consolas;">for (i = 1<span style="color: black;"> ; i
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.