Downloads a report file encoded in UTF-8. (reports.getFile)

@param string $reportId ID of the report.
@param int $reportFragment The index of the report fragment to download.
@param array $optParams Optional parameters.
546254
public function getFile($reportId, $reportFragment, $optParams = array())
  {
    $params = array('reportId' => $reportId, 'reportFragment' => $reportFragment);
    $params = array_merge($params, $optParams);
    return $this->call('getFile', array($params));
  }
665218
public function request(Google_Service_Doubleclicksearch_ReportRequest $postBody, $optParams = array())
  {
    $params = array('postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('request', array($params), "Google_Service_Doubleclicksearch_Report");
  }
408528
public function get($id, $optParams = array()) {
      $params = array('id' => $id);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new SiteVerificationWebResourceResource($data);
      } else {
        return $data;
      }
    }
1141956
protected function addTokenToDocument(\Zend_Pdf $pdf, $tokenId, $surveyId)
    {
        $token = strtoupper($tokenId);

        foreach (array('Title', 'Subject', 'Keywords') as $name) {
            if (isset($pdf->properties[$name])) {
                $orgValue = $pdf->properties[$name];
                if (mb_detect_encoding($orgValue) === false) {
                    // Assume UTF-16
                    mb_convert_encoding($orgValue, mb_internal_encoding(), 'UTF-16');
                }
                $value = rtrim($orgValue) . ' ' . $token;
            } else {
                $value = $token;
            }
            $pdf->properties[$name] = $value;
        }
        // Acrobat defined date format D:YYYYMMDDHHmmSSOHH'mm
        $pdf->properties['ModDate']  = 'D:' . str_replace(':', "'", date('YmdHisP')) . "'";
        $pdf->properties['Producer'] = $this->project->getName();       // Avoid warning on Word with a (R) symbol
        $pdf->properties['Creator']  = $this->project->getName();       // Avoid warning on Word with a (R) symbol
        $pdf->properties['Author']   = $this->project->getName();       // Avoid warning on Word with a (R) symbol
    }
675347
private function getFillOpts($opts)
	{
		$this->debug->group(__CLASS__.'->'.__FUNCTION__);
		$arrayUtil = new ArrayUtil();
		$opts = $arrayUtil->mergeDeep(array(
			'output_file'	=> 'temporary',	// if null is passed, raw pdf will be returned
			'fillcolor'		=> null,		// font-color
			'checkbox_opts'	=> array(
				'fontname'		=> 'ZapfDingbats',
				'textformat'	=> 'utf16be',
				'encoding'		=> 'unicode',
				'position'		=> 'center',
				'bordercolor'	=> '#C0C0C0',	// or null
				// 'fontsize'	=> 12,
			),
			'checkbox_value'	=> "\x27\x18",
			'radio_opts'	=> array(
				'fontname'		=> 'ZapfDingbats',
				'textformat'	=> 'utf16be',
				'encoding'		=> 'unicode',
				'position'		=> 'center',
				'bordercolor'	=> '#C0C0C0',	// or null
				// 'fontsize'	=> 12,
			),
			'radio_value'	=> "\x25\xCF",
			'text_opts'		=> array(
				'bordercolor'	=> 'none',
			),
			'name_trans_func'	=> array(),			// function and parameters to transform block name
			'info' => array(),
		), $opts);
		if ($opts['output_file'] == 'temporary') {
			$temp_dir = sys_get_temp_dir();
			$opts['output_file'] = tempnam($temp_dir, 'pdf');
		}
		$this->debug->groupEnd();
		return $opts;
	}
1162082
public function exportCachedReportAction($requestId, $format) {
        //Get the export data
        $export = $this->container->get('mesd.jasper.report.loader')->getReportLoader()->getCachedReport($requestId, $format);

        //Create the response
        $response = new Response();

        //Set the headers
        if (self::FORMAT_PDF === $format) {
            $response->headers->set('Content-Type', 'application/pdf');
        }
        $response->headers->set('Content-Disposition', 'attachment;filename="' . $export->getUri() . '.' . $format . '"');
        $response->headers->set('Content-Transfer-Encoding', 'binary');
        $response->headers->set('Pragma', 'no-cache');
        $response->headers->set('Expires', '0');

        //Set the content of the response
        $response->setContent($export->getOutput());

        //Return the final response
        return $response;
    }
1224444
public static function replaceFragment($uri, $newFragment = '')
    {
        if ($uri === null) {
            $uri = static::getCurrentRequestUri();
        }
        $oldFragment = parse_url($uri, PHP_URL_FRAGMENT);
        return $oldFragment
            ? str_replace('#' . $oldFragment, '#' . $newFragment, $uri)
            : ($newFragment ? $uri . '#' . $newFragment : $uri);
    }
228772
public static String readAsString(String reportPath) throws IOException {
		StringBuffer fileData = new StringBuffer(1000);
		BufferedReader reader = new BufferedReader(new FileReader(reportPath));
		char[] buf = new char[1024];
		int numRead = 0;
		while ((numRead = reader.read(buf)) != -1) {
			fileData.append(buf, 0, numRead);
		}
		reader.close();
		return fileData.toString();
	}
372583
public function get($project, $region, $optParams = array()) {
      $params = array('project' => $project, 'region' => $region);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Google_Region($data);
      } else {
        return $data;
      }
    }
415720
public function listreports($queryId, $optParams = array())
  {
    $params = array('queryId' => $queryId);
    $params = array_merge($params, $optParams);
    return $this->call('listreports', array($params), "Google_Service_DoubleClickBidManager_ListReportsResponse");
  }
1056315
public FastDeserializer executePlanFragments(
            int numFragmentIds,
            long[] planFragmentIds,
            long[] inputDepIds,
            Object[] parameterSets,
            DeterminismHash determinismHash,
            String[] sqlTexts,
            boolean[] isWriteFrags,
            int[] sqlCRCs,
            long txnId,
            long spHandle,
            long lastCommittedSpHandle,
            long uniqueId,
            long undoQuantumToken,
            boolean traceOn) throws EEException
    {
        try {
            // For now, re-transform undoQuantumToken to readOnly. Redundancy work in site.executePlanFragments()
            m_fragmentContext = (undoQuantumToken == Long.MAX_VALUE) ? FragmentContext.RO_BATCH : FragmentContext.RW_BATCH;

            // reset context for progress updates
            m_sqlTexts = sqlTexts;

            if (traceOn) {
                final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPSITE);
                if (traceLog != null) {
                    traceLog.add(() -> VoltTrace.beginDuration("execplanfragment",
                                                               "txnId", TxnEgo.txnIdToString(txnId),
                                                               "partition", Integer.toString(m_partitionId)));
                }
            }

            FastDeserializer results = coreExecutePlanFragments(m_currentBatchIndex, numFragmentIds, planFragmentIds,
                    inputDepIds, parameterSets, determinismHash, isWriteFrags, sqlCRCs, txnId, spHandle, lastCommittedSpHandle,
                    uniqueId, undoQuantumToken, traceOn);

            if (traceOn) {
                final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPSITE);
                if (traceLog != null) {
                    traceLog.add(VoltTrace::endDuration);
                }
            }

            m_plannerStats.updateEECacheStats(m_eeCacheSize, numFragmentIds - m_cacheMisses,
                    m_cacheMisses, m_partitionId);
            return results;
        }
        finally {
            // don't count any cache misses when there's an exception. This is a lie and they
            // will still be used to estimate the cache size, but it's hard to count cache hits
            // during an exception, so we don't count cache misses either to get the right ratio.
            m_cacheMisses = 0;

            m_sqlTexts = null;

            m_fragmentContext = FragmentContext.UNKNOWN;
        }
    }
818703
public function getByUrl($optParams = array()) {
      $params = array();
      $params = array_merge($params, $optParams);
      $data = $this->__call('getByUrl', array($params));
      if ($this->useObjects()) {
        return new Blog($data);
      } else {
        return $data;
      }
    }
1041722
public function patch($mutesId, Google_Service_Reportcard_Mute $postBody, $optParams = array())
  {
    $params = array('mutesId' => $mutesId, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('patch', array($params), "Google_Service_Reportcard_Mute");
  }
1113977
public function report($reportName, $report, $path)
    {
        switch ($reportName) {
            case '{DAV:}principal-property-search':
                $this->server->transactionType = 'report-principal-property-search';
                $this->principalPropertySearchReport($path, $report);

                return false;
            case '{DAV:}principal-search-property-set':
                $this->server->transactionType = 'report-principal-search-property-set';
                $this->principalSearchPropertySetReport($path, $report);

                return false;
            case '{DAV:}expand-property':
                $this->server->transactionType = 'report-expand-property';
                $this->expandPropertyReport($path, $report);

                return false;
            case '{DAV:}principal-match':
                $this->server->transactionType = 'report-principal-match';
                $this->principalMatchReport($path, $report);

                return false;
            case '{DAV:}acl-principal-prop-set':
                $this->server->transactionType = 'acl-principal-prop-set';
                $this->aclPrincipalPropSetReport($path, $report);

                return false;
        }
    }
1125879
public function getLanguage($userId, $optParams = array())
  {
    $params = array('userId' => $userId);
    $params = array_merge($params, $optParams);
    return $this->call('getLanguage', array($params), "Google_Service_Gmail_LanguageSettings");
  }
825293
private function getDownloadUrl($exportFormat)
    {
        $reportJobStatus = $this->reportService
            ->getReportJobStatus($this->reportJobId);
        if ($reportJobStatus === ReportJobStatus::IN_PROGRESS) {
            throw new UnexpectedValueException(
                sprintf(
                    'Report %d must be completed before downloading. '
                    . 'Report is still %s.',
                    $this->reportJobId,
                    ReportJobStatus::IN_PROGRESS
                )
            );
        } elseif ($reportJobStatus === ReportJobStatus::FAILED) {
            throw new UnexpectedValueException(
                sprintf(
                    'Cannot download report %d because it has a status of %s.',
                    $this->reportJobId,
                    ReportJobStatus::FAILED
                )
            );
        }

        return $this->reportService->getReportDownloadURL(
            $this->reportJobId,
            $exportFormat
        );
    }
474661
public function batchGet(Google_Service_AnalyticsReporting_GetReportsRequest $postBody, $optParams = array())
  {
    $params = array('postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('batchGet', array($params), "Google_Service_AnalyticsReporting_GetReportsResponse");
  }