Valentina printing to pdf with a pagenumber doesn't work

I have an mac mini (M4 26.5.2) with Valentina studio Pro 15.5.3 (64bit).
I create a report with some values from a mysql database.
Then I create a Xojo (2025 R 3.1) program for a Mac, and use the Print_Valentina.vsp file to create a pdf. (in xojo)
This works perfect.
But as soon as I add two Text Fields named Page Number / Total Pages. The pdf is not created, No errors just not created. And when I remove the two the pdf is created again.
This is how I print the pdf in xojo:

Try

Var Location As New FolderItem(LocationVSP)mProject = New VProject(Location)

mProject.Open()

If mProject <> Nil Then

Var inDataSource As String = "mysql://host='" + Host + "' port='" + Port.ToString() + "' dbname='" + DatabaseName + "' user='" + User + "' password='" + Password + "'"

mReport = mProject.MakeNewReport(Report, inDataSource, "" )

Var f As New folderItem(LocationPDF + "/" + PDFName)

mReport.PrintToDisk( f, EVReportPrintType.kToPDF, 1 )


End If

Exception err As VExceptionMessageBox(err.Message)

End

Can someone help me in this?
Where are the error messages kept/saved?

Thanks in advance,
Brian

Ruslan doesn’t read this forum. Try the Valentina forum instead or send him an email.

Thank you Beatrix,
To be honest I posted this question there as well.

Hi Brian,

Sergey will check now and answer on our forum.
Later we can drop msg here also.

Hello Ruslan,

Thank you.

Thanks to Sergey the solution was a simple change.

Please try replacing the JavaScript expressions with “Text With Macros,” either individually or combined:

$(page)
$(pagetotal)
$(page) / $(pagetotal)
In all 6 of the reports I added at the top of the page the macro.
And that worked. Just don’t use the javacript and use an other way.

Valentina has so many ways.