1. Dale
  2. Report Editor
  3. Четверг, Июнь 11 2020, 10:43 AM
  4.  Подписаться через email
Hello,

I designed a report for POS receipt. Only one item is printed but if I remove the group footer, items are shown. However, I need the group footer to print summary.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Dale,

Is it the latest version?
Also, please add the screenshots of report layout and report preview.
Комментарий
There are no comments made yet.
Dale Ответ принят
Hello Sergey, I am using VS Pro v8.1. I attached the following:

1. Report datasource setting
2. Report datasource output
3. Report layout (original)
4. Report preview using the original layout shows only 1 item.
5. Removed the group footer.
6. report shows all items but without group footer.
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Thanks for the details, still can't reproduce it with my test project (tried in 8.2).
Can you export this report to file and attach here?

Also, there will be multiple groups with different "HeaderIDs" in one printed document, right?
Комментарий
There are no comments made yet.
Dale Ответ принят
Sergey, I found the reason but not the solution yet. I made a separate report file, adding each object and then preview. The culprit is an expression Net Sales (=sum(amount) - sum (tax)). If I remove this object, everything works. I wonder why.
Комментарий
There are no comments made yet.
Dale Ответ принят
I solved it, Sergey. Instead of using an expression, I used a summary field. :D
Комментарий
There are no comments made yet.
Roger Ответ принят
Hello

I have the latest Version from Studio Pro and I can confirm - sum eats the records. I have the same probelm.

Thanks Dale the Summary works.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Roger,

Yes, aggregate functions like SUM can't be used in expressions.

For example, the source query is
SELECT * FROM table1

which returns e.g. 10 records.

When we add SQL expression "sum(field1)" the executed query will be:
SELECT sum(field1) AS InternalReportField01, * FROM ( SELECT * FROM table1 )

and it returns only 1 record
Комментарий
There are no comments made yet.
Roger Ответ принят
ok, thanks Sergey
Комментарий
There are no comments made yet.
Kevin Ответ принят
Is it possible to use the Summary field and exclude some records?

Summary: Type Count, Expression fld_NameID; This displays 14. Thus counting a null field.

I tried the Expression field: Count(fld_NameID). This displays correctly - 13 - but eats the records.

I tried this. Summary: Type Sum , Expression Count(fld_NameID). Displays correctly, but eats records.

Thanks.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Kevin,

Looks like we have to skip NULL values as SQL COUNT does.

For now, it is possible with JavaScript.

For example, the count is printed for elements of group.

Report pre_build:
report.group_count=0;


Page Body post_place
var v = report.cursor.columnValue( 'release_year' );

if( v && v.length > 0 )
report.group_count++;


Group Footer post_place

report.group_count = 0;


And in the group footer - JavaScript expression to output:

report.group_count
Вложения
Комментарий
There are no comments made yet.
Kevin Ответ принят
Sergey,

Thank you!

Works.

Kevin
Комментарий
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