Difference between revisions of "Exporting Reports"

From SmartWiki
Jump to: navigation, search
(+Use Cases=)
(Custom Export)
 
(59 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
__TOC__
 +
 +
 +
 +
=Overview=
 
{{SeqReportPageHeader}}
 
{{SeqReportPageHeader}}
  
Line 6: Line 11:
  
 
: See [[:Category:Plug-Ins for Microsoft Office|Plug-Ins for Microsoft Office]] for details
 
: See [[:Category:Plug-Ins for Microsoft Office|Plug-Ins for Microsoft Office]] for details
 
 
This article explains how to use the 2nd method, which is exporting.
 
This article explains how to use the 2nd method, which is exporting.
  
Line 13: Line 17:
  
  
 +
=File Export=
 +
[[Image:ReportExport.PNG]]
  
==Procedure==
 
* Click the '''Custom Export''' tab (formerly Advanced Export Settings).
 
 
The '''Custom Export''' window is displayed.
 
 
[[Image:Reps200.png]]
 
 
This window consists of the following settings:
 
 
* '''Header''' - Static or variables that you need to display at the top of the export file.
 
* '''Fields''' - A list of fields taken from the report that is being used to create the report. In addition, you can select two special settings – {tab} – used to add a tab character to the specification and {break} – used to add a line feed to the specification.
 
* '''Detail''' - You construct the actual record layout for the specification in this area. This section can consist of multiple lines.
 
* '''Footer''' - Static or variables that you need to display at the bottom of the export file.
 
* '''File Extension''' - The extension that you wish to associate with the export specifications. By setting this value to any valid Windows file extension, the appropriate [[Application|application]] will be launched when the data is exported.
 
 
 
Each field will be delimited by a tab character ({TAB}), and a line feed ({BREAK}) will be added to the end of each exported record.
 
  
 +
* '''Export Format''' - a dropdown list of different file format you can export the report to.
 +
* '''Folder Type''' - can be exported to either a  [[SmartFolders_Overview|SmartFolder]] or a [[SmartFolders_Overview#Configuration_-_Advanced|Configuration Folder]]
 +
* '''Folder''' - choose the subfolder where you want to export the file to.
 +
* '''Data Position''' -  determines the starting position of your list view results (the "data").
 +
* '''Meta Data Position''' - determines the starting position of the report criteria (the "metadata"). If your report does not utilize [wiki/Criteria criteria], the Meta Data will be blank.
 +
* '''Export File Name''' - set a filename that is applied when the report is exported. If left empty then the default name for exported file is "Book".
  
 +
<pre>
 +
Note: The syntax for both the "Data Position" and "Meta Data Position" fields is ''worksheet'';''column'';''row''
 +
The default setting is 0;0;0 for both fields. This means that your list view results will be exported, with the topmost, leftmost value appearing in the first worksheet, in cell A1.
 +
The numbering begins at zero, so the first worksheet, first column or first row would be referenced with a 0, as opposed to 1.<br /> Therefore, if you wanted either the list view results or the metadata to be placed in the<br /> third worksheet of your Excel file, starting in cell B4, you would enter ''2;1;3''<br /> The syntax for the first worksheet, cell A1 would be ''0;0;0''
 +
</pre>
  
 
==File Extension==
 
==File Extension==
By setting the file extension, you define which program on your computer should be used to process the exported report data. Some common extensions that are useful for exporting data are:
+
A report can be exported into a flat file with the following file extension:
  
 
* '''txt''' – Windows Notepad.
 
* '''txt''' – Windows Notepad.
Line 42: Line 42:
 
* '''csv''' - Comma Separated Values.
 
* '''csv''' - Comma Separated Values.
 
* '''xml''' - Extensible Markup Language (can be opened in Notepad).
 
* '''xml''' - Extensible Markup Language (can be opened in Notepad).
 +
  
 
1. Set the '''Extension''' to '''txt'''.
 
1. Set the '''Extension''' to '''txt'''.
Line 57: Line 58:
 
The report list is displayed and the '''Employee''' list report is now displayed with an '''Export''' button.
 
The report list is displayed and the '''Employee''' list report is now displayed with an '''Export''' button.
  
[[Image:Advanced export settings3.png]]
+
[[Image:Advanced export settings3.png|thumb|none|900px]]
  
 
5. Click the '''Export''' button.
 
5. Click the '''Export''' button.
Line 75: Line 76:
 
7. Close the '''Notepad''' [[Application|application]].
 
7. Close the '''Notepad''' [[Application|application]].
  
==Export to Excel==
+
'''IMPORTANT:''' In order to support '''special characters''' such as French accented letters, euro symbols etc [[SmartSimple]] uses UTF-8 encoding. When opening exported files Microsoft Excel always imports using ASCII, so special characters do not appear correctly. This is a flaw with Excel. In order to export data containing special characters to Excel use one of the procedures outlined on the [[Exporting Reports with Special Characters to Excel]] article.
If you change the extension to '''xls''', then the file will be opened with MS-Excel.
 
  
1. Click the '''Reports''' tab.
+
'''Note:''' If the report has sub reports attached then you must set up the Custom Export settings for each of the sub report attached.
  
2. Click the '''Edit''' button for the '''Employee List''' report.
+
===CSV Data Security===
 +
When exporting data into a CSV format, files can become vulnerable to [https://owasp.org/www-community/attacks/CSV_Injection malicious CSV injection attacks]. As a precautionary measure, an additional space will be added at the beginning of any values starting with at signs ( @ ), plus signs ( + ), minus signs ( - ), piping symbols ( | ), or equals signs ( = ). Therefore, when you export a file from Platform3 into a CSV format and later need to import that file into another system, please ensure you trim the additional space in front of any values.
  
3. Click the''' Custom Export''' tab.<br />
+
==Export to XML==
[[image:Advanced export settings.png]]
+
If you change the '''File extension''' to '''xml''', then the report will construct an XML document from the report results.
  
You can specify the layout of the report to be exported in the next screen
+
1. In the '''Header''' section enter the XML declaration and open the root element, ''details'':
  
[[image:Advanced export settings2.png]]
+
<pre>
 +
<!--?xml version="1.0" encoding="ISO-8859-1"?-->{BREAK}
 +
<details>{BREAK}
 +
</pre>
  
'''Header''' section : you specify the column headings for your report to be exported.
+
2. In the '''Detail''' section add the child elements, in the sample below the child is ''employee'' with subchildren ''firstname'', ''lastname'', ''salary'' and ''startdate''.
  
'''Fields''' drop down : gives a list of variables that correspond to the fields selected in the report through report builder.
+
The {TAB}s and {BREAK}s will give the XML document proper indentation:
  
'''Details''' section : you specify the fields for the report to be exported. The fields that you select will be displayed right to left in exported report so select the field for the last column first.
+
<pre>
 +
{TAB}<employee>{BREAK}
 +
{TAB}{TAB}<firstname>@Users - First name@</firstname>{BREAK}
 +
{TAB}{TAB}<lastname>@Users - Last name@</lastname>{BREAK}
 +
{TAB}{TAB}<salary>@Users - Salary@</salary>{BREAK}
 +
{TAB}{TAB}<startdate>@Users - Start Date@</startdate>{BREAK}
 +
{TAB}</employee>{BREAK}
 +
</pre>
  
4. Change the '''Extension''' to '''XLS''' or '''CSV'''.
+
3. In the '''Footer''' section, close the root element:
  
5. Save the '''Layout'''.
+
<pre> </details> </pre>
  
6. Return to the '''Report''' list and click the '''Export''' button.
+
4. The Export XML document opened in Notepad:
 +
<pre>
 +
<?xml version="1.0" encoding="ISO-8859-1"?>
  
[[image:Advanced export settings3.png]]
+
<details>
 +
<employee>
 +
<firstname>Peter</firstname>
 +
<lastname>Jahl</lastname>
 +
<salary>25000</salary>
 +
<startdate>11/05/2003</startdate>
 +
</employee>
 +
<employee>
 +
<firstname>Herry</firstname>
 +
<lastname>Lee</lastname>
 +
<salary>55000</salary>
 +
<startdate>27/02/2005</startdate>
 +
</employee>
 +
<employee>
 +
<firstname>Peter</firstname>
 +
<lastname>Manlee</lastname>
 +
<salary>75000</salary>
 +
<startdate>12/05/2001</startdate>
 +
</employee>
 +
</details>
 +
</pre>
  
 +
==Exporting with Subreports==
 +
In order to export a report that contains subreports or merged reports you must define the Advanced Export Settings for the subreports, as well as the main report.
 +
<!--54913 - Ability to store report export to specified SmartFolder-->
 +
<!--67965 - Extend schedule report export to custom template-->
 +
'''Example:'''
  
The '''File''' is opened in MS-Excel.
+
* The following would export a report and subreport in Comma Separated Values format (CSV):
  
[[Image:Excel report.png]]
+
<pre>@Companies/Accounts - Company name@,
 +
@Companies/Accounts - Address 1@,
 +
@Companies/Accounts - City@,
 +
@Companies/Accounts - State@,
 +
@Companies/Accounts - Company ID@,
 +
@subreport_0@
 +
{BREAK}
 +
</pre>
  
 +
=Custom Export=
 +
The Custom Export settings allows users to configure the information they wish to export from SmartSimple to external applications such as MS Word, MS Excel or Quickbooks.
  
'''IMPORTANT:''' In order to support '''special characters''' such as French accented letters, euro symbols etc [[SmartSimple]] uses UTF-8 encoding. When opening exported files Microsoft Excel always imports using ASCII, so special characters do not appear correctly. This is a flaw with Excel. In order to export data containing special characters to Excel use one of the procedures outlined on the [[Exporting Reports with Special Characters to Excel]] article.
+
[[Image:Reps200.png|800px]]
  
 +
This window consists of the following settings:
  
'''Note:''' If the report has sub reports attached then you must set up the Custom Export settings for each of the sub report attached.
+
* '''Header''' - Static or variables that you need to display at the top of the export file.
 +
* '''Fields''' - A list of fields taken from the report that is being used to create the report. In addition, you can select two special settings – {tab} – used to add a tab character to the specification and {break} – used to add a line feed to the specification.
 +
* '''Detail''' - You construct the actual record layout for the specification in this area. This section can consist of multiple lines.
 +
* '''Footer''' - Static or variables that you need to display at the bottom of the export file.
 +
* '''File Extension''' - The extension that you wish to associate with the export specifications. By setting this value to any valid Windows file extension, the appropriate [[Application|application]] will be launched when the data is exported.
  
==Export to XML==
 
If you change the '''File extension''' to '''xml''', then the report will construct an XML document from the report results.
 
  
1. In the '''Header''' section enter the XML declaration and open the root element, ''details'':
+
Other settings:
  
<pre><!--?xml version="1.0" encoding="ISO-8859-1"?-->{BREAK}
+
* '''Delimiter''' - tab character ('''''{TAB}'''''), comma, semi-colon, colon
</pre>
+
* '''Line breaks''' - use either a UNIX line break ('''''{LINEFEED}''''')  or a Windows line break ('''''{BREAK}''''')
 +
<!--56598 - Create custom export with UNIX breaks-->
 +
* '''Aggregate Functions in Header or Footer'''
 +
** '''COUNT''' - count the total rows per report. '''''@COUNT('''''column_name''''')@'''''
 +
** '''SUM''' - sum of a column in the report. '''''@SUM('''''column_name''''')@ '''''
 +
** '''Current Date''' - add current date using standard format YYYY, YY, MM, DD, HH, mm
 +
** [[Sscalculation|sscalculation]] can also be used in the header or footer
 +
<!--Ticket# 56482 - Ability to Sum and Count in report custom export header-->
 +
<!--Ticket# 122241 - To add current date in the header for custom export report-->
 +
* Please refer to '''[[Exporting Reports with Total Group By]]''' when exporting reports when [[Using Total Group Options in Report Builder]]
  
<details>{BREAK} </details>
 
  
 +
==Using Custom Export to export in Excel==
 +
1. Click the '''Reports''' tab.
  
 +
2. Click the '''Edit''' button for the '''Employee List''' report.
  
2. In the '''Detail''' section add the child elements, in the sample below the child is ''employee'' with subchildren ''firstname'', ''lastname'', ''salary'' and ''startdate''.
+
3. Click the''' Custom Export''' tab.<br />
 +
[[image:Advanced export settings.png]]
  
The {TAB}s and {BREAK}s will give the XML document proper indentation:
+
You can specify the layout of the report to be exported in the next screen
  
<pre>{TAB}{BREAK}
+
[[image:Advanced export settings2.png]]
{TAB}{TAB}@Users - First name@{BREAK}
 
{TAB}{TAB}@Users - Last name@{BREAK}
 
{TAB}{TAB}@Users - Salary@{BREAK}
 
{TAB}{TAB}@Users - Start Date@{BREAK}
 
{TAB}{BREAK}
 
</pre>
 
  
3. In the '''Footer''' section, close the root element:
+
'''Header''' section : you specify the column headings for your report to be exported.
  
<pre> </pre>
+
'''Fields''' drop down : gives a list of variables that correspond to the fields selected in the report through report builder.
  
4. The Export XML document opened in Notepad:
+
'''Details''' section : you specify the fields for the report to be exported. The fields that you select will be displayed right to left in exported report so select the field for the last column first.
  
 +
4. Change the '''Extension''' to '''XLS''' or '''CSV'''.
  
<details> Peter Jahl 25000 11/05/2003 Herry Lee 55000 27/02/2005 Peter Manlee 75000 12/05/2001 </details>
+
5. Save the '''Layout'''.
  
 +
6. Return to the '''Report''' list and click the '''Export''' button.
  
 +
[[Image:Advanced export settings3.png|thumb|none|900px]]
  
==Exporting with Subreports==
+
The '''File''' is opened in MS-Excel.
In order to export a report that contains subreports or merged reports you must define the Advanced Export Settings for the subreports, as well as the main report.
 
  
'''Example:'''
+
[[Image:Excel report.png]]
  
* The following would export a report and subreport in Comma Separated Values format (CSV):
+
=Export to SmartFolder or SFTP=
 +
A report can now be automated to export as report as per schedule on a daily, weekly, or monthly basis to a SmartFolder or an external SFTP site.
  
@Companies/Accounts - Company name@,
+
Go to  [[Scheduled Report Export]] on how to configure scheduled report exports.
@Companies/Accounts - Address 1@,
 
@Companies/Accounts - City@,
 
@Companies/Accounts - State@,
 
@Companies/Accounts - Company ID@,
 
@subreport_0@
 
{BREAK}
 
  
  
==Export to specified SmartFolder or SFTP ==
+
<!--54913 - Ability to store report export to specified SmartFolder-->
A report can now be automated to export to a SmartFolder or an external SFTP site. You can now schedule a recurring task on a daily, weekly, or monthly basis to automatically run a report and export the contents.
+
<!--67965 - Extend schedule report export to custom template-->
  
From the report configuration, go to '''FILE EXPORT''' tab and under '''Scheduled Export''', configure desired settings:
 
[[Image:ExportReport-1.PNG|500px]]
 
 
* '''Frequency''' - choose the frequency of the export
 
** Daily - set '''Time of Export'''
 
** Weekly
 
** Monthly
 
** Quarterly
 
** Yearly
 
* '''Export To''' - select where to export the file
 
** '''SFTP'''
 
*** '''URL''' - enter the url of the sftp site
 
*** '''Username''' - username to allow access to the sftp
 
*** '''Password''' - password to allow access to the sftp
 
*** '''Path''' - sftp folder location where the files will be pushed i.e. ''/in'' or ''/out''
 
** '''SmartFolder'''
 
*** '''SmartFolder''' - select the SmartFolder where the files will be pushed
 
* '''Start Date''' - will determine when the first export will take place. It is advisable to put a future date as the start date.
 
* '''Time of Export''' - will determine the time of the day when export will happen.
 
* '''Last Exported''' - datetime stamp
 
 
===Examples===
 
 
==See Also==
 
* [[Exporting List View Results to Microsoft Excel]]
 
* [[Report Variables]]
 
* [[Exporting Reports with Special Characters to Excel]]
 
* [[Exporting Multiple Lines Text Fields to HTML]]
 
* [[Using ReportProperty with a Word Merge Document]]
 
  
 +
=See Also=
 +
:* [[Exporting List View Results to Microsoft Excel]]
 +
:* [[Report Variables]]
 +
:* [[Exporting Reports with Special Characters to Excel]]
 +
:* [[Exporting Multiple Lines Text Fields to HTML]]
 +
:* [[Using ReportProperty with a Word Merge Document]]
 
{{PrevNextStart}} [[Creating a Dashboard to Display a Set of Charts]]
 
{{PrevNextStart}} [[Creating a Dashboard to Display a Set of Charts]]
 
{{PrevNextMid}} Back to [[Reports]] Category {{PrevNextEnd}}
 
{{PrevNextMid}} Back to [[Reports]] Category {{PrevNextEnd}}
  
[[Category:Reports]][[Category:XML]]
+
[[Category:Reports]]
 +
 
 +
[[Category:XML]]

Latest revision as of 11:12, 19 February 2021


Overview

caption Click here to watch a video on SmartSimple's integrated reporting subsystem.

There are two techniques to access report data from other applications.

See Plug-Ins for Microsoft Office for details

This article explains how to use the 2nd method, which is exporting.

  • If you want to export the report data to any other data format (for example comma separated values), then you can use the Export settings for the report to create the file format required.
  • You can also use this technique to create a MS-Excel or MS-Word file, without the need to use the Plug-In application.


File Export

ReportExport.PNG


  • Export Format - a dropdown list of different file format you can export the report to.
  • Folder Type - can be exported to either a SmartFolder or a Configuration Folder
  • Folder - choose the subfolder where you want to export the file to.
  • Data Position -  determines the starting position of your list view results (the "data").
  • Meta Data Position - determines the starting position of the report criteria (the "metadata"). If your report does not utilize [wiki/Criteria criteria], the Meta Data will be blank.
  • Export File Name - set a filename that is applied when the report is exported. If left empty then the default name for exported file is "Book".
Note: The syntax for both the "Data Position" and "Meta Data Position" fields is ''worksheet'';''column'';''row''
The default setting is 0;0;0 for both fields. This means that your list view results will be exported, with the topmost, leftmost value appearing in the first worksheet, in cell A1.
The numbering begins at zero, so the first worksheet, first column or first row would be referenced with a 0, as opposed to 1.<br /> Therefore, if you wanted either the list view results or the metadata to be placed in the<br /> third worksheet of your Excel file, starting in cell B4, you would enter ''2;1;3''<br /> The syntax for the first worksheet, cell A1 would be ''0;0;0''

File Extension

A report can be exported into a flat file with the following file extension:

  • txt – Windows Notepad.
  • xls – Microsoft Excel.
  • iif – QuickBooks.
  • csv - Comma Separated Values.
  • xml - Extensible Markup Language (can be opened in Notepad).


1. Set the Extension to txt.

Reps199.png

The extension txt is generally associated with Notepad.

2. Click the Save button.

3. Click the Edit Report button.

4. Click the Reports tab.

The report list is displayed and the Employee list report is now displayed with an Export button.

Advanced export settings3.png

5. Click the Export button.

Depending on your Browser and Security setting, you may need to answer some prompts before the file can be opened.

Reps197.png

6. If required, click the Open button.

The file is opened in the associated application – Notepad.

The file name is set to the report name plus the extension specified.

Reps196.png

7. Close the Notepad application.

IMPORTANT: In order to support special characters such as French accented letters, euro symbols etc SmartSimple uses UTF-8 encoding. When opening exported files Microsoft Excel always imports using ASCII, so special characters do not appear correctly. This is a flaw with Excel. In order to export data containing special characters to Excel use one of the procedures outlined on the Exporting Reports with Special Characters to Excel article.

Note: If the report has sub reports attached then you must set up the Custom Export settings for each of the sub report attached.

CSV Data Security

When exporting data into a CSV format, files can become vulnerable to malicious CSV injection attacks. As a precautionary measure, an additional space will be added at the beginning of any values starting with at signs ( @ ), plus signs ( + ), minus signs ( - ), piping symbols ( | ), or equals signs ( = ). Therefore, when you export a file from Platform3 into a CSV format and later need to import that file into another system, please ensure you trim the additional space in front of any values.

Export to XML

If you change the File extension to xml, then the report will construct an XML document from the report results.

1. In the Header section enter the XML declaration and open the root element, details:

<!--?xml version="1.0" encoding="ISO-8859-1"?-->{BREAK}
<details>{BREAK}

2. In the Detail section add the child elements, in the sample below the child is employee with subchildren firstname, lastname, salary and startdate.

The {TAB}s and {BREAK}s will give the XML document proper indentation:

{TAB}<employee>{BREAK}
{TAB}{TAB}<firstname>@Users - First name@</firstname>{BREAK}
{TAB}{TAB}<lastname>@Users - Last name@</lastname>{BREAK}
{TAB}{TAB}<salary>@Users - Salary@</salary>{BREAK}
{TAB}{TAB}<startdate>@Users - Start Date@</startdate>{BREAK}
{TAB}</employee>{BREAK}

3. In the Footer section, close the root element:

 </details> 

4. The Export XML document opened in Notepad:

<?xml version="1.0" encoding="ISO-8859-1"?>

<details>
	<employee>
		<firstname>Peter</firstname>
		<lastname>Jahl</lastname>
		<salary>25000</salary>
		<startdate>11/05/2003</startdate>
	</employee>
	<employee>
		<firstname>Herry</firstname>
		<lastname>Lee</lastname>
		<salary>55000</salary>
		<startdate>27/02/2005</startdate>
	</employee>
	<employee>
		<firstname>Peter</firstname>
		<lastname>Manlee</lastname>
		<salary>75000</salary>
		<startdate>12/05/2001</startdate>
	</employee>
</details>

Exporting with Subreports

In order to export a report that contains subreports or merged reports you must define the Advanced Export Settings for the subreports, as well as the main report. Example:

  • The following would export a report and subreport in Comma Separated Values format (CSV):
@Companies/Accounts - Company name@,
@Companies/Accounts - Address 1@,
@Companies/Accounts - City@,
@Companies/Accounts - State@,
@Companies/Accounts - Company ID@,
@subreport_0@
{BREAK}

Custom Export

The Custom Export settings allows users to configure the information they wish to export from SmartSimple to external applications such as MS Word, MS Excel or Quickbooks.

Reps200.png

This window consists of the following settings:

  • Header - Static or variables that you need to display at the top of the export file.
  • Fields - A list of fields taken from the report that is being used to create the report. In addition, you can select two special settings – {tab} – used to add a tab character to the specification and {break} – used to add a line feed to the specification.
  • Detail - You construct the actual record layout for the specification in this area. This section can consist of multiple lines.
  • Footer - Static or variables that you need to display at the bottom of the export file.
  • File Extension - The extension that you wish to associate with the export specifications. By setting this value to any valid Windows file extension, the appropriate application will be launched when the data is exported.


Other settings:

  • Delimiter - tab character ({TAB}), comma, semi-colon, colon
  • Line breaks - use either a UNIX line break ({LINEFEED})  or a Windows line break ({BREAK})
  • Aggregate Functions in Header or Footer
    • COUNT - count the total rows per report. @COUNT(column_name)@
    • SUM - sum of a column in the report. @SUM(column_name)@ 
    • Current Date - add current date using standard format YYYY, YY, MM, DD, HH, mm
    • sscalculation can also be used in the header or footer
  • Please refer to Exporting Reports with Total Group By when exporting reports when Using Total Group Options in Report Builder


Using Custom Export to export in Excel

1. Click the Reports tab.

2. Click the Edit button for the Employee List report.

3. Click the Custom Export tab.
Advanced export settings.png

You can specify the layout of the report to be exported in the next screen

Advanced export settings2.png

Header section : you specify the column headings for your report to be exported.

Fields drop down : gives a list of variables that correspond to the fields selected in the report through report builder.

Details section : you specify the fields for the report to be exported. The fields that you select will be displayed right to left in exported report so select the field for the last column first.

4. Change the Extension to XLS or CSV.

5. Save the Layout.

6. Return to the Report list and click the Export button.

Advanced export settings3.png

The File is opened in MS-Excel.

Excel report.png

Export to SmartFolder or SFTP

A report can now be automated to export as report as per schedule on a daily, weekly, or monthly basis to a SmartFolder or an external SFTP site.

Go to  Scheduled Report Export on how to configure scheduled report exports.



See Also




Previous.png Creating a Dashboard to Display a Set of Charts Back to Reports Category Next.png