跳到主内容

搜索

搜索

Pass Command Line Data To Print

评论

3 条评论

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

请先登录再写评论。