1. Dale
  2. Report Editor
  3. Donnerstag, Juni 11 2020, 10:43 AM
  4.  Abonnieren via E-Mail
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello Dale,

Is it the latest version?
Also, please add the screenshots of report layout and report preview.
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
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.
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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?
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
I solved it, Sergey. Instead of using an expression, I used a summary field. :D
Kommentar
There are no comments made yet.
Roger Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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
Kommentar
There are no comments made yet.
Roger Akzeptierte Antwort
ok, thanks Sergey
Kommentar
There are no comments made yet.
Kevin Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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
Anhänge
Kommentar
There are no comments made yet.
Kevin Akzeptierte Antwort
Sergey,

Thank you!

Works.

Kevin
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.