Suggestion: New string function

Stimulsoft Reports.Flex discussion
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Suggestion: New string function

Post by hugo »

Hello,

This one came as a new need:

New string function MonthToStr, MonthToStrPt and MonthToStrPtBr: receives a Date and returns the literal month.
Ex: MonthToStrPt(entity.datefield) => Fevereiro
Ex: MonthToStr(entity.datefield) => February

This is not a stopper, since we can simply workaround this with an expression or a pre-calculated field but would be nice to have.


Regards,
Hugo.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Suggestion: New string function

Post by HighAley »

Hello.

Please, send us translations of all months. Do you need an additional parameter which will allow to set case of first letter?

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Suggestion: New string function

Post by hugo »

Month PT:
Janeiro
Fevereiro
Março
Abril
Maio
Junho
Julho
Agosto
Setembro
Outubro
Novembro
Dezembro

PT-BR:
janeiro
fevereiro
março
abril
maio
junho
julho
agosto
setembro
outubro
novembro
dezembro

An extra parameter to set case of the first letter would be nice, yes.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Suggestion: New string function

Post by HighAley »

Hello.

Do you need case parameter to the PT language or it should work for PT-BR only?

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Suggestion: New string function

Post by hugo »

This is the same of the day of week example:

The standard case for months for PT-PT is upper and for PT-BR is lower. It's the only difference.

However it's possible to have days of week in PT-PT text in lower-case (it's not so usual but it's also correct).
With PT-BR it's also possible to have upper if it's the start of a sentence.

I would say that PT-PT starts with upper by default and PT-BR with lower by default. An extra parameter will change the case of the default.
This extra parameter will be only an extra. It's not so important.

Another possibility would be to have only one function MonthToStrPt that returns months in PT-PT and one extra parameter to put in lower case. I think that this also can solve the problem with the minium effort.

Regards,
Hugo.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Suggestion: New string function

Post by HighAley »

Hello.

We have added next functions:

Code: Select all

MonthName(DataSource.DateColumn, Culture)
MonthName(DataSource.DateColumn, Culture, UpperCase)
Where culture could be "PT-PT" or "PT-BR" and third parameter is boolean.

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Suggestion: New string function

Post by hugo »

Thank you.
This function will contribute to make my model layer simpler.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Suggestion: New string function

Post by HighAley »

Hello.

Good. Let us know if you need any additional help.

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Suggestion: New string function

Post by hugo »

Hello,

The current public build still don't support this so I guess will be available latter, right ?


Thank you,
Hugo.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Suggestion: New string function

Post by HighAley »

Hello.

Sorry, due to technical reasons we didn't include this function i our previous prerelease build. It will be available in our next build on February 14.

Thank you.
Locked