Problem With Label And Mock Data
Hi,
I'm doing an application using .Net SDK to print the label.
When I create my labels in BarTender I'm using mock data in an excel spreadsheet.
When I'm deploying my label I'm setting up the UseDatabase to false in my code so it doesn't look for the mock data, since I will provide the data with a sharename.
This was working fine using 9.3, I just upgraded to 9.4 and now, with the same setup, same label same code, when I print I'm getting an error that the field, corresponding to the mock data, cannot be found.
So what happened between these 2 releases, is there a new property to setup in the SDK?
I have hundreds and hundreds of label I can't go through all of them to fix something that was not broken before...
Thanks,
Francois
I'm doing an application using .Net SDK to print the label.
When I create my labels in BarTender I'm using mock data in an excel spreadsheet.
When I'm deploying my label I'm setting up the UseDatabase to false in my code so it doesn't look for the mock data, since I will provide the data with a sharename.
This was working fine using 9.3, I just upgraded to 9.4 and now, with the same setup, same label same code, when I print I'm getting an error that the field, corresponding to the mock data, cannot be found.
So what happened between these 2 releases, is there a new property to setup in the SDK?
I have hundreds and hundreds of label I can't go through all of them to fix something that was not broken before...
Thanks,
Francois
0
-
Gene Henson
★ BarTender Hero ★
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 You0 -
Legacy Poster
★ BarTender Hero ★
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 -
Legacy Poster
★ BarTender Hero ★
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.
Comments
3 comments