1. Dale
  2. Report Editor
  3. 土, 3月 27 2021, 05:08 PM
  4.  メールで購読
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.
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.
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.
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.
  • ページ :
  • 1


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