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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 27.07.2016, 10:27   #3  
Sada is offline
Sada
Программатор
Аватар для Sada
 
1,450 / 153 (8) ++++++
Регистрация: 29.03.2005
Адрес: Толи Барнаул, толи Москва
Вот как то так
X++:
public void processInExcelAfter()
{
    DataMatrix.net.DmtxImageEncoder                 encoder;
    DataMatrix.net.DmtxImageEncoderOptions          options;
    System.Drawing.Bitmap                           bitmap;
    BinData                                         bindata;
    System.IO.MemoryStream                          memoryStream;
    Binary                                          binary;
    SCMDeliverySchedId                              deliverySchedId;
    SetEnumerator                                   se;
    ;
    if (!QRCodeContainerSet.empty())
    {
        new InteropPermission(InteropKind::ClrInterop).assert();
        bindata = new BinData();        
        encoder = new DataMatrix.net.DmtxImageEncoder();
        options = new DataMatrix.net.DmtxImageEncoderOptions();
        options.set_Encoding(System.Text.Encoding::get_UTF8());        
        
        se      = QRCodeContainerSet.getEnumerator();
        
        while (se.moveNext())
        {
            [currentRow, deliverySchedId] = se.current();

            try
            {
                memoryStream    = new System.IO.MemoryStream();
                bitmap          = new System.Drawing.Bitmap(encoder.EncodeImage(deliverySchedId, options));
                bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat::get_Bmp());

                binary          = Binary::constructFromMemoryStream(memoryStream);
                bindata.setBinaryData(binary);

                excelDocument.insertImage(ComExcelDocument_RU::numToNameCell(2, currentRow), bindata.getData(), 5,5);
            }
            catch (Exception::CLRError)
            {
                //BP Deviation documented
                error(CLRInterop::getLastException().ToString());
            }
        }
        CodeAccessPermission::revertAssert();
    }
}
Теги
qrcode

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
atinkerersnotebook: Using Export To Excel in Dynamics AX to Create Reporting Data Sources Blog bot DAX Blogs 1 12.10.2013 01:13
atinkerersnotebook: Using the Dynamics AX Excel Add-In Blog bot DAX Blogs 1 25.09.2013 07:11
atinkerersnotebook: Walkthrough & Tutorial Summary Blog bot DAX Blogs 1 09.09.2013 09:11
atinkerersnotebook: Using Excel to Import Products & Services in Dynamics AX Blog bot DAX Blogs 0 19.07.2013 15:11
Sample Design Patterns: Microsoft Dynamics AX - Remedy for slow Microsoft Excel import Blog bot DAX Blogs 0 29.05.2011 17:13
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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