I am attempting to provide data for a customer’s homegrown inventory system by writing data to .CSV files. I am only able to write .CSV from a custom report by using Scheduled Activities. The customer already has a system in place to ingest .CSV data from other sources, so I need to match their format if possible. When Web Reports writes out a report to .CSV file via a scheduled activity, the output does not look like the text that appears in the preview pane. It adds “< br / >” and replaces double quotes with & quot;. When I select an out-of-box report and click “export to CSV”, I do not get these results. The output is not exactly what I need, but it is closer than what I get using a custom report and a scheduled activity. Here is the actual report code. What do I need to change to make the .CSV output look like the preview pane output?
"Name"|"ResourceID"|"MAC Address"|"IP Address"< br />
<?relevance
("%22" &
name of it & "%22|%22" &
id of it as string & "%22|%22" &
concatenation "," of (values of it) of property results whose (name of property of it is contained by set of ("MAC Addresses - Windows"; "MAC Addresses - Unix"; "MAC Addresses - Mac OS X")) of it & "%22|%22" &
concatenation ", " of (it as string) of ip addresses of it & "%22%0d%0a"
)
of bes computers
?>
This is an example of what that code produces in the preview pane:
"Name"|"ID"|"MACAddress"|"IPAddress"
"computer1"|"123456"|"aa:bb:33:55, dd:gr:55:6e"|"10.10.10.10, 192.168.2.3"
"computer2"|"654321"|"cc:dd:55:xx"|"10.10.10.12"
"computer3"|"567890"|"ff:gg:11:ss"|"10.10.10.15"
…
This is an example of what I get in a .CSV file produced from a scheduled activity:
"Name"|"ID"|"MACAddress"|"IPAddress"
& quot;computer1& quot;|& quot;123456& quot;|& quot;aa:bb:33:55, dd:gr:55:6e& quot;|& quot;10.10.10.10, 192.168.2.3& quot;
< br />& quot;computer2& quot;|& quot;654321& quot;|& quot;cc:dd:55:xx& quot;|& quot;10.10.10.12& quot;
< br />& quot;computer3& quot;|& quot;567890& quot;|& quot;ff:gg:11:ss& quot;|& quot;10.10.10.15& quot;
…
Notice that the header line prints, then the first line of output where double quotes are replaced by “& quot;”. Then all subsequent lines of output start with < br /> and all double quotes have been replaced by & quot;
Thanks!
Mark
EDIT: Attempted to clarify my question and I had to add spaces in the html character tags as they were displaying as html here on the forum…