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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.08.2008, 15:01   #7  
ivas is offline
ivas
Участник
Аватар для ivas
 
252 / 68 (3) ++++
Регистрация: 22.12.2005
добавлю свои пять копеек
кусок кода из класса печати этикеток, преобразует репорт дизайн в EPL для печати напрямую этикеточный принтер
X++:
void addSection(ReportSection _reportSection, common _cursor)
{
    ReportControl        reportControl;
    ReportStringControl  reportStringControl;
    SysDictClass         classObj = new SysDictClass(classnum(ReportSection));//
    int                  childNodesCount;
    int                  i;
    ;

    childNodesCount = _reportSection.AOTchildNodeCount();

    txt += "\nN\n";

    for(i = 0; i < childNodesCount; i++)
    {
        reportControl = _reportSection.controlNo(i);

        if (! reportControl)
            continue;

        if (reportControl.controlType() == ReportFieldType::String)
        {
            reportStringControl = reportControl;
            if (reportStringControl.font() == "BC C128 Medium")
            {
                txt += "B" + this.position(reportControl.left100mm()/12, reportControl.top100mm()/12);

                this.addBarCode(reportControl, _reportSection, _cursor, classObj);
                txt += "\n";
                continue;
            }
        }

        txt += "A" + this.position(reportControl.left100mm()/12, reportControl.top100mm()/12);
        switch (reportControl.controlType())
        {
            case ReportFieldType::Text:
                this.addText(reportControl, _reportSection, _cursor, classObj);
                break;
            case ReportFieldType::String:
                this.addString(reportControl, _reportSection, _cursor, classObj);
                break;
            case ReportFieldType::Integer:
                this.addInteger(reportControl, _reportSection, _cursor, classObj);
                break;
            case ReportFieldType::Real:
                this.addReal(reportControl, _reportSection, _cursor, classObj);
                break;
        }

        txt += "\n";
    }

    txt += "P1\n";
X++:
void addString(ReportControl _reportControl, ReportSection _reportSection, common _cursor, SysDictClass _classObj)
{
    ReportStringControl  reportControl = _reportControl;
    str                  s;
    ;


    txt += this.font(reportControl.fontSize(), reportControl.bold(),
                     reportControl.italic(),  reportControl.font());


    if (reportControl.dataField())
    {
        s = _cursor.(reportControl.dataField());
    }
    if (reportControl.dataMethod())
    {
        s = _classObj.callObject(reportControl.dataMethod(), _reportSection);
    }

    s = strreplace(s, "\"","'");
    txt += strfmt("\"%1\"", s);
}

могу весь класс выложить если кому интересно
__________________
aLL woRk aNd nO JoY MAKes jAck a dULL Boy
Теги
контрол, отчет

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Как получить периодические значения pyramid DAX: Программирование 11 20.11.2008 16:19
Как получить значения полей (modifiedDate, modifiedTime, modifiedBy и др.) при работе с объектами AOT типа Map? LRA DAX: База знаний и проекты 15 02.04.2007 13:37
Как получить значения поля из lookup метода в WEB Dronas DAX: Программирование 5 13.01.2005 10:17
Значения параметров из SysQueryForm. har DAX: Программирование 19 29.10.2004 15:25
Свойтва контролов в потомках RunBaseBatch slava DAX: Программирование 1 02.05.2002 09:00

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 12:12.