Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

PDFConvertor Culture support

 Post Reply Post Reply
Author
Beketov Roman View Drop Down
New Member
New Member
Avatar

Joined: 21 Jul 2011
Posts: 22
Post Options Post Options   Quote Beketov Roman Quote  Post ReplyReply Direct Link To This Post Topic: PDFConvertor Culture support
    Posted: 24 May 2012 at 12:11pm
Hello

Is it possible to support cultures different than set up on the PC for conversion Excel to pdf?

For example:

If server has "En-Us" culture and client has "It-it" culture then in case sending xls and pdf files from the server client will see Date in different formats by default. XLS will how date in  "It-it"  but pdf in "En-Us".

Is it possible to set which culture should be used during xls to pdf conversion by Flexcel ?

Thanks.
Back to Top
Adrian Gallero View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 1237
Post Options Post Options   Quote Adrian Gallero Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2012 at 12:41pm
Hi,
Yes, you can specify the culture by setting the thread culture. For example:

			CultureInfo SaveLDP = System.Threading.Thread.CurrentThread.CurrentCulture;
			try
			{
				CultureInfo Ci = CultureInfo.CreateSpecificCulture("it-IT");
		                ExportToPdf();
			}
			finally
			{
				System.Threading.Thread.CurrentThread.CurrentCulture = SaveLDP;
			}

Note that this only applies to pdf files, xls files will be shown in the culture Excel is set. There is no information in an xls/x file about the culture that will be used, so it is always used what the user sets in his Excel or windows preverences. On the other hand, a pdf is more like an image, where you can draw "," or "." as you want, and this is what will be displayed. FlexCel fully supports different cultures and it is heavily tested with different ones.
Back to Top
Beketov Roman View Drop Down
New Member
New Member
Avatar

Joined: 21 Jul 2011
Posts: 22
Post Options Post Options   Quote Beketov Roman Quote  Post ReplyReply Direct Link To This Post Posted: 08 Jun 2012 at 12:20pm
Hello Adrian

Thank You.


Back to Top
Niewisch Tristan View Drop Down
New Member
New Member
Avatar

Joined: 22 Oct 2012
Posts: 5
Post Options Post Options   Quote Niewisch Tristan Quote  Post ReplyReply Direct Link To This Post Posted: 27 Aug 2013 at 3:51am
Hello TMSsoftware Team,

i have a similar problem with the pdf export. In my case the working thread uses the "de-DE" culture and the operation system, too. In the xlsx templatefile are some number fields, which are formated by Excel function i.e.TEXT(Q43;"0,00"). As result in the excelfile i get for example 0,02 and in the pdf file 002. Fuhterthemore all my date fields are displayed like 31,5,2010 15:13 instead of 31.05.2010 15:13.
It seems that Flexcel uses the wrong culture for generating the pdf file. The same problem exists when i directly print a report.

Thank you for helping.
Back to Top
Adrian Gallero View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 1237
Post Options Post Options   Quote Adrian Gallero Quote  Post ReplyReply Direct Link To This Post Posted: 27 Aug 2013 at 4:15am
I think you have a different problem, and it is using the "Text" function. FlexCel does fully support cultures when exporting to pdf (And we test a lot with them here, in fact, our main development machine isn't in english).

But the Text function is a different thing, because functions in FlexCel are invariant (because if not when you tried to set a formula in a machine with a different locale it wouldn't work).

While you *could* localize FlexCel formulas, this isn't a good idea. The real solution here is not to use "TEXT" at all, which is an old and deprecated function anyway. To format a cell, just write =Q43 and format the cell as "0,00". This will work fine in every locale because the string "0,00" is saved in a neutral locale. That is, no matter what your settings are, inside the Excel file it will be saved as "0.00", and then depending on the locale, it will be converted to the 0,00 or whatever. But inside a function like =TEXT(..., string), Excel doesn't have the knowledge that this is a formatting string, and it will save it "as is". You will have problems with any Excel which is in a different language, or with FlexCel, that while it uses the locale settings, behaves as if it was an "English Excel".

In short, try not to use TEXT. Format the cells instead, and everything will work fine. 
Back to Top
Niewisch Tristan View Drop Down
New Member
New Member
Avatar

Joined: 22 Oct 2012
Posts: 5
Post Options Post Options   Quote Niewisch Tristan Quote  Post ReplyReply Direct Link To This Post Posted: 27 Aug 2013 at 4:57am
Hello Adrian,
thank you for the clearification.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down