Need a special offer?Find out if your project fits.
+

Localization problems on numeric columns on .net datareader

Resolved
Cleyton Barroso asked on February 17, 2017

We are starting with Flexmonster on our project. Our back-end is based on a Web API (.Net Framework) and this web api is responsible to access a database, hits a query and return the data to the flexmonster component. The database can be large and we are trying to following the documentation available on the flexmonster website.

We started with the Flexmonster.Compressor.Compressor.CompressDb dll to send my data through a Web API, and we hit a query on an Oracle database. We have issues with number columns on the result for Flexmonster. The problem is with the Culture of the information. We are using pt-BR culture (portugues-Brazil) and our decimal separator is ',' character.

Our code:
 

[HttpGet]
public HttpResponseMessage GetCube(long dataSourceId)
{
HttpResponseMessage response = Request.CreateResponse();

using (var dataReader = GetCube(dataSourceId))
{
var stream = Flexmonster.Compressor.Compressor.CompressDb(dataReader);

response.Content = new PushStreamContent((Stream outputStream, HttpContent content, TransportContext context) =>
{
int count = 0;
byte[] buffer = new byte[10240];
while ((count = stream.Read(buffer, 0, buffer.Length)) > 0)
{
outputStream.Write(buffer, 0, count);
outputStream.Flush();
}
outputStream.Close();
}, new MediaTypeHeaderValue("text/plain"));
}

return response;
}

The problem is that our result has a number column where values are: 82,99  286,11  303,94  etc. But, when we access the web api from browser, the results looks like the ',' is a separator and the flexmonster just understand it is a integer value such as 82, 286, 303, etc.
If we access the url of the web api directly from the browser, we can see a result like this:
 

___ocsv2___2.309/2.213
-NUMERO_LINHA,-PRODUCAO
1,82,99
2,286,11
3,303,94
4,323,66
5,240,46
6,290,64
7,162,84
8,68,01

We think it is a culture/localization problem with numbers and possible it can happen with datetimes too. Is there any way to set the column separator,  for sample instead of ',' use ';' on the ocsv2 result?

How can we solve this problem?

Thank you.
 
 

1 answer

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster February 17, 2017

Hello Cleyton,
Thank you for reporting this issue. We will prepare the necessary fix in the version 2.311 ETA Mar13.
Best regards,
Dmytro.

Please login or Register to Submit Answer