Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-06

fpspreadsheet excel5 export

15 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik
to Bogusław Brandys: I tried to do this : MyWorksheet.WriteUTF8Text(0, 3, '???????????????????'); but not all…

MS Office as a whole, as far as I know does not store data in UTF-8 but in CP codes, and that information is read depending on the MS Office language itself.

I do not know that for sure, but I know about this due to a bug that was in OpenOffice that tried to open a doc file wrong because of it.

Ido

http://ik.homelinux.org/

2010/6/23 Bogus?aw Brandys

Show quoted text 21 lines
Hi, I tried to do this : MyWorksheet.WriteUTF8Text(0, 3, '???????????????????'); but not all Polish chars are stored. is this a limitation of excel5 xls files or a bug in fpspreadsheet ? I opened file in OpenOffice 3.1 because I have no Microsoft Excel. Regards Boguslaw -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100623/828847b7/attachment-0001.html>

Reply by email

Felipe Monteiro de Carvalho
to Bogusław Brandys: I tried to do this : MyWorksheet.WriteUTF8Text(0, 3, '???????????????????'); but not all…

Excel 5 does not support unicode. My original code would just store all strings as iso-latin-1, so I am surprized that any letters are only used letters outside iso-latin-1, so they
should all show up wrong.

There is a table comparing the formats here:
http://wiki.lazarus.freepascal.org/FPSpreadsheet#Current_Progress

Felipe Monteiro de Carvalho

Reply by email

Bogusław Brandys

Hi,

I tried to do this :

  MyWorksheet.WriteUTF8Text(0, 3, '???????????????????');

but not all Polish chars are stored. is this a limitation of excel5 xls files or a bug in fpspreadsheet ?

I opened file in OpenOffice 3.1 because I have no Microsoft Excel.

Regards
Boguslaw

Reply by email

Felipe Monteiro de Carvalho
to ik: MS Office as a whole, as far as I know does not store data in UTF-8 but in CP codes, and…

2010/6/23 ik :

MS Office as a whole, as far as I know does not store data in UTF-8 but in CP codes, and that information is read depending on the MS Office language itself.

Not true, Excel 8+ supports storing strings as UTF-16

It can also in addition to that store strings in copepages, but it supports utf-16 too.

Felipe Monteiro de Carvalho

Reply by email

ik
to Felipe Monteiro de Carvalho: Excel 5 does not support unicode. My original code would just store all strings as…

Can you make it possible to store letters not only in iso-latin but with other iso's as well ?

Ido

On Wed, Jun 23, 2010 at 18:06, Felipe Monteiro de Carvalho <

Show quoted text 19 lines
wrote: Excel 5 does not support unicode. My original code would just store all strings as iso-latin-1, so I am surprized that any letters are only used letters outside iso-latin-1, so they should all show up wrong. There is a table comparing the formats here: http://wiki.lazarus.freepascal.org/FPSpreadsheet#Current_Progress -- Felipe Monteiro de Carvalho -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100623/451202f5/attachment.html>

Reply by email

Bogusław Brandys
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
What kind of encodings do you need? Latin1, Latin2 and Hebrew?

I have tested excel8 writing using xlsbiff8 unit and excel5demo project (replaced xlsbiff5 with xlsbiff8 ) but effect is the same. Is there any method to write UTF8 or at least CP1250 Polish codepage chars into excel ?

Boguslaw

Reply by email

Felipe Monteiro de Carvalho
to Bogusław Brandys

2010/6/23 Bogus?aw Brandys :

I have tested excel8 writing using ?xlsbiff8 unit and excel5demo project (replaced xlsbiff5 with xlsbiff8 ) but effect is the same.

Did you change the place where you specify the format in which you want to save?

  MyWorkbook.WriteToFile(MyDir + 'test.xls', >>>sfExcel5<<<, False);

Adding the units just adds the capability to write the format.

And you could just use the excel8 example directly.

Felipe Monteiro de Carvalho

Reply by email

Bogusław Brandys
to Felipe Monteiro de Carvalho: 2010/6/23 Bogus?aw Brandys : Did you change the place where you specify the format in…
Felipe Monteiro de Carvalho wrote 12 lines
2010/6/23 Bogus?aw Brandys : > I have tested excel8 writing using xlsbiff8 unit and excel5demo project > (replaced xlsbiff5 with xlsbiff8 ) but effect is the same. Did you change the place where you specify the format in which you want to save? MyWorkbook.WriteToFile(MyDir + 'test.xls', >>>sfExcel5<<<, False); Adding the units just adds the capability to write the format. And you could just use the excel8 example directly.

Thanks! It works now. Btw when I'm trying to look at properties of generated Excel 97 file it crashes explorer. It might be that my computer has something broken though because I had to turn off many services to free memory and speed up computer.

Boguslaw

Reply by email

ik
to Felipe Monteiro de Carvalho: What kind of encodings do you need? Latin1, Latin2 and Hebrew? Felipe Monteiro de Carvalho

All ISO 8859x encoding, why to limit it ?!
BTW Hebrew have to ISO encoding: ISO-88598 and ISO88598-i . The second is extended and contain punctuation points and few other chars.

Ido

On Wed, Jun 23, 2010 at 19:11, Felipe Monteiro de Carvalho <

Show quoted text 15 lines
wrote: What kind of encodings do you need? Latin1, Latin2 and Hebrew? -- Felipe Monteiro de Carvalho -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100623/ea895472/attachment-0001.html>

Reply by email

Felipe Monteiro de Carvalho
to ik

2010/6/23 ik :

All ISO 8859x encoding, why to limit it ?! BTW Hebrew have to ISO encoding: ISO-88598 and ISO88598-i . The second is extended and contain punctuation points and few other chars.

I did a initial implementation, but it doesn't seam to be possible to have various character sets in the same document in Excel 5. I can even add fonts with various encodings, but it doesn't honor them and instead uses the global encoding setting. Just choosing a single encoding for the whole document would be useful?

Felipe Monteiro de Carvalho

Reply by email

Bogusław Brandys
to Felipe Monteiro de Carvalho: 2010/6/23 Bogus?aw Brandys : Properties as in right-clicking the file in explorer and…
Felipe Monteiro de Carvalho wrote 8 lines
2010/6/23 Bogus?aw Brandys : > Thanks! It works now. Btw when I'm trying to look at properties of generated > Excel 97 file it crashes explorer. Properties as in right-clicking the file in explorer and clicking "properties" ? If yes, then I blame Windows. I don't see how my library could break that.

Not really.Other properties sheets can be displayed but crash occur when I click on summary tab or statistics.

Btw: is it possible to encode cell color or cell font in Excel8 ?

Boguslaw

Reply by email

ik
to Felipe Monteiro de Carvalho: 2010/6/23 ik : I did a initial implementation, but it doesn't seam to be possible to have…

On Wed, Jun 23, 2010 at 20:16, Felipe Monteiro de Carvalho <

Show quoted text 13 lines
wrote: 2010/6/23 ik : > All ISO 8859x encoding, why to limit it ?! > BTW Hebrew have to ISO encoding: ISO-88598 and ISO88598-i . The second is > extended and contain punctuation points and few other chars. I did a initial implementation, but it doesn't seam to be possible to have various character sets in the same document in Excel 5. I can even add fonts with various encodings, but it doesn't honor them and instead uses the global encoding setting. Just choosing a single encoding for the whole document would be useful?

Sure :)

Show quoted text 10 lines
-- Felipe Monteiro de Carvalho -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100623/82b12852/attachment.html>

Reply by email

Felipe Monteiro de Carvalho
to ik

Well, it seams to be unfeasable for me to implement this at the moment, because my OpenOffice cannot read nor write Excel5 files in a different charset from Latin1. Therefore I cannot test my implementation (I don't have Excel).

But anyway, you can also just use Excel 8 or OpenDocument format to get full unicode support.

Felipe Monteiro de Carvalho

Reply by email