1. Dale
  2. Report Editor
  3. Суббота, Март 27 2021, 05:08 PM
  4.  Подписаться через email
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!
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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?
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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
Вложения
Комментарий
There are no comments made yet.
Dale Ответ принят
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.
Вложения
Комментарий
There are no comments made yet.
  • Страница :
  • 1


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