Skip to Content
0
Former Member
Aug 12, 2008 at 12:09 AM

Passing Culture info from vb.net app to Crystal reports doc or field object

534 Views

I have VB.net application and the app allows the user to set the Current threads culture and datetime and number formats that user wants.

The code that does this is:-

setting the culture on the thread as :

System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr-FR")

or

System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE")

setting the formats as:

System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy"

or

System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = "dd.MM.yy"

Once the current thread is set to the specific culture and date formats, I use this thread culture info to set the different fields and grids to use this formats.

MY ISSUE IS:-

How can I pass the System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern or System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortTimePattern fro

to the Crystal Report templates which have field objects of datetime type?

My only requirement is, if possible the solution should not be using any formula fields.

It would be great if you can answer this.