Page 1 of 1

string.Format not working as expected in c#

Posted: Wed Jan 26, 2022 2:33 pm
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.

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

Posted: Thu Jan 27, 2022 8:23 am
by Lech Kulikowski
Hello,

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

Thank you.

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

Posted: Thu Jan 27, 2022 9:13 am
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.

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

Posted: Fri Jan 28, 2022 1:47 pm
by Lech Kulikowski
Hello,

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

Thank you.

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

Posted: Tue Mar 01, 2022 2:11 pm
by djjoyro
Hello,

I can confirm it is working as expected in 2022.1.6.
Thank you.

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

Posted: Tue Mar 01, 2022 2:44 pm
by Max Shamanov
Hello,

You are welcome.