6.3.1 Defining a Text Data Source
A Text data source definition contains configuration information for accessing the data in the text file. The configuration includes the URL of the data source and a list of related requests. In a servlet- or CGI-based URL, each request corresponds to a parameter set for the HTTP request.
To create a Text data source, follow the steps below:
1. Click the 'New' button in the Style Studio toolbar. This opens the 'New Asset' dialog box.
2. In the left panel, select the 'Data Source' node. In the right 'Types' panel, select 'Text', and click 'OK'. This opens the 'Text Data Source Wizard'.

3. Select the General tab. In the 'Name' field, enter a name for the new data source.

4. Select the Source tab. In the 'URL or File' field, enter the path to the text data file.
You can use a variable in the 'URL or File' field, e.g., 'file:///c:/datafiles/$(parameter_name)' to make the data source URL dynamic (in part or whole). Parameters can be specified in one of three ways: (1) as system variables, (2) as report parameters within the sree.properties file, or (3) as URL parameters. The report engine will look for the parameters in the above sequence, and, if not found, will default to prompting the user for the parameters.
If the URL refers to a static data stream, simply create one default request with no parameters.
5. (Optional) Select the Request tab, and enter the name of the request. In a servlet- or CGI-based URL, each request corresponds to a parameter set for the HTTP request.
6. Add the desired parameters by following the steps below:
a. Select the Parameter tab.
Click 'Remove Parameter' to delete an existing parameter.
b. Click the 'Add parameter' button, and specify the 'Name' and 'Value' of the parameter.

c. To specify a null value for the parameter, select the 'Null' option.
d. To specify a variable name for the parameter, select the 'Variable' option and click 'Apply'. (When the 'Variable' option is selected, the value of the parameter is expected to be provided by an external source, such as report script or user input.)
e. Repeat the above steps to add additional parameters.
7. Press 'Finish' to close the Wizard. Style Studio displays the completed Text data source.
8. Select the Output tab.

9. In the 'File type' menu, select the type of text file.
'Fixed Width Text' is appropriate for a file in which each row in a given column occupies the same width. (Different columns may have different widths.) 'Delimited Text' is appropriate for a file in which each column is separated by a space, comma, or other delimiting character. The two 'Microsoft Excel' options can be used for spreadsheets of the respective types.
10. If you selected 'Fixed Width Text', follow the steps below:
a. Select 'First header row' if the first row of the text file contains headers describing the columns (meta-data).
b. If you selected 'First header row', specify the number of characters in the column headers using the 'Default field width' box. This also sets the default width for the data rows, which you can modify later on a column-by-column basis.
11. If you selected 'Delimited Text', follow the steps below:
a. Select 'First header row' if the first row of the text file contains headers describing the columns (meta-data).
The default delimiter is a comma.
b. If you selected 'First header row', enter the delimiter character in the 'Delimiter' field of the 'Header' region. If the delimiter is a 'Tab' character, check the 'Tab' box.
c. Enter the delimiter character in the 'Delimiter' field of the 'Body' region. If the delimiter is a 'Tab' character, check the 'Tab' box.
12. If you selected one of the 'Microsoft' formats, follow the steps below:
a. Select the desired Excel sheet from the 'Sheet' menu.
b. Select 'First header row' if the first row of the file contains headers describing the columns (meta-data).
c. Enter the starting and ending rows and columns in the appropriate fields.
13. If you selected the 'First header row' option for any of the available formats, press the 'Import' button to import the column header meta-data. This opens the 'Import' dialog box.

14. Press 'Source' to load the meta-data from the specified Text data source. Press 'File' to load the meta-data from an alternate file that you select.
The 'Import' feature uses the column headers and column data to populate the 'Alias' and 'Type' fields in the meta-data table at the bottom of the screen.

To make manual adjustments to the meta-data assignments, see Modifying Text Source Meta-Data.

15. Press the 'Save' button in the Style Studio toolbar to save the new Text data source.
| << 6.3 Text Data Source | © 1996-2013 InetSoft Technology Corporation (v11.4) | 6.3.2 Modifying Text Source Meta-Data >> |