Zum Hauptinhalt gehen

Suche

Suche

Programatically Override Data Text File

Kommentare

1 Kommentar

  • Avatar
    Domingo Rodriguez
    Moderator

    For database text files, BarTender allows you at print time, via the .NET Print SDK, to replace the existing text file connection with a different file. Would that perhaps help? See below code:

     

    Setting a Text File Database Connection's File Name A Text File database connection can be used to source objects on a label format. The text file contents may need to vary depending on territory, situation, customer, etc. To support this, the Print SDK supports dynamically changing the text file used for the database connection.  

    The following example demonstrates how to set a Text File database connection's file name:

     

    In C#:

    using Seagull.BarTender.Print.Database;

    // Application Code

    // ...

    Engine btEngine = new Engine();

    // Start a BarTender print engine

    btEngine.Start();

    // Open a label format

    LabelFormatDocument btFormat = btEngine.Documents.Open(@"c:\MyLabel.btw");

    // Set the TextFile database connection file name

    ((TextFile)btFormat.DatabaseConnections["TextFileDB"]).FileName = @"c:\NutritionInformationEurope.txt";

    // Print the label format document

    btFormat.Print();

    // Stop the engine

    btEngine.Stop();

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.