1. Dale
  2. Report Editor
  3. Thursday, June 11 2020, 10:43 AM
  4.  Subscribe via 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.
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Hello Dale,

Is it the latest version?
Also, please add the screenshots of report layout and report preview.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 1
Dale Accepted Answer
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.
Attachments (6)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 2
Sergey Pashkov Accepted Answer
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?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 3
Dale Accepted Answer
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.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 4
Dale Accepted Answer
I solved it, Sergey. Instead of using an expression, I used a summary field. :D
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 5
Roger Accepted Answer
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.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 6
Sergey Pashkov Accepted Answer
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
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 7
Roger Accepted Answer
ok, thanks Sergey
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 8
Kevin Accepted Answer
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.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 9
Sergey Pashkov Accepted Answer
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
Attachments (3)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 10
Kevin Accepted Answer
Sergey,

Thank you!

Works.

Kevin
Comment
There are no comments made yet.
  1. more than a month ago
  2. Report Editor
  3. # 11
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.