Skip to main content

Search

Search

Pass Command Line Data To Print

Comments

3 comments

  • Avatar
    Ian Cummings
    Moderator

    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
    Moderator

    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; 
    
    
    0

Please sign in to leave a comment.