diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-10-20 18:03:39 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-20 18:03:39 +1300 |
commit | 4f7356cc1c6962f46ca522246d5b63dc06a2d268 (patch) | |
tree | f5edffaa0219d4f4bdd3d66c514418edc4b0ad1d /src/org/traccar/reports/Events.java | |
parent | 504969d034dce57ebdc85800e051ee918024ef7f (diff) | |
parent | 40d7ff2f9505150c85e87332fac9f67725beba8e (diff) | |
download | trackermap-server-4f7356cc1c6962f46ca522246d5b63dc06a2d268.tar.gz trackermap-server-4f7356cc1c6962f46ca522246d5b63dc06a2d268.tar.bz2 trackermap-server-4f7356cc1c6962f46ca522246d5b63dc06a2d268.zip |
Merge pull request #2464 from Abyss777/export_excel
Fix export empty reports to Excel
Diffstat (limited to 'src/org/traccar/reports/Events.java')
-rw-r--r-- | src/org/traccar/reports/Events.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/org/traccar/reports/Events.java b/src/org/traccar/reports/Events.java index 37bf7b227..77d995f56 100644 --- a/src/org/traccar/reports/Events.java +++ b/src/org/traccar/reports/Events.java @@ -98,20 +98,18 @@ public final class Events { iterator.remove(); } } - if (!events.isEmpty()) { - DeviceReport deviceEvents = new DeviceReport(); - Device device = Context.getIdentityManager().getDeviceById(deviceId); - deviceEvents.setDeviceName(device.getName()); - sheetNames.add(deviceEvents.getDeviceName()); - if (device.getGroupId() != 0) { - Group group = Context.getDeviceManager().getGroupById(device.getGroupId()); - if (group != null) { - deviceEvents.setGroupName(group.getName()); - } + DeviceReport deviceEvents = new DeviceReport(); + Device device = Context.getIdentityManager().getDeviceById(deviceId); + deviceEvents.setDeviceName(device.getName()); + sheetNames.add(deviceEvents.getDeviceName()); + if (device.getGroupId() != 0) { + Group group = Context.getDeviceManager().getGroupById(device.getGroupId()); + if (group != null) { + deviceEvents.setGroupName(group.getName()); } - deviceEvents.setObjects(events); - devicesEvents.add(deviceEvents); } + deviceEvents.setObjects(events); + devicesEvents.add(deviceEvents); } String templatePath = Context.getConfig().getString("report.templatesPath", "templates/export/"); |