Skip to main content

Search

Search

Problem With Label And Mock Data

Comments

3 comments

  • Avatar
    Gene Henson
    Hello Francois,

    I tested this scenario and seemed to work fine for me using version 9.4SR3.

    Here is the code that I used:

    [code]
    public void Demo()
    {
    // Initialize a new BarTender print engine.
    using (Engine btEngine = new Engine())
    {
    // Start the BarTender print engine.
    btEngine.Start();

    // Open a format document.
    LabelFormatDocument btFormat = btEngine.Documents.Open(@"C:\New BarTender Label Format.btw");

    // Set a SubString Value using its name (case sensitive).
    btFormat.SubStrings["test"].Value = "New SubString Value";

    //Set UseDatbase to False
    btFormat.PrintSetup.UseDatabase = false;

    //Print Format
    btFormat.Print();

    // Close the current format without saving.
    btFormat.Close(SaveOptions.DoNotSaveChanges);

    // Stop the BarTender print engine.
    btEngine.Stop();
    }
    }
    [/code]

    Would you be able to supply us with a sample of the code that is not working for you?

    One thing to note, this actually worked for me as long as all of my database fields were setup with a named substring, whether I used the "usedatabase = false" or not. When I have a database field that is not set with a named substring, then I was forced to set the "usedatabase" property to false". Since you are already using the usedatabase flag, it sounds like this should be working for you.

    We will investigate any changes in behavior between 9.3 and 9.4

    Thank You
    0
  • Avatar
    Legacy Poster
    It's a windows service, which has a high volume, so I'm using the taskmanager.

    I will look to send you some code, and also a label that as that issue later today.


    [quote name='Gene H - Seagull Support' timestamp='1317666156' post='747']
    Hello Francois,

    I tested this scenario and seemed to work fine for me using version 9.4SR3.

    Here is the code that I used:

    [code]
    public void Demo()
    {
    // Initialize a new BarTender print engine.
    using (Engine btEngine = new Engine())
    {
    // Start the BarTender print engine.
    btEngine.Start();

    // Open a format document.
    LabelFormatDocument btFormat = btEngine.Documents.Open(@"C:\New BarTender Label Format.btw");

    // Set a SubString Value using its name (case sensitive).
    btFormat.SubStrings["test"].Value = "New SubString Value";

    //Set UseDatbase to False
    btFormat.PrintSetup.UseDatabase = false;

    //Print Format
    btFormat.Print();

    // Close the current format without saving.
    btFormat.Close(SaveOptions.DoNotSaveChanges);

    // Stop the BarTender print engine.
    btEngine.Stop();
    }
    }
    [/code]

    Would you be able to supply us with a sample of the code that is not working for you?

    One thing to note, this actually worked for me as long as all of my database fields were setup with a named substring, whether I used the "usedatabase = false" or not. When I have a database field that is not set with a named substring, then I was forced to set the "usedatabase" property to false". Since you are already using the usedatabase flag, it sounds like this should be working for you.

    We will investigate any changes in behavior between 9.3 and 9.4

    Thank You
    [/quote]
    0
  • Avatar
    Legacy Poster
    I did more investigation, and the problem is not with usedatabase.
    My users put in the data source a field that does not exist, in the datasource.
    When doing this in BarTender
    PrintLabelFormatTask taskPrint = new PrintLabelFormatTask(taskFormat.LabelFormat);
    status = taskManager.TaskQueue.QueueTaskAndWait(taskPrint, System.Threading.Timeout.Infinite);

    in version 9.4 status is equal to error, compare to 9.3 where it was success.
    when you look through the messages, the first 2 are about this field missing and the third is telling it was successfully printed.
    So right now I can't use the status field, instead I need to use taskPrint.PrintResult.

    [quote name='Francois' timestamp='1317728869' post='752']
    It's a windows service, which has a high volume, so I'm using the taskmanager.

    I will look to send you some code, and also a label that as that issue later today.
    [/quote]
    0

Please sign in to leave a comment.