There is no matching overloaded method for 'Replace(String,String,Number)'

Stimulsoft Reports.JS discussion
Post Reply
Mateus Garrido Kern
Posts: 29
Joined: Wed Sep 04, 2019 5:19 pm
Location: Curitiba/PR (Brazil)

There is no matching overloaded method for 'Replace(String,String,Number)'

Post by Mateus Garrido Kern » Wed Aug 26, 2020 1:58 pm

Hi,

I had this error when trying to perform a replace on a string:
Expression in Text property of 'Text29' can't be evaluated! Parser error: There is no matching overloaded method for 'Replace(String,String,Number)'
And this is the Expression for the Text29:
{Replace(root_retorno_abertura.texto,"{NumeroFolhas}",TotalPageCount)}
In the Design Preview works very well, but in my Angular project using javascript presents this error.
Attachments
Screenshot_3.png
My Preview Designer works very well
Screenshot_3.png (50.16 KiB) Viewed 329 times
Screenshot_2.png
My Designer Stimulsoft
Screenshot_2.png (62.59 KiB) Viewed 329 times
Screenshot_1.png
My Console Log Error
Screenshot_1.png (52.25 KiB) Viewed 329 times
Mateus Garrido Kern
Email: desenv5.digibyte@outlook.com
Mateus Garrido Kern
Posts: 29
Joined: Wed Sep 04, 2019 5:19 pm
Location: Curitiba/PR (Brazil)

Re: There is no matching overloaded method for 'Replace(String,String,Number)'

Post by Mateus Garrido Kern » Wed Aug 26, 2020 1:59 pm

How can I solve this problem?

Thank you
Mateus Garrido Kern
Email: desenv5.digibyte@outlook.com
Mateus Garrido Kern
Posts: 29
Joined: Wed Sep 04, 2019 5:19 pm
Location: Curitiba/PR (Brazil)

Re: There is no matching overloaded method for 'Replace(String,String,Number)'

Post by Mateus Garrido Kern » Wed Aug 26, 2020 2:24 pm

Hello,

I solved this problem using 'ToString()' function, like this:
{Replace(root_retorno_abertura.texto,"{NumeroFolhas}",ToString(TotalPageCount))}
Thank you
Mateus Garrido Kern
Email: desenv5.digibyte@outlook.com
Lech Kulikowski
Posts: 3451
Joined: Tue Mar 20, 2018 5:34 am

Re: There is no matching overloaded method for 'Replace(String,String,Number)'

Post by Lech Kulikowski » Wed Aug 26, 2020 8:29 pm

Hello,

Thank you for the information.
Post Reply