1. Alexis Colon Lugo
  2. Report Editor
  3. Freitag, März 02 2018, 07:35 PM
  4.  Abonnieren via E-Mail
if $F(statetax)=1 then
10.5 /100 * summary2
end if
how i make it to works
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
no
is on page body
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Isn't the summary2 is a summary control? Summary control can be in the Page Footer, not a Page Body.
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
sorry
is on Column Footer
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
And there will be only one column on the page, right?
Kommentar
There are no comments made yet.
Alexis Colon Lugo Akzeptierte Antwort
yes
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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
Anhänge
Kommentar
There are no comments made yet.
Jay Madren Akzeptierte Antwort
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.
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. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories