monica1
13th August 2009, 13:22
I'm writing a XML file and I need to open it with EXCEL. In this XML I have 3 columms, one of them is a string field but it contein a number begans in 0.
The problem I have is that when I open EXCEL this fields appears like a number and I lost the 0 initial.

There is any function with I can send in the XML the format I need to open in EXCEL?


Thank you in advance,

george7a
14th August 2009, 12:31
Hi,

Here are two workarounds:
1) to add a quote ' before the 0
2) define this column as text.

- George

monica1
14th August 2009, 12:38
If I add a ' before 0 in the excel appears the '.

How can I define this colum as a text in Baan?

Thank you in advance,

george7a
14th August 2009, 12:43
Strange! I have just tried it again, and the ' did not appear. Can you see what exactly is in the cell by looking in the Formula Bar?

You will have to define it in Excel through a macro or a predefined template.

monica1
14th August 2009, 12:56
The problem is that I need to do all in baan. Then I have to send the .xml file and somebody open it wiht Excel.

I write in baan

....
retVal = xmlNewDataElement("tipo_valor", "'0258"), xml_mainnode)
....


In the formula var appears of excel appears '0258

george7a
14th August 2009, 13:05
1) What Excel Version are you using? 2000/XP/2003/2007?
2) what is the data type of this cell that contains '0258?

AFAIK, you can define the type of the excel column in the XML:

<style>
<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{margin:1.0in .75in 1.0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;}
tr
{mso-height-source:auto;}
col
{mso-width-source:auto;}
br
{mso-data-placement:same-cell;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
border:none;
mso-protection:locked visible;
mso-style-name:Normal;
mso-style-id:0;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate:0;}
.xl24
{mso-style-parent:style0;
mso-number-format:"\@";}
.xl25
{mso-style-parent:style0;
mso-number-format:"_\(* \#\,\#\#0\.00_\)\;_\(* \\\(\#\,\#\#0\.00\\\)\;_\(* \0022-\0022??_\)\;_\(\@_\)";}
.xl26
{mso-style-parent:style0;
mso-number-format:"0\.0000";}
.xl27
{mso-style-parent:style0;
mso-number-format:"_\(\0022$\0022* \#\,\#\#0\.00_\)\;_\(\0022$\0022* \\\(\#\,\#\#0\.00\\\)\;_\(\0022$\0022* \0022-\0022??_\)\;_\(\@_\)";}
.xl28
{mso-style-parent:style0;
mso-number-format:"\[ENG\]\[$-409\]mmmm\\ d\\\,\\ yyyy\;\@";}
-->
</style>
You will have to experiment with that a bit more..