1. Dale
  2. Report Editor
  3. Samstag, März 27 2021, 05:08 PM
  4.  Abonnieren via E-Mail
Hi!

I'm using the following:
Valentina Studio Pro 8.1
Xojo 2017R3
Windows 10

In the Report Editor, I can format numeric fields as shown on the attached image. Question: Can I change the format at runtime from Xojo? I am developing a web-based inventory app. Some of my clients want to show items' quantities format as a whole number, some want to have 2 decimals and others want to have 4 decimals.

Thanks!
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
I tested in the newer version (8.2.1) and formatting with JavaScript worked.

1. Add a new expression to report where resulting value will be printed
2. In the pre_place script of this expression add:

report.controls.expression1.label =
report.cursor.columnValue('amount').toFixed( report.parameterValue('pDecimals') );

3. Add report parameter pDecimals
Anhänge
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
Hello Sergey,

Problem solved. However, instead of creating an expression, I went directly to the field(s) involved and wrote in their respective pre-place scripts:

report.controls.fieldX.pattern = report.parameterValue('pQTYFormat')

Thank you for your guidance.
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello Dale,

I think JavaScript is able to do it, I'll add more details shortly.
The version of V4RB is 8.1, too, right?
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories