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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 04.09.2025, 23:11   #1  
Logger is offline
Logger
Участник
Лучший по профессии 2015
Лучший по профессии 2014
 
3,996 / 3293 (117) ++++++++++
Регистрация: 12.10.2004
Адрес: Москва
Записей в блоге: 2
X++:
    presetGeometry = new DocumentFormat.OpenXml.Drawing.PresetGeometry();
    presetGeometry.set_AdjustValueList(new DocumentFormat.OpenXml.Drawing.AdjustValueList());
    presetGeometry.set_Preset(OXMLExp::getEnumValue(DocumentFormat.OpenXml.Drawing.ShapeTypeValues::Rectangle));

    OXML_RU::appendChild(shapeProperties, presetGeometry);
    OXML_RU::appendChild(shapeProperties, new DocumentFormat.OpenXml.Drawing.NoFill());
    
    fromMarker = new DocumentFormat.OpenXml.Drawing.Spreadsheet.FromMarker();
    fromMarker.set_ColumnId     (new DocumentFormat.OpenXml.Drawing.Spreadsheet.ColumnId    (int642str(_posX - 1))); //считается от нуля
    fromMarker.set_ColumnOffset (new DocumentFormat.OpenXml.Drawing.Spreadsheet.ColumnOffset(int642str(_posXOffcet * #EMU_per_pixel))); // convert to pixels
    fromMarker.set_RowId        (new DocumentFormat.OpenXml.Drawing.Spreadsheet.RowId       (int642str(_posY - 1))); //считается от нуля
    fromMarker.set_RowOffset    (new DocumentFormat.OpenXml.Drawing.Spreadsheet.RowOffset   (int642str(_posYOffcet * #EMU_per_pixel))); // convert to pixels

    toMarker = new DocumentFormat.OpenXml.Drawing.Spreadsheet.ToMarker();
    toMarker.set_ColumnId     (new DocumentFormat.OpenXml.Drawing.Spreadsheet.ColumnId    (int642str(_posX - 1))); //считается от нуля
    toMarker.set_ColumnOffset (new DocumentFormat.OpenXml.Drawing.Spreadsheet.ColumnOffset(int642str((_posXOffcet + _width) * #EMU_per_pixel))); // convert to pixels
    toMarker.set_RowId        (new DocumentFormat.OpenXml.Drawing.Spreadsheet.RowId       (int642str(_posY - 1))); //считается от нуля
    toMarker.set_RowOffset    (new DocumentFormat.OpenXml.Drawing.Spreadsheet.RowOffset   (int642str((_posYOffcet + _height) * #EMU_per_pixel))); // convert to pixels

    twoCellAnchor = new DocumentFormat.OpenXml.Drawing.Spreadsheet.TwoCellAnchor();
    twoCellAnchor.set_FromMarker(fromMarker);
    twoCellAnchor.set_ToMarker  (toMarker);
    twoCellAnchor.set_EditAs(OXMLExp::getEnumValue(DocumentFormat.OpenXml.Drawing.Spreadsheet.EditAsValues::OneCell));    
    
    nonVisualDrawingProperties          = new DocumentFormat.OpenXml.Drawing.Spreadsheet.NonVisualDrawingProperties();
    nonVisualDrawingProperties.set_Id(OXML_RU::setUInt32Value(picId));
    nonVisualDrawingProperties.set_Name(new DocumentFormat.OpenXml.StringValue(_fileName));

    nonVisualPictureProperties          = new DocumentFormat.OpenXml.Drawing.Spreadsheet.NonVisualPictureProperties();
    nonVisualPictureProperties.set_NonVisualDrawingProperties(nonVisualDrawingProperties);
    nonVisualPictureProperties.set_NonVisualPictureDrawingProperties(new DocumentFormat.OpenXml.Drawing.Spreadsheet.NonVisualPictureDrawingProperties());
    
    picture = new DocumentFormat.OpenXml.Drawing.Spreadsheet.Picture();
    picture.set_NonVisualPictureProperties(nonVisualPictureProperties);
    picture.set_BlipFill(blipFill);
    picture.set_ShapeProperties(shapeProperties);

    OXML_RU::appendChild(twoCellAnchor, picture);
    OXML_RU::appendChild(twoCellAnchor, new DocumentFormat.OpenXml.Drawing.Spreadsheet.ClientData());

    OXML_RU::appendChild(worksheetDrawing, twoCellAnchor);
    
    clearNet();
}
Цитата:
- метод вставки картинки
основная замена: DocumentFormat.OpenXml.Drawing.Spreadsheet.AbsoluteAnchor на DocumentFormat.OpenXml.Drawing.Spreadsheet.TwoCellAnchor
+ добавлена очистка объектов (все это игнорируют, в исходнике даже FileStream не диспозился)
Теги
.net, ado, generic, net

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: When browsing AX 2009 Role Centers, you get an error: An unexpected error has occurred on systems with .NET Framework v4.0 installed Blog bot DAX Blogs 1 28.07.2010 08:24
AX.NET: интеграция .NET-приложений с Аксаптой и (будущие) возможности облачных вычислений gl00mie DAX: Программирование 2 23.04.2010 00:47
jinx: Microsoft Dynamics AX und .NET - Erstellen eines Termins in Outlook Blog bot DAX auf Deutsch 0 03.11.2007 00:33
Inside Dynamics AX 4.0: Working with the .NET Business Connector Blog bot DAX Blogs 0 04.10.2007 05:15
Как при импорте задать значение определенного поля? mvf DAX: Программирование 3 04.05.2005 16:26

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

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

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