Setnamedsubstringvalue | Label Data Sources フォローする

0
Avatar
Legacy Poster

Hi,

 

Is it possible to get the names of the data sources on a label?  I have around 50 named data sources and currently 20 label formats but a label will not contain all of them.  If i get get the data sources then i can use SetNamedSubStringValue more effectively.

 

Thanks

 

Richard

3 コメント

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

You need to work with the NamedSubStrings collection.  The GetAll() method returns a string that contains the name and value of all data sources on the

template(s) separated by a delimiter.

 

// Declare a BarTender application variable 
BarTender.Application btApp; 

// Declare a BarTender document variable 
BarTender.Format btFormat; 

// Create a new instance of BarTender 
btApp = new BarTender.Application();

// Set the BarTender application visible 
btApp.Visible = true;

// Open a BarTender document 
btFormat = btApp.Formats.Open("c:\\Format1.btw", false, "");

// Display all of the named data source values 
MessageBox.Show(btFormat.NamedSubStrings.GetAll(",", ":"));

// End the BarTender process 
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges); 

0
Avatar
Achecac
コメントアクション Permalink

I need to have my label not to remember the embebed data of the previously saved label.

I pass to the label many named datasources with method SetNamedSubstringValue and some times I need not to pass it any value, but I dont want the label to "remember" last value set in that datasource and just leave it blank.

 

Is there a command i cound send or some kind of property like "forget last embebed data" in the named datasource I could use?

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

Achecac: The problem is that the document would likely be cached in the BarTender process with the named data source already changed from the previous print job.  Either send it a reset value for the named data source that you don't wish to change, else specify the document to be closed (without saving changes) on a per print job basis.  Obviously the latter approach will affect performance.

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