Convert a Code type to Text type

darmaadarmaa Member Posts: 65
edited 2013-03-12 in Navision Attain
Hello All,
I have one problem. When I export a report to excel, G/L account with code data type is converted into text. but result is wrong. What should I do? Please help me?
Example:
G/L account No. is 2-2200(code type) -> exported to excel G/L account is 109606


I used to export into excel "excel buffer table"

Comments

  • SavatageSavatage Member Posts: 7,142
    if your code to export the g/l account # are you using FORMAT?
    kind of like
    EnterCell(RowNo,ColumnNo,FORMAT("Account G/L"),FALSE,FALSE,'0');
  • darmaadarmaa Member Posts: 65
    Thanks for reply Savatage,
    I used that function. but last parameter is Underline format with boolean type. Why did you use it boolean type?

    I used that:
    EnterCell(RowNo,ColumnNo,FORMAT("Account G/L",2),FALSE,FALSE,FALSE);
    EnterCell(RowNo,ColumnNo,text,bold,italic,underline);

    but results is : 2-
    I need '2-2200' result ](*,)

    Regards,
  • ppavukppavuk Member Posts: 334
    Put this "'" apostrophe symbol before your text. It will force excel to format filed as text. This is known issue, on some localized computers excel can format values by strange way.

    Of course, this make sense if excel file will be used for human processing. If it will be read by another software - you'll got the "'YorValue" instead of "YorValue", but in Excel itself it will always looks and prints as "YorValue".
  • darmaadarmaa Member Posts: 65
    Thanks ppavuk,
    But How can I put this symbol before text? I used it that
    EnterCell(Row, 6, format('AccountNo), FALSE, FALSE, FALSE);
    but it has error.
  • SavatageSavatage Member Posts: 7,142
    example

    EnterCell(Row, Column, '''' + "Ship-to ZIP Code", FALSE, FALSE, FALSE);
Sign In or Register to comment.