Problem with custom text format

Stimulsoft Reports.NET discussion
Post Reply
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Problem with custom text format

Post by Jennypi »

In my database a field shows a code like this:
lllnnnnnnnnlll (l=letter ; n=number)
I would like to display it formatted like this:
lllnnFnn-nnnn/lll (meaning that I want to insert a "F", an "-" and a "/")
I can't find how to do it, either by using Text Format dialog box or by programing with format function.

Could you please help me?

Thanks,
Jennifer.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Problem with custom text format

Post by Jennypi »

Any help please?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Problem with custom text format

Post by Edward »

Hi, Jennifer.

Please write the following in the Text expression:

Code: Select all

{MyDataSource.MyDataColumn.Substring(0,5)+"F"+ MyDataSource.MyDataColumn.Substring(4,2)+"-"+MyDataSource.MyDataColumn.Substring(6,4)+"/"+MyDataSource.MyDataColumn.Substring(10,3)}
MyDataSource.MyDataColumn is the name of the field in that datasource in Dictionary.

Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Problem with custom text format

Post by Jennypi »

It is working perfectly!
Thanks a lot, I'm learning !:biggrin:
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Problem with custom text format

Post by Edward »

You are welcome, Jennifer :)
Post Reply