Use this dialog to define a list Ascii file lines command to be used in a Formattable Report.
This is a basic command you would use to copy ascii lines from an external file and write them into your report.
Ascii File To Report Lines From
Use this section to provide the external file name and location. There are two ways of doing this:
Fixed Name - Use this to have the file name provided by a fixed text string. Type the file path or use the Browse Button to locate the file.
Use Variable - Use this to choose the name of a text variable to supply the file name at run time.
This file name may contain a relative path, in which case it will be applied relative to the current design folder or library folder when run.
Line Text
Each Ascii file line can then be reported or saved to a variable using the Line Text command.
Inserting External Tables into Designs
This command could be used in an Insert User Report to display the current contents of an Ascii file in the design. The file path could be provided by an attribute of the inserted report symbol. See Passing Attribute Values To Drawn Reports for more details on how to do this.
You can use this command along with the Variable Extract Field feature to split text up into fields in order to insert a table from an Excel spreadsheet into your design.
Example to insert a CSV table into a design
Set Variable "FileName" to
// get the file name from the inserted report symbol
List of Doc Symbols
If "Is This User Report"
Set Variable "FileName" to Attribute: fileName
// if we have a file name
if "Variable: FileName" is matching "?*"
// read each line from the CSV file in turn
List Of Ascii File Lines from file "Variable: FileName"
// draw line before each row except first
If "List of Ascii File Lines List - Current Item No." is not equal to "1"
Draw Line
// now extract each comma separated field in turn until all the line is reported
Set Variable "line" to Line Text
while "Variable: line" is matching "?*"
Set Variable "field" to field extracted from "Variable: line"
if "Variable: line" is matching "?*"
// not last field so write field with Draw Column enabled
Variable "field"
else
Variable "field"
End of Line
Related Topics
Report Maker | Generate Reports | Angles | Attributes | Set Alternate Attributes | Component Group List | Coordinates | Fixed Commands | If | List | List Field | Position | Value | Variable | While