Integration Builder 2016 - Creating Printable Static Files From Variable Data? フォローする


Hey all, 


We're currently using BT 10 and looking to upgrade to 2016 Enterprise Automation.  


One of the things I'll be wanting to do is automate a workflow involving putting a CSV file into a certain directory, with this CSV file containing five columns (for the sake of example, call them Name, Info, Type, Date, and Manufacturer).  


I have a BTW file that'll read these columns and print the labels correctly when working manually, but what we're really looking to do is have Integration Builder read the BTW file and the CSV file, and then create nested folders in  the web print server director, and in the last folder it places a printable version of the file (doc title based on the Name column) that our label team can select and print however many copies they need without having to (or in fact being able to) modify the document. 


Data based example: 


csv file contains three rows, the first being header info and the second and third being a labels we want to generate: 



Name  |   Info  |  Type |  Date  |  Manufacturer


Nails   |  6x15  |  Metal |  3-1-16 |  3MF


Screws | 1x17 |  Tungsten | 3-1-16 |  3NF




So this would end with there being three new directories and 2 new files:    ..\wwwroot\Bartender\3-1-16\3MF\Nails.btw  and ..\wwwroot\Bartender\3-1-16\3NF\Screws.btw




I have the trial version of EA 2016 installed now, but I cannot print to file, seemingly because it's not a licensed version and the option doesn't even get presented. 


In the licensed version, is the above possible?


On top of that, I'm having a hard time fully understanding how to pass field data from the CSV to Integration Builder to use as a filename, and have it iterate across each record.     Any suggestions on how to go about this? 

1 コメント

Ian Cummings
コメントアクション Permalink

I guess you'd set-up the BarTender document so that it connects to a CSV data file of the same generic name located in the same directory as the document.  Therefore when the BTW and CSV files are copied across to the same, newly created folder, they'll hook up to each other without further configuration needed.


When getting trigger data be it from file, web service message etc, whether the data content is in CSV, JSON, XML etc, then the name for each field of data is automatically created as an integration variable thereby allowing you to access the data using the syntax %VariableName%.  In your example the %Name%, %Info%, %Type%, %Date%, and %Manufacturer% integration variables will be auto-created.


In order to create the folders based on field values in each record I suggest you use a PowerShell script to first parse the data, and then create the folders, and copy the files as needed.  There are lots of articles on the web for parsing text files and performing file/folder manipulations, and is actually easier than you might think.  Here are some items to get you started:


Here is a quick example of writing to file using a PowerShell script and making use of the integration variable values.  Note that I'm not able to get you the full solution, but I have spare time sufficient to at least get you started.


# Create and write to a new file a single data record.
# This assumes that the variable %ParsedDataRecord% already contains a header and data record from another script that already parsed the %EventData% variable for records to create as separate files.

$myFile = "C:\inetpub\wwwroot\BarTender\%Date%\DataFile.csv"
$stream = [System.IO.StreamWriter] $myFile


I don't see why you need BarTender to perform a print to file in the Integration Platform?