Get list of scheduled reports

@param int $idReport
@param string $language
@param string $outputType
@param string $reportFormat
@param string $parameters
@param array $optional
@return bool|object
@throws InvalidRequestException
774684
public function generateReport(
        $idReport,
        $language = '',
        $outputType = '',
        $reportFormat = '',
        $parameters = '',
        array $optional = []
    )
    {
        return $this->_request('ScheduledReports.generateReport', [
            'idReport' => $idReport,
            'language' => $language,
            'outputType' => $outputType,
            'reportFormat' => $reportFormat,
            'parameters' => $parameters,
        ], $optional);
    }
908810
def start_report(self, report, account_id, _parameters=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - account_id
        """ID"""
        path["account_id"] = account_id

        # REQUIRED - PATH - report
        """ID"""
        path["report"] = report

        # OPTIONAL - [parameters]
        """The parameters will vary for each report"""
        if _parameters is not None:
            data["[parameters]"] = _parameters

        self.logger.debug("POST /api/v1/accounts/{account_id}/reports/{report} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/accounts/{account_id}/reports/{report}".format(**path), data=data, params=params, single_item=True)
874120
public function getFormatsFromOperation(string $resourceClass, string $operationName, string $operationType): array
    {
        $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);

        if (!$formats = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'formats', [], true)) {
            return $this->configuredFormats;
        }

        if (!\is_array($formats)) {
            throw new InvalidArgumentException(sprintf("The 'formats' attributes must be an array, %s given for resource class '%s'.", \gettype($formats), $resourceClass));
        }

        return $this->getOperationFormats($formats);
    }
1292081
public function report($reportName, $report, $path)
    {
        switch ($reportName) {
            case '{'.self::NS_CALDAV.'}calendar-multiget':
                $this->server->transactionType = 'report-calendar-multiget';
                $this->calendarMultiGetReport($report);

                return false;
            case '{'.self::NS_CALDAV.'}calendar-query':
                $this->server->transactionType = 'report-calendar-query';
                $this->calendarQueryReport($report);

                return false;
            case '{'.self::NS_CALDAV.'}free-busy-query':
                $this->server->transactionType = 'report-free-busy-query';
                $this->freeBusyQueryReport($report);

                return false;
        }
    }
1310717
public static function renderReport($report, $domain, $type, $stream) {
		$report = nl2br($report);
		$rendering = new static();
		if( $rendering->existsLayoutPath('report-'.$type) ) {
			return $rendering->render('report-'.$type, array('Report'=>$report, 'Domain'=>$domain, 'Type'=>$type, 'Stream'=>$stream));
		}
		if( $rendering->existsLayoutPath('report') ) {
			return $rendering->render('report', array('Report'=>$report, 'Domain'=>$domain, 'Type'=>$type, 'Stream'=>$stream));
		}
// 		if( file_exists(static::getLayoutPath('report-'.$type)) ) {
// 			return static::doRender('report-'.$type, array('Report'=>$report, 'Domain'=>$domain, 'Type'=>$type, 'Stream'=>$stream));
// 		}
// 		if( file_exists(static::getLayoutPath('report')) ) {
// 			return static::doRender('report', array('Report'=>$report, 'Domain'=>$domain, 'Type'=>$type, 'Stream'=>$stream));
// 		}
		return '
		<div class="report report_'.$stream.' '.$type.' '.$domain.'">'.nl2br($report).'</div>';
	}
300491
private function request(ReportRequest $reportRequest, array $options = [])
    {
        $reportDefinition = $reportRequest->getDefinition();

        if (empty($reportDefinition)) {
            throw new ReportDefinitionException(sprintf(
                'The report definition cannot be empty. Was expected XML document. You can build it with builder %s.',
                ReportDefinitionBuilder::class
            ));
        }

        $request = new Request(
            'POST',
            $this->user->resolveWsdl(self::ENDPOINT),
            $this->buildRequestHeaders($reportRequest),
            $reportDefinition
        );
        $invoker = $this->user->getInvoker();

        return $invoker(function () use ($request, $options, $reportRequest) {
            $this->lastRequest = $request;

            $event = new PreCallEvent('Reports:request', [$reportRequest], $this->user);
            $this->dispatcher->dispatch(Events::BEFORE_REQUEST, $event);

            $response = $this->httpClient->send($request, $options + [
                RequestOptions::HTTP_ERRORS => false,
            ]);
            $this->lastResponse = $response;

            if ($response->getStatusCode() >= 200 && $response->getStatusCode() <= 202) {
                $event = new PostCallEvent(
                    'Reports:request',
                    [$reportRequest],
                    $this->user,
                    $this,
                    $response->getBody()
                );
                $this->dispatcher->dispatch(Events::AFTER_REQUEST, $event);

                return $response;
            }

            $exception = $this->createException($response);

            $event = new FailCallEvent('Reports:request', [$reportRequest], $this->user, $this, $exception);
            $this->dispatcher->dispatch(Events::FAIL_REQUEST, $event);

            throw $exception;
        });
    }
1013272
public function getCalendarId(EntityInterface $entity, ArrayObject $options, $map = null)
    {
        $result = null;

        if (empty($options['calendar'])) {
            return $result;
        }

        $result = $options['calendar']->id;

        return $result;
    }
1316402
public static function getRequestedTodayByIp(string $ip, int $type_id)
    {
        $query = self::find()
            ->where([
                'ip' => $ip,
                'is_validated' => 0,
                'is_deleted' => 0,
            ])
            ->andWhere(['between', 'created_at', time() - DateHelper::TIME_DAY_ONE, time()])
            ->andWhere(['type_id' => $type_id]);

        return $query->count();
    }
765820
public function listJobResults($type, $count = null, array $options = [])
    {
        $urlQuery = null;

        /** @var AbstractHttpRequest $request */
        $request          = $this->getRequest();
        $request->options = $options;
        $request->path    = $this->client->fullDatabasePath . static::API_PATH . '/' . $type;
        $urlQueryStr      = '';

        if ($count) {
            $urlQuery    = ['count' => $count];
            $urlQueryStr = $request->buildUrlQuery($urlQuery);
        }

        $request->path .= $urlQueryStr;

        $request->method = static::METHOD_GET;

        return $this->getReturnObject($request);
    }
1035493
public void scheduleReports(@Nullable File report, boolean onlySendSilentReports) {
        if (report != null) {
            if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Mark " + report.getName() + " as approved.");
            final File approvedReport = new File(locator.getApprovedFolder(), report.getName());
            if (!report.renameTo(approvedReport)) {
                ACRA.log.w(LOG_TAG, "Could not rename approved report from " + report + " to " + approvedReport);
            }
        }
        if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Schedule report sending");
        senderScheduler.scheduleReportSending(onlySendSilentReports);
    }
232214
static private SnowflakeDateTimeFormat specializedFormatter(
      Map<String, Object> parameters,
      String id,
      String param,
      String defaultFormat)
  {
    String sqlFormat =
        SnowflakeDateTimeFormat.effectiveSpecializedTimestampFormat(
            (String) effectiveParamValue(parameters, param),
            defaultFormat);
    SnowflakeDateTimeFormat formatter = new SnowflakeDateTimeFormat(sqlFormat);
    if (logger.isDebugEnabled())
    {
      logger.debug("sql {} format: {}, java {} format: {}",
                   id, sqlFormat,
                   id, formatter.toSimpleDateTimePattern());
    }
    return formatter;
  }
1294503
public static function checkReportTaskDelivery()
    {
        // get report tasks
        $reportTasks = ReportTask::builder()
            ->whereNotNull('next_run_023')
            ->where('next_run_023', '<', date('U'))
            ->get();

        foreach ($reportTasks as $reportTask)
            self::executeReportTask($reportTask);

    }
741188
private function prepareReport(InputInterface $input, LoggerInterface $logger)
    {
        $reportMap = array();
        if ($input->getOption('strict')) {
            $reportMap = array(
                DestinationInterface::SEVERITY_ERROR   => DestinationInterface::SEVERITY_ERROR,
                DestinationInterface::SEVERITY_WARNING => DestinationInterface::SEVERITY_ERROR,
                DestinationInterface::SEVERITY_INFO    => DestinationInterface::SEVERITY_ERROR,
            );
        }

        $destinations   = array();
        $destinations[] = new PsrLogDestination($logger);

        $report = new Report($destinations, $reportMap);

        return $report;
    }
244287
public function get($idSite, $period, $date, $segment = false, $columns = false)
    {
        Piwik::checkUserHasViewAccess($idSite);

        $report = ReportsProvider::factory("Actions", "get");
        $archive = Archive::build($idSite, $period, $date, $segment);

        $requestedColumns = Piwik::getArrayFromApiParameter($columns);
        $columns = $report->getMetricsRequiredForReport($allColumns = null, $requestedColumns);

        $inDbColumnNames = array_map(function ($value) { return 'Actions_' . $value; }, $columns);
        $dataTable = $archive->getDataTableFromNumeric($inDbColumnNames);

        $dataTable->deleteColumns(array_diff($requestedColumns, $columns));

        $newNameMapping = array_combine($inDbColumnNames, $columns);
        $dataTable->filter('ReplaceColumnNames', array($newNameMapping));

        $columnsToShow = $requestedColumns ?: $report->getAllMetrics();
        $dataTable->queueFilter('ColumnDelete', array($columnsToRemove = array(), $columnsToShow));

        return $dataTable;
    }
715681
public function getExampleReport($idSite, $period, $date, $segment = false)
    {
        $table = new DataTable();

        $table->addRowFromArray(array(Row::COLUMNS => array('nb_visits' => 5)));

        return $table;
    }
1294681
protected function getDataTable($idSite, $period, $date, $segment, $expanded, $flat, $idSubtable)
    {
        $dataTable = Archive::createDataTableFromArchive(Archiver::CUSTOM_VARIABLE_RECORD_NAME, $idSite, $period, $date, $segment, $expanded, $flat, $idSubtable);
        $dataTable->queueFilter('ColumnDelete', 'nb_uniq_visitors');

        if ($flat) {
            $dataTable->filterSubtables('Sort', array(Metrics::INDEX_NB_ACTIONS, 'desc', $naturalSort = false, $expanded));
            $dataTable->queueFilterSubtables('ColumnDelete', 'nb_uniq_visitors');
        }

        return $dataTable;
    }
446405
public function reportItem($type, Model $model, $id, $reason = null, $user_id = null) {
        $report = ClassRegistry::init('Admin.ItemReport');

        // Validate type
        if (!$report->enum('type', $type)) {
            throw new InvalidArgumentException(__d('admin', 'Invalid item report type'));
        }

        // Get model ID if null
        if (!$id) {
            $id = $model->id;
        }

        // Get logged in user ID
        if (!$user_id) {
            $user_id = $this->Auth->user('id');
        }

        // Validate record
        $result = $this->getRecordById($model, $id);

        if (!$result) {
            throw new NotFoundException();
        }

        return $report->reportItem(array(
            'reporter_id' => $user_id,
            'type' => $type,
            'model' => ($model->plugin ? $model->plugin . '.' : '') . $model->name,
            'foreign_key' => $id,
            'item' => $result[$model->alias][$model->displayField],
            'reason' => $reason
        ));
    }