Empty data in data band is not working (SOLVED)

Stimulsoft Reports.JS discussion
Post Reply
terje.pedersen
Posts: 80
Joined: Thu Aug 18, 2016 7:29 am

Empty data in data band is not working (SOLVED)

Post by terje.pedersen »

Using a data band its working great if I have data to display but when the datasource is like "Items": [] only a table header above the data band is shown and nothing else, if I change to "Items": [{}] everything works as normal again but as exptected with a zero line.
Last edited by terje.pedersen on Mon Aug 29, 2016 9:00 am, edited 1 time in total.
terje.pedersen
Posts: 80
Joined: Thu Aug 18, 2016 7:29 am

Re: Empty data in data band is not working

Post by terje.pedersen »

"items":[]
missing-data-in-report.png
missing-data-in-report.png (4.59 KiB) Viewed 4925 times
"items":[{}]
with-zero-line.png
with-zero-line.png (24.51 KiB) Viewed 4925 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Empty data in data band is not working

Post by HighAley »

Hello.

Could you send us your report template with sample data for analysis?

Thank you.
terje.pedersen
Posts: 80
Joined: Thu Aug 18, 2016 7:29 am

Re: Empty data in data band is not working

Post by terje.pedersen »

I have made a minified version of it and added it as an attachment to this post.

Load this as dataset:

Code: Select all

{"customerinvoice": {"Items": [{"ItemText":"The Best Product"}]}, "companysettings": {"CompanyName": "Test Company"}}
It should now look like this:
With Items
With Items
dataset1.png (6.85 KiB) Viewed 4916 times
Replace content in json file with:

Code: Select all

{"customerinvoice": {"Items": []}, "companysettings": {"CompanyName": "Test Company"}}
It should now look like:
Empty Items
Empty Items
dataset2.png (2.6 KiB) Viewed 4916 times
Attachments
datatable.mrt
Report file
(3.99 KiB) Downloaded 312 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Empty data in data band is not working

Post by Alex K. »

Hello,

You data for the DataBand is empty, please try to set the PrintIfEmpty property for the Header to true.

Thank you.
terje.pedersen
Posts: 80
Joined: Thu Aug 18, 2016 7:29 am

Re: Empty data in data band is not working

Post by terje.pedersen »

Ah I see, the header is automatically connected and not showing by default.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Empty data in data band is not working (SOLVED)

Post by HighAley »

Hello.

Did you solve your issue?
Let us know if you need additional help.

Thank you.
Post Reply