1. Dale
  2. Report Editor
  3. 木, 6月 11 2020, 10:43 AM
  4.  メールで購読
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.