Inserting an empty row line at the top of an exported .csv when it is emailed by an automation policy
search cancel

Inserting an empty row line at the top of an exported .csv when it is emailed by an automation policy

book

Article ID: 366782

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

You are using an Automation Policy that emails the results of a Report as a CSV file (as described in KB 162988 "Send CSV results as attachment in the Automation Policy e-mail"). When you opened the attached CSV file, you noticed the first row is empty at the top of file.



When you run the same report from the SMP Console, it loads just fine without having an empty row at the top.
If you manually export the results as Spreadsheet from the same report, the saved file looks just fine (no empty first row)

 

Environment

ITMS 8.x

Cause

There was a "new line" in the section of creating the CSV file with the "Report Data" of the email task (Send automated report e-mail with attachment) that was used:

<!-- SMP:A;report.csv -->
%!ReportData!%
<!-- SMP:B -->

As it is a CDATA section - our parsing is not removing any newlines etc, preserving everything - so they all go directly into attachment, including this "new line" at the top.

Resolution

Remove "new line" and make it like this:

<!-- SMP:A;report.csv -->%!ReportData!%<!-- SMP:B -->

instead of:

<!-- SMP:A;report.csv -->
%!ReportData!%
<!-- SMP:B -->