1. Alexis Colon Lugo
  2. Report Editor
  3. Friday, March 02 2018, 07:35 PM
  4.  Subscribe via email
if $F(statetax)=1 then
10.5 /100 * summary2
end if
how i make it to works
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
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.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 1
Alexis Colon Lugo Accepted Answer
no
is on page body
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 2
Sergey Pashkov Accepted Answer
Isn't the summary2 is a summary control? Summary control can be in the Page Footer, not a Page Body.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 3
Alexis Colon Lugo Accepted Answer
sorry
is on Column Footer
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 4
Sergey Pashkov Accepted Answer
And there will be only one column on the page, right?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 5
Alexis Colon Lugo Accepted Answer
yes
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 6
Sergey Pashkov Accepted Answer
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
Attachments (4)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 7
Jay Madren Accepted Answer
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.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 8
  • Page :
  • 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