Pass Command Line Data To Print 追蹤

0
Avatar
Legacy Poster

Hi,

I’m connecting my application with BarTender SW and I want
to pass a parameter from my application to the Bartender and print the label
pertaining to the passed parameter (record) without popping up ‘select records ‘window.
Therefore, how do I pass a parameter(specific record data) in the command line and
what would be the changes have to make for SQL statement in the database setup?

 

Your reply greatly appreciated.

3 意見

0
Avatar
Ian Cummings
版主
評論操作 永久連結

You'd use the /?<queryPromptName> command line switch.  The default query prompt name would look like this: /?QueryPrompt1="ABC123"

 

*"ABC123" is an example criteria value you're passing to the query for the purposes of your print job.

0
Avatar
Legacy Poster
評論操作 永久連結

Is there any possibility to pass the whole sql statement(command line) to bartender ?  And bartender needs to set the input string as sql statement. Because my sql is a customized query.

0
Avatar
Ian Cummings
版主
評論操作 永久連結

Yes, see the below example:

 

When using an OLE DB or ODBC database connection, custom SQL statements may be used to perform record filtering when data browsing or to select database records at print time. To apply custom SQL statements, use the SQLStatement property.
 
The following code demonstrates how to set a custom SQL statement when using an OLE DB database connection.
 
string SQL = "SELECT `Calories` FROM `NutritionInformation`"; 
Engine btEngine = new Engine();
LabelFormatDocument btFormat = btEngine.Documents.Open(@"C:\NutritionLabel.btw");
((OLEDB)btFormat.DatabaseConnections[0]).SQLStatement = SQL; 

登入寫評論。