Domanda

I'm using office writer reports to export data to excel. In that I have some reference number field which is 00033444. I have set the cell formatting to "text". But it still displays without leading zeros like 3344.

I'm using Office Writer 8.4 version.

Any help plz?

È stato utile?

Soluzione

OfficeWriter's ExcelTemplate approach will always attempt to convert numerical strings to numbers and there are several options to ensure that your numerical strings are preserved:

Option 1: In your code, set ExcelTemplate.PreserveStrings to TRUE. This will import all numerical strings as strings.

Option 2: In your template file, add the 'Preserve' modifier to the data marker that corresponds to the reference number field. For example, %%=DataSet.ReferenceField(Preserve).This will import numerical strings from that column of data (i.e. ReferenceField) as strings instead of numbers.

You can set the number formatting of the cell that contains the data marker to be text, but it is not necessary to preserve numerical strings. If you use one the options above, the numerical strings will be imported as strings, regardless of the number format in the template.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top