1. Alexis Colon Lugo
  2. Report Editor
  3. Пятница, Март 02 2018, 07:35 PM
  4.  Подписаться через email
if $F(statetax)=1 then
10.5 /100 * summary2
end if
how i make it to works
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hi Alexis,

Are the summary and this expression in the group footer?
It’s possible to do with JavaScript. I’ll add an example tomorrow.
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
no
is on page body
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Isn't the summary2 is a summary control? Summary control can be in the Page Footer, not a Page Body.
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
sorry
is on Column Footer
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
And there will be only one column on the page, right?
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
yes
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Here's an example.

The value of the tax will be printed using the pPageTax internal parameter.
We can't use the value of summary directly so it is necessary to calculate it in the script, the SUM for one page will be stored in the report.page_sum property.

1. Add the following expression in the summary:
$P(pPageTax)

2. Reset the sum in the report pre_add_page script:
report.page_sum = 0;

3. Calculate SUM in the post_place script of the Page Body (reportbody1 object)
report.page_sum += report.cursor.columnValue( 'amount' );

4. Calculate the pPageTax value in the pre_place script of the Column Footer:
report.setParameterValue( 'pPageTax', 0.105 * report.page_sum );

If you don't need to print the tax depending on the statetax field value, you can use the print_if property of the expression
Вложения
Комментарий
There are no comments made yet.
Jay Madren Ответ принят
Here's an example.

The value of the tax will be printed using the pPageTax internal parameter.
We can't use the value of summary directly so it is necessary to calculate it in the script, the SUM for one page will be stored in the report.page_sum property.


Why can't we use the value of a summary expression? It's listed as a property (roducts:vstudio:help:report_editor:properties_inspector:summary_field" target="_blank" rel="nofollow">http://valentina-db.com/docs/dokuwiki/v9/doku.php?id=valentina:products:vstudio:help:report_editor:properties_inspector:summary_field).

It seems silly to have a summary expression on a report, then have to replicate the summary function in the script just so we can use the result elsewhere.
Комментарий
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.

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