Zum Hauptinhalt gehen

Suche

Suche

Labelformat.databaseconnections

Kommentare

2 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    Here is an example of setting the text file to use as the database connection in C#.

     

    public void Demo()
    {
       // Initialize a new BarTender print engine. 
       using (Engine btEngine = new Engine())
       {
          // Start the BarTender print engine.
          btEngine.Start();
    
          // Create an instance of TextFile 
          TextFile textFile = new TextFile("TextfileDatabase");
    
          // Provide a path to the text file.
          textFile.FileName = @"C:\TextfileDatabase.txt";
    
          // Initialize the format document 
          // (create a format with query prompts to use this example).
          LabelFormatDocument btFormat = btEngine.Documents.Open(@"C:\FormatWithQueryPrompts.btw");
    
          // Set the database connection created above.
          btFormat.DatabaseConnections.SetDatabaseConnection(textFile);
    
          // Print the format.
          btFormat.Print();
    
          // Close the current format without saving.
          btFormat.Close(SaveOptions.DoNotSaveChanges);
    
          // Stop the BarTender print engine.
          btEngine.Stop();
       }
    }
    
    0
  • Avatar
    Legacy Poster

    I've tried that, but I'm trying to make a web based printing app.  I'd like to use the TaskManager to manage engines so that I don't have to make up my own.  Also, I couldn't get any error events to fire when printing doesn't work. All the events seem to work much better when using TaskManager.

    0

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