AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: За рубежом > DAX in English
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.03.2006, 13:56   #1  
Maxim Gorbunov is offline
Maxim Gorbunov
Administrator
Соотечественники
Лучший по профессии 2009
 
2,483 / 645 (26) +++++++
Регистрация: 27.11.2001
Адрес: Dubai, UAE
The X++ Print Statement (by Sharon E. Cannon)
Цитата:
Posted on 28-Mar-2006 at microsoft.public.axapta.programming by Sharon E. Cannon

When I'm writing a job to test something or to update some data, I know that
I can use the PRINT command to print to the screen. But sometimes I'd like
to print to a printer instead, so that I can keep a hard copy of what I've
done.

My background is Visual Basic, and I know that in VB I can just use

Printer.Print

But I've looked all through the Axapta developer's guide and the few X++
books that we have here, and I cannot find an equivalent command in X++.
I'm sure that it's something simple, but I'm just not seeing it. The
closest thing I've found is the ReportOutputUser class, but it seems to be
designed for reports.

Can anyone help me, please? Thanks!
Try using the info() function instead of the print statement. There is a disadvantage - you only can output strings with this function. But there is the strfmt() function which can convert any data to string and format it accordingly. Take a look at my example:
X++:
int x = 1;
real y = 2.55;
;
info(strfmt("x = %1, y = %2", x, y)); // x = 1, y = 2.55
info() function will open the Infolog window and collect all your messages there. This window can be printed out by clicking on the printer button in toolbar.

For more information on strfmt(), open AOT and go to System documentation/Functions/strfmt
__________________
Not registered yet? Register here!
Have comments, questions, suggestions or anything else regarding our web site? Don't hesitate, send them to me
Старый 06.04.2006, 13:06   #2  
garu is offline
garu
Участник
 
33 / 21 (1) +++
Регистрация: 03.07.2003
Цитата:
Сообщение от Maxim Gorbunov
Try using the info() function instead of the print statement. There is a disadvantage - you only can output strings with this function. But there is the strfmt() function which can convert any data to string and format it accordingly. Take a look at my example:
X++:
int x = 1;
real y = 2.55;
;
info(strfmt("x = %1, y = %2", x, y)); // x = 1, y = 2.55
info() function will open the Infolog window and collect all your messages there. This window can be printed out by clicking on the printer button in toolbar.

For more information on strfmt(), open AOT and go to System documentation/Functions/strfmt

But, info window has limit of rows no more 10 000
Старый 06.04.2006, 20:11   #3  
Ax1D is offline
Ax1D
Участник
 
36 / 16 (1) ++
Регистрация: 01.02.2002
Адрес: Vancouver, British Columbia, Canada
Цитата:
Сообщение от garu
But, info window has limit of rows no more 10 000
You are still able to fix this. Just one look at Info.buildView() method, and you can figure out how the macros #define.MaxErrors(10000) works.
За это сообщение автора поблагодарили: ALEG (1).
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
C# and AX Development: How to print a different Sales Invoice per company in AX Blog bot DAX Blogs 0 26.08.2008 23:05
AX UK: Statement of Direction and Roadmap for Microsoft Dynamics AX Blog bot DAX Blogs 0 17.07.2008 20:05
AX UK: Page 37 of the Partner Ready Statement of Direction Blog bot DAX Blogs 0 13.11.2007 20:30
daxmy: Financial Statement - Stack trace error Blog bot DAX Blogs 0 31.10.2007 17:40
AX UK: New Dynamics AX Statement of Direction for Partners and Customers Blog bot DAX Blogs 0 27.07.2007 17:30

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 07:16.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.