protected function getDataProvider(Report $report, $stickyKey, $runReport)
 {
     assert('is_string($stickyKey) || is_int($stickyKey)');
     assert('is_bool($runReport)');
     $getData = GetUtil::getData();
     if (isset($getData['clearRuntimeFilters']) && $getData['clearRuntimeFilters']) {
         StickyReportUtil::clearDataByKey($stickyKey);
     }
     if (null != ($stickyData = StickyReportUtil::getDataByKey($stickyKey))) {
         StickyReportUtil::resolveStickyDataToReport($report, $stickyData);
     }
     $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('reportResultsListPageSize', get_class($this->getModule()));
     $dataProvider = ReportDataProviderFactory::makeByReport($report, $pageSize);
     if ($runReport) {
         $dataProvider->setRunReport($runReport);
     }
     return $dataProvider;
 }
 public static function makeReportDataProviderAndResolveAttributeName($id, $pageSize, &$attributeName)
 {
     assert('is_int($pageSize)');
     $savedReport = SavedReport::getById($id);
     $report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
     foreach ($report->getDisplayAttributes() as $key => $displayAttribute) {
         if ($displayAttribute->getAttributeIndexOrDerivedType() == 'id') {
             $attributeName = ReportResultsRowData::resolveAttributeNameByKey($key);
             break;
         }
     }
     if ($attributeName == null) {
         $moduleClassName = $report->getModuleClassName();
         $modelClassName = $moduleClassName::getPrimaryModelName();
         $displayAttribute = new DisplayAttributeForReportForm($moduleClassName, $modelClassName, $report->getType());
         $displayAttribute->attributeIndexOrDerivedType = 'id';
         $report->addDisplayAttribute($displayAttribute);
         $attributeName = ReportResultsRowData::resolveAttributeNameByKey($key + 1);
     }
     return ReportDataProviderFactory::makeByReport($report, $pageSize);
 }
 protected function getDataProviderForExport(Report $report, $stickyKey, $runReport)
 {
     assert('is_string($stickyKey) || is_int($stickyKey)');
     assert('is_bool($runReport)');
     if (null != ($stickyData = StickyReportUtil::getDataByKey($stickyKey))) {
         StickyReportUtil::resolveStickyDataToReport($report, $stickyData);
     }
     $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('reportResultsListPageSize', get_class($this->getModule()));
     $dataProvider = ReportDataProviderFactory::makeByReport($report, $pageSize);
     if (!$dataProvider instanceof MatrixReportDataProvider) {
         $totalItems = intval($dataProvider->calculateTotalItemCount());
         $dataProvider->getPagination()->setPageSize($totalItems);
     }
     if ($runReport) {
         $dataProvider->setRunReport($runReport);
     }
     return $dataProvider;
 }