Prompt Vs Substrings Follow

0
Avatar
Legacy Poster

I have existing formats that prompt the operator from within Bartender. Through the SDK I've called and inserted the same prompts into a dataGridView to show (prompt.name and prompt.value). My issue is that prompt.name returns the name of the control [Edit Control 1] and not the name assigned to it in Bartender.

 

When I do the same thing using format.SubStrings I do get the name assigned [Lot. number] etc., but I don't want all the other information that comes along with it. basically All Substrings from the format.

 

Is there a way to get just the Name Field for the SubStrings Object and use it in my datagridview?

 

Thanks

5 comments

0
Avatar
Shotaro Ito
Comment actions Permalink

Do you want to get all named data source (substring) names in a document?

In that case, the code would be this.

//list all named data sources
//C# : btApp is Seagull.BarTender.Print.Engine

btFmt = btApp.Documents.Open(@"c:\Test.btw");
btFmt.PrintSetup.EnablePrompting = false;
string buf = "";
foreach (Seagull.BarTender.Print.SubString subs in btFmt.SubStrings)
{
  buf += subs.Name + "\r\n";
}
MessageBox.Show(buf);
0
Avatar
Legacy Poster
Comment actions Permalink

Do you want to get all named data source (substring) names in a document?

In that case, the code would be this.

//list all named data sources
//C# : btApp is Seagull.BarTender.Print.Engine

btFmt = btApp.Documents.Open(@"c:\Test.btw");
btFmt.PrintSetup.EnablePrompting = false;
string buf = "";
foreach (Seagull.BarTender.Print.SubString subs in btFmt.SubStrings)
{
  buf += subs.Name + "\r\n";
}
MessageBox.Show(buf);

 No I am only interested in the prompts. I do not want to expose all the substrings to the user. We have hundreds of predefined formats, when one is opened I need to show the same prompts as you would see opening the format in Bartender. The input boxes show Object Names ( EDIT CONTROL 1, 2, 3 etc.), while the text box that describes the input boxes do not show up as the prompt name.

 

The substrings however, does show the textbox values associated with an input box and not just the object name.

0
Avatar
Shotaro Ito
Comment actions Permalink

Yeah... I felt the question wasn't such a simple thing.

There was a deprecated property LabelFormat.Prompts.LayoutXML which returns layout of prompt, however using this would not ensure the project to work with future version of BarTender newer than 10.1.

 

You can either set value via named data sources (substrings) by name, or data entry control(prompt)'s object name.

As you described, Prompt object in SDK doesn't have property of linked datasource name.

sounds like you need to set meaningful object name to each data entry control at design time.

Selected object name is shown in status bar (at the bottom of Data Entry Form design view).

0
Avatar
Legacy Poster
Comment actions Permalink

Thanks you Shotaro,

 

To be clear...you are suggesting that I first get the substrings (name) then set that to the prompt object name?

 

I think I'll have the group that setup the labels change the object names to match the substrings.

 

-LB

0
Avatar
Shotaro Ito
Comment actions Permalink

Hi LB, You're right - that would be tiresome part, but once that's done, Prompt object's name would be meaningful.

Please sign in to leave a comment.