メインコンテンツへスキップ

検索

検索

Integration Builder 2016 - Creating Printable Static Files From Variable Data?

コメント

1件のコメント

  • Avatar
    Ian Cummings
    モデレータ

    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:

     

    http://ss64.com/ps/get-command.html

     

    https://technet.microsoft.com/en-us/library/ee692804.aspx

     

    http://powershell.com/cs/

     

    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
    $stream.Write("%ParsedDataRecord%")
    $stream.close()
    

     

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

     

    .

    0

サインインしてコメントを残してください。