dbTalk Databases Forums  

FORMAT_STRING and Regional Settings

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss FORMAT_STRING and Regional Settings in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stan Kondrat
 
Posts: n/a

Default FORMAT_STRING and Regional Settings - 06-06-2006 , 03:00 PM






Hi,

In AS 2000, when you change the regional formatting settings to French then
the numbers formatted with "#,#.00" strings are displayed in Analysis Manager
with spaces as thousand separators and commas as decimal separators (e.g. "1
234,56". A simple Windows app using ADOMD.NET displays similar results.

A web app (written in VS 2003) however always seems to use the English
format ("1,234.56").

If the same app is written in VS 2005 and uses ADOMD.NET version 9, the
French formatting can be seen while running it from inside the delopment
environment ("View in Browser"). The English formatting is seen while running
the web app outside of the development environment.

Is there any way to solve this for AS 2000? How can this be contolled in AS
2005?

Thanks in advance for any suggestions,
Stan

Reply With Quote
  #2  
Old   
Stan Kondrat
 
Posts: n/a

Default RE: FORMAT_STRING and Regional Settings - 06-07-2006 , 08:33 AM






This is the code I'm running in the web page:

Dim clCommand As AdomdCommand
Dim clConnection As New AdomdConnection
Dim clXmlReader As XmlReader
Dim nEnd As Integer
Dim nStart As Integer
Dim strEndTag As String = "</FmtValue>"
Dim strQuery As String = _
"SELECT {[Measures].[Store Sales]} ON COLUMNS FROM [Sales]"
Dim strStartTag As String = "<FmtValue>"
Dim strText As String

clConnection.ConnectionString = _
"Provider=MSOLAP;ConnectTo=8.0;Data
Source=localhost;Catalog=Foodmart 2000"
clConnection.Open()
clCommand = New AdomdCommand
clCommand.Connection = clConnection
clCommand.CommandText = strQuery
clXmlReader = clCommand.ExecuteXmlReader()
strText = clXmlReader.ReadInnerXml
clXmlReader.Close()
nStart = InStrRev(strText, strStartTag) + Len(strStartTag)
nEnd = InStrRev(strText, strEndTag)
strText = Mid(strText, nStart, nEnd - nStart)
Response.Write("Formatted Cell Value from XmlReader: " & strText)
clConnection.Close()

The output is:
Formatted Cell Value from XmlReader: $565,238.13

When the same code is run from the windows app (replacing Response.Write
with MsgBox) the output is:
Formatted Cell Value from XmlReader: 565 238,13 $

When the web page is run from within VS 2005 (View in Browser or Debug), the
output is:
Formatted Cell Value from XmlReader: 565 238,13 $

Is this a bug?

/Stan

"Stan Kondrat" wrote:

Quote:
Hi,

In AS 2000, when you change the regional formatting settings to French then
the numbers formatted with "#,#.00" strings are displayed in Analysis Manager
with spaces as thousand separators and commas as decimal separators (e.g. "1
234,56". A simple Windows app using ADOMD.NET displays similar results.

A web app (written in VS 2003) however always seems to use the English
format ("1,234.56").

If the same app is written in VS 2005 and uses ADOMD.NET version 9, the
French formatting can be seen while running it from inside the delopment
environment ("View in Browser"). The English formatting is seen while running
the web app outside of the development environment.

Is there any way to solve this for AS 2000? How can this be contolled in AS
2005?

Thanks in advance for any suggestions,
Stan

Reply With Quote
  #3  
Old   
Mary Potapova [MS]
 
Posts: n/a

Default Re: FORMAT_STRING and Regional Settings - 06-09-2006 , 04:31 PM



hello Stan,

this formatting is controlled by the LocaleIdentifier connection string
property. You can set it to whatever is correct for your case inside your
app.
by default (if no LocaleIdentifier was specified in connection string)
adomd.net 8.0 assumes:System.Globalization.CultureInfo.CurrentUI Culture.LCID
and adomd.net 9.0 assumes:
System.Globalization.CultureInfo.CurrentCulture.LC ID

hope this helps,
-- mary
--
This posting is provided "AS IS" with no warranties, and confers no rights.
--
"Stan Kondrat" <StanKondrat (AT) discussions (DOT) microsoft.com> wrote

Quote:
This is the code I'm running in the web page:

Dim clCommand As AdomdCommand
Dim clConnection As New AdomdConnection
Dim clXmlReader As XmlReader
Dim nEnd As Integer
Dim nStart As Integer
Dim strEndTag As String = "</FmtValue>"
Dim strQuery As String = _
"SELECT {[Measures].[Store Sales]} ON COLUMNS FROM [Sales]"
Dim strStartTag As String = "<FmtValue>"
Dim strText As String

clConnection.ConnectionString = _
"Provider=MSOLAP;ConnectTo=8.0;Data
Source=localhost;Catalog=Foodmart 2000"
clConnection.Open()
clCommand = New AdomdCommand
clCommand.Connection = clConnection
clCommand.CommandText = strQuery
clXmlReader = clCommand.ExecuteXmlReader()
strText = clXmlReader.ReadInnerXml
clXmlReader.Close()
nStart = InStrRev(strText, strStartTag) + Len(strStartTag)
nEnd = InStrRev(strText, strEndTag)
strText = Mid(strText, nStart, nEnd - nStart)
Response.Write("Formatted Cell Value from XmlReader: " & strText)
clConnection.Close()

The output is:
Formatted Cell Value from XmlReader: $565,238.13

When the same code is run from the windows app (replacing Response.Write
with MsgBox) the output is:
Formatted Cell Value from XmlReader: 565 238,13 $

When the web page is run from within VS 2005 (View in Browser or Debug),
the
output is:
Formatted Cell Value from XmlReader: 565 238,13 $

Is this a bug?

/Stan

"Stan Kondrat" wrote:

Hi,

In AS 2000, when you change the regional formatting settings to French
then
the numbers formatted with "#,#.00" strings are displayed in Analysis
Manager
with spaces as thousand separators and commas as decimal separators (e.g.
"1
234,56". A simple Windows app using ADOMD.NET displays similar results.

A web app (written in VS 2003) however always seems to use the English
format ("1,234.56").

If the same app is written in VS 2005 and uses ADOMD.NET version 9, the
French formatting can be seen while running it from inside the delopment
environment ("View in Browser"). The English formatting is seen while
running
the web app outside of the development environment.

Is there any way to solve this for AS 2000? How can this be contolled in
AS
2005?

Thanks in advance for any suggestions,
Stan



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.