自定义报告表查询布尔列

时间:2015-11-17 20:42:32

标签: reporting kentico

我是Kentico的新手,到目前为止真的很喜欢开发!我已经用尽所有搜索工作,并认为我会联系社区。我正在使用Kentico内置的报告创建自定义报告(确切地说)。我有一个自定义查询:

Select FirstName as [First Name], LastName as [Last Name], Email, Phone, StreetAddress as [Street Address], City, State, Country, Zip, Email, Phone, PaymentDate as [Payment Date], TransactionID as [Transaction ID], PaymentStatus as [Payment Status]
from TableName E
WHERE E.ID = 1 AND E.PaymentStatus = False
ORDER BY E.ItemCreatedWhen ASC

我发现的问题是PaymentStatus将通过“Checkbox - unchecked or checked”而不是True或False。在实际的表和数据中它显示True / False。有没有办法解决?谢谢你的帮助!

1 个答案:

答案 0 :(得分:3)

我得到相同的复选框,您可以通过在CASE中包装布尔(位)字段来获取文本值。您的报表查询将如下所示;

class OracleSessionInit 
{

    protected $_defaultSessionVars = array(
        'NLS_TIME_FORMAT' => "HH24:MI:SS",
        'NLS_DATE_FORMAT' => "YYYY-MM-DD HH24:MI:SS",
        'NLS_TIMESTAMP_FORMAT' => "YYYY-MM-DD HH24:MI:SS",
        'NLS_TIMESTAMP_TZ_FORMAT' => "YYYY-MM-DD HH24:MI:SS TZH:TZM",
        'NLS_NUMERIC_CHARACTERS' => ".,",
    );

    /**
     * @param \Doctrine\DBAL\Event\ConnectionEventArgs $args
     *
     * @return void
     */
    public function postConnect(ConnectionEventArgs $args)
    {
        if (count($this->_defaultSessionVars)) {
            array_change_key_case($this->_defaultSessionVars, \CASE_UPPER);
            $vars = array();
            foreach ($this->_defaultSessionVars as $option => $value) {
                $vars[] = $option." = '".$value."'";
            }
            $sql = "ALTER SESSION SET ".implode(" ", $vars);
            $args->getConnection()->executeUpdate($sql);
        }
    }
}