TextFormat

Stimulsoft Reports.NET discussion
Post Reply
Marinus
Posts: 10
Joined: Wed Jul 01, 2009 3:21 am
Location: Lillehammer

TextFormat

Post by Marinus »

I get my data from msSQL. I have some fields with dates. I tried to change the TextFormat to dd.MM.yyyy.
I tried different ways:
1. In the ribbon in TextFormat: chose Date and then in the right combobox 08.09.2009
2. In the properties-panel: Text Format: In the dialog chose Date and then 08.09.2009
3. DblClicked on the TextField: chose Expression and wrote: {Format("{0:dd.MM.yyyy}", [Fakturert].SendDate)}
But... it did not help, it still looks like this: 24.08.2009 00:00:00

I also have some currency fields. I would like always to show 2 digits, like this: kr. 89,00 kr. 14,12, kr. 667,80
I tried different ways to format the text, but I still get this: kr. 89 kr. 14,12 kr. 667,0

And so there are some numbers where I always want to show 2 digits.
But 11,123456 does not change to 11,12 whatever I try...

What am I doing wrong?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

TextFormat

Post by Ivan »

Hello,

Can you please send us a sample report with data, which reproduce the issue?

Thank you.
Marinus
Posts: 10
Joined: Wed Jul 01, 2009 3:21 am
Location: Lillehammer

TextFormat

Post by Marinus »

Thank you for your ansver Ivan. I created a little prototype that I could send to you.
In this prototype I used the easiest way to collect the data from msSQL. I used something like this:
var da = new System.Data.SqlClient.SqlDataAdapter(sSql, Conx);
DataTable t = new DataTable(tableName);
da.Fill(t);

Then the reports where OK and the textformat for the dates, numbers and currency could change as expected!

In our "big" project, we use _reader = _command.ExecuteReader(); And then we build a new DataTable on the fly.
We forgot to set the datatype for the columns, so all columns became a string!
We learned a lot! :blush:
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

TextFormat

Post by Ivan »

Hello,

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
drysz
Posts: 3
Joined: Thu Oct 08, 2009 11:51 am
Location: USA

TextFormat

Post by drysz »

Is there a solution for this problem? I am evaluating this product and I am seeing the same problem where using the Designer UI I change the Text Format for 2 different columns in a data band (linked to an Access database) and they do not change. I set one column to currecy and the other to Percentage and the values look no different then if I use General.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

TextFormat

Post by Edward »

Hi

This might happen in case if the type of that column is string. So right-click the DataColumn in the Dictionary and check the column type.

Thank you.
drysz
Posts: 3
Joined: Thu Oct 08, 2009 11:51 am
Location: USA

TextFormat

Post by drysz »

Hi Edward,
Thanks for the quick response. Yes the columns were defined as String within the reporting application. The columns in the actual database were not string though. It is an access database I am testing this with but we will be using MS SQL Server 2000 for the actual application. It seems like if I connect to SQL Server the correct column types are mapped across. If I attach to a an Access database via ODBC, the columns are coming across as STRING.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

TextFormat

Post by Edward »

Hi

Please try to access MS Access database using standard Microsoft OleDb provider, in that case all DataColumns types will be returned correctly.

Thank you.
Post Reply