Reverse a String

Stimulsoft Reports.NET discussion
Post Reply
Ink
Posts: 50
Joined: Sat Jul 02, 2011 2:26 am
Location: UK

Reverse a String

Post by Ink »

Hi,

Is there a way in a report to reverse a string? I have a string value that represents a date, so 020812 = 2nd Aug 2012
This value is printed as is on one part of the report - 020812
But it is also used as part of a barcode, where it is reversed, so it needs to display as 120802
Is there a way to do this internally in stimulsoft designer?

Thanks,

Jon.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Reverse a String

Post by HighAley »

Hello.
Ink wrote:Is there a way in a report to reverse a string? I have a string value that represents a date, so 020812 = 2nd Aug 2012
This value is printed as is on one part of the report - 020812
But it is also used as part of a barcode, where it is reversed, so it needs to display as 120802
Is there a way to do this internally in stimulsoft designer?
If you have a string then please write next expression

Code: Select all

{YourDataSource.YourTextField.Substring(4, 2) + YourDataSource.YourTextField.Substring(2, 2) + YourDataSource.YourTextField.Substring(0, 2)}
If your data in date format then you can use next expression

Code: Select all

{YourDataSource.YourDateField.ToString("yyMMdd")}
Thank you.
Ink
Posts: 50
Joined: Sat Jul 02, 2011 2:26 am
Location: UK

Reverse a String

Post by Ink »

Thanks! First method worked fine.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Reverse a String

Post by Andrew »

Hello,

Perfect! As always we are glad to help you!
Post Reply