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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 07.02.2009, 11:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,497 / 847 (79) +++++++
Регистрация: 28.10.2006
C# and AX Development: Truncated real fields (ex. LineNum) when table is exported as XML
Источник: http://olondono.blogspot.com/2008/12...enum-when.html
==============

When you are using the method xml() for exporting records from any table in DAX you could get inconsistency data for real fields.

The problem is located inside the method Global::xmlstring. In this method, the real type is exported only with 2 decimals. You must override this method in the appropiated layer to export reals with 8, 10, 12 or more number of decimals.

X++:
// Returns a XML string describing the given value of the given type.
static str xmlString(anytype value, Types theType, int indent=0)
{
    str r;
    Object o;
    Common record;

    ...

    r = strrep(' ', indent);

    switch (theType)
    {

    ...
    
    // Modified: original allows only 2 decimals,
    // now, we allow 12
    case Types::Real:       r += num2str(value,
                                        /* min chars */ 1,
                                        /* decimals */  12,  // Original = 2
                                        /* decimals = point */ 1,
                                        /* no thousand sep */ 0); break;

    ...

    }
    return r;
}

Источник: http://olondono.blogspot.com/2008/12...enum-when.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


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

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

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