1. Alexis Colon Lugo
  2. Report Editor
  3. 金, 3月 02 2018, 07:35 PM
  4.  メールで購読
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.