string.Format not working as expected in c#

Stimulsoft Reports.JS discussion
Post Reply
djjoyro
Posts: 32
Joined: Tue Apr 05, 2011 4:50 am
Location: România

string.Format not working as expected in c#

Post by djjoyro »

Hello,

Maybe it is not c# anymore but how can I have this command working as in c# ?
{string.Format("Page {0} / {1}", PageNumber, TotalPageCount)}

now it replaces {0} but instead of {1} I have undefined, no metter what is the second parameter passed.

Thank you.
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: string.Format not working as expected in c#

Post by Lech Kulikowski »

Hello,

You can use the following expression:
"Page {PageNumber} / {TotalPageCount}"

Thank you.
djjoyro
Posts: 32
Joined: Tue Apr 05, 2011 4:50 am
Location: România

Re: string.Format not working as expected in c#

Post by djjoyro »

Hello,

Thank you for your reply.
The problem is that "Page {0} / {1}" is custom and sent in a variable before rendering the report. So the format must be custom and stored in a variable. Is there a way to accomplish this ?

Thank you.
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: string.Format not working as expected in c#

Post by Lech Kulikowski »

Hello,

The issue is fixed. The fix will be available in the next build 2022.1.6

Thank you.
djjoyro
Posts: 32
Joined: Tue Apr 05, 2011 4:50 am
Location: România

Re: string.Format not working as expected in c#

Post by djjoyro »

Hello,

I can confirm it is working as expected in 2022.1.6.
Thank you.
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: string.Format not working as expected in c#

Post by Max Shamanov »

Hello,

You are welcome.
Post Reply