using System; using System.Reflection; using Produmex.Foundation.Data.Sbo; using Produmex.Foundation.Diagnostics; using Produmex.Sbo.Logex.Data.BusinessObjects; using Produmex.Sbo.Logex.Data.Providers; using Produmex.Foundation.Data.Sbo.BusinessObjects; using Produmex.Foundation.Data.Sbo.Utilities; using Produmex.Foundation.Data.SqlClient; public class Script { private static readonly ILog s_log = LogProvider.GetLogger(MethodInfo.GetCurrentMethod().DeclaringType); public static bool PrintReport(PmxPrintReportEventType eventType, int key, PmxDbConnection dbConn) { //Create the query you want to use //string query = "SELECT LEN(COALESCE(U_EUM_FORWARDER,'')) FWRDR FROM ODLN WHERE DocEntry = " string query = "SELECT LEN(COALESCE(LUID,'')) LUID FROM PMX_CUSTOMVIEW_CUST WHERE LUID = " + key.ToString(); //Run the query using (ISboRecordset rs = SboRecordsetHelper.RunQuery(s_log, query, dbConn)) { if (!rs.EoF)//Check if you get result from the query { // string var1 = rs.GetTypedValue("COLUMNAME");//Get a string value int var2 = rs.GetTypedValue("LUID");//Get an int value //Possibility to add a check on the result //In this case if the value of var2=LUID extracted from the View is not NULL //a label should be printed if (var2 > 0) { return true; //Label will be printed } else { return false; //Label will not be printed } } } return false; //Label will not be printed } }