Difference between revisions of "Exporting Reports"

From SmartWiki
Jump to: navigation, search
Line 2: Line 2:
  
 
There are two techniques to access report data from other [[Applications|applications]].
 
There are two techniques to access report data from other [[Applications|applications]].
 +
 
* If you want to access reports from '''Microsoft Excel''' or '''Microsoft Word''', then you can use the [[SmartSimple]] [[:Category:Plug-Ins for Microsoft Office|Plug-Ins for Microsoft Office]] for these [[Applications |applications]] to access report data.
 
* If you want to access reports from '''Microsoft Excel''' or '''Microsoft Word''', then you can use the [[SmartSimple]] [[:Category:Plug-Ins for Microsoft Office|Plug-Ins for Microsoft Office]] for these [[Applications |applications]] to access report data.
: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.
 +
 
* 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.
 
* 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 [[:Category:Plug-Ins for Microsoft Office|Plug-In]] [[Application|application]].
 
* You can also use this technique to create a '''MS-Excel''' or '''MS-Word''' file, without the need to use the [[:Category:Plug-Ins for Microsoft Office|Plug-In]] [[Application|application]].
Line 18: Line 20:
  
 
[[Image:Reps200.png]]
 
[[Image:Reps200.png]]
+
 
 
This window consists of the following settings:
 
This window consists of the following settings:
  
 
* '''Header''' - Static or variables that you need to display at the top of the export file.
 
* '''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.
+
* '''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.
+
* '''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.
 
* '''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.
+
* '''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.
 
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.
 +
  
  
 
==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:
+
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:
  
 
* '''txt''' – Windows Notepad.
 
* '''txt''' – Windows Notepad.
Line 43: Line 46:
  
 
[[Image:Reps199.png]]
 
[[Image:Reps199.png]]
+
 
 
The extension '''txt''' is generally associated with '''Notepad'''.
 
The extension '''txt''' is generally associated with '''Notepad'''.
  
Line 55: Line 58:
  
 
[[Image:Advanced export settings3.png]]
 
[[Image:Advanced export settings3.png]]
+
 
 
5. Click the '''Export''' button.
 
5. Click the '''Export''' button.
  
Line 61: Line 64:
  
 
[[Image:Reps197.png]]
 
[[Image:Reps197.png]]
+
 
 
6. If required, click the '''Open''' button.
 
6. If required, click the '''Open''' button.
  
 
The file is opened in the associated application – '''Notepad'''.
 
The file is opened in the associated application – '''Notepad'''.
+
 
 
The file name is set to the report name plus the extension specified.
 
The file name is set to the report name plus the extension specified.
  
Line 105: Line 108:
 
[[Image:Excel report.png]]
 
[[Image:Excel report.png]]
  
+
 
 
'''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.
 
'''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.
  
Line 115: Line 118:
  
 
1. In the '''Header''' section enter the XML declaration and open the root element, ''details'':
 
1. In the '''Header''' section enter the XML declaration and open the root element, ''details'':
<pre>
+
 
<?xml version="1.0" encoding="ISO-8859-1"?>{BREAK}
+
<pre><!--?xml version="1.0" encoding="ISO-8859-1"?-->{BREAK}
<details>{BREAK}
 
 
</pre>
 
</pre>
 +
 +
<details>{BREAK} </details>
 +
 +
  
 
2. In the '''Detail''' section add the child elements, in the sample below the child is ''employee'' with subchildren ''firstname'', ''lastname'', ''salary'' and ''startdate''.
 
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:
 
The {TAB}s and {BREAK}s will give the XML document proper indentation:
<pre>
+
 
{TAB}<employee>{BREAK}
+
<pre>{TAB}{BREAK}
{TAB}{TAB}<firstname>@Users - First name@</firstname>{BREAK}
+
{TAB}{TAB}@Users - First name@{BREAK}
{TAB}{TAB}<lastname>@Users - Last name@</lastname>{BREAK}
+
{TAB}{TAB}@Users - Last name@{BREAK}
{TAB}{TAB}<salary>@Users - Salary@</salary>{BREAK}
+
{TAB}{TAB}@Users - Salary@{BREAK}
{TAB}{TAB}<startdate>@Users - Start Date@</startdate>{BREAK}
+
{TAB}{TAB}@Users - Start Date@{BREAK}
{TAB}</employee>{BREAK}
+
{TAB}{BREAK}
 
</pre>
 
</pre>
  
 
3. In the '''Footer''' section, close the root element:
 
3. In the '''Footer''' section, close the root element:
<pre>
+
 
</details>
+
<pre> </pre>
</pre>
 
  
 
4. The Export XML document opened in Notepad:
 
4. The Export XML document opened in Notepad:
<pre>
 
<?xml version="1.0" encoding="ISO-8859-1"?>
 
  
<details>
+
 
<employee>
+
<details> Peter Jahl 25000 11/05/2003 Herry Lee 55000 27/02/2005 Peter Manlee 75000 12/05/2001 </details>
<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==
 
==Exporting with Subreports==
Line 167: Line 153:
  
 
'''Example:'''
 
'''Example:'''
 +
 
* The following would export a report and subreport in Comma Separated Values format (CSV):
 
* The following would export a report and subreport in Comma Separated Values format (CSV):
 +
 
  @Companies/Accounts - Company name@,
 
  @Companies/Accounts - Company name@,
 
  @Companies/Accounts - Address 1@,
 
  @Companies/Accounts - Address 1@,
Line 175: Line 163:
 
  @subreport_0@
 
  @subreport_0@
 
  {BREAK}
 
  {BREAK}
 +
 +
 +
==Export to specified SmartFolder==
 +
New ability to schedule and automate report exports to a SmartFolder or 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. This first release is limited to the file export functionality, e.g. CSV, with support for custom export formatting coming in a future release.
  
 
==See Also==
 
==See Also==
Line 183: Line 175:
 
* [[Using ReportProperty with a Word Merge Document]]
 
* [[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]]

Revision as of 12:57, 24 May 2018

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.


Procedure

  • Click the Custom Export tab (formerly Advanced Export Settings).

The Custom Export window is displayed.

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.


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.


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:

  • 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.

Export to Excel

If you change the extension to xls, then the file will be opened with MS-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


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.

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} </details>


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}{BREAK}
{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}

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

 

4. The Export XML document opened in Notepad:


<details> Peter Jahl 25000 11/05/2003 Herry Lee 55000 27/02/2005 Peter Manlee 75000 12/05/2001 </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}


Export to specified SmartFolder

New ability to schedule and automate report exports to a SmartFolder or 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. This first release is limited to the file export functionality, e.g. CSV, with support for custom export formatting coming in a future release.

See Also




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