রিপোর্ট ডাউনলোড করুন

একটি Display & Video 360 রিপোর্ট সফলভাবে জেনারেট করা শেষ হলে, Report রিসোর্সে Google ক্লাউড স্টোরেজ পাথ থেকে জেনারেট করা রিপোর্ট ফাইলটি ডাউনলোড করুন।

রিপোর্ট থেকে পাথ পুনরুদ্ধার এবং রিপোর্ট ফাইল ডাউনলোড করার উপায় এখানে:

জাভা

// The ID of the parent query.
Long queryId = query-id;

// The ID of the report to download.
Long reportId = report-id;

// The path to which to download the file.
String outputFilePath = output-file-path;

// Retrieve the report resource.
Report report =
    service.queries().reports().get(queryId, reportId).execute();

// Download report file.
System.out.println("Downloading report file.");
DownloadUtils.downloadFileFromCloudStorage(
    report.getMetadata().getGoogleCloudStoragePath(), outputFilePath);
System.out.printf(
    "Report %s successfully downloaded at %s.%n",
    report.getKey().getReportId(), outputFilePath);

পাইথন

# The ID of the parent query.
query_id = query-id

# The ID of the relevant report resource.
report_id = report-id

# The path to which to download the file.
output_file_path = output-file-path

# Retrieve report.
report = service.queries().reports().get(
   queryId=query_id,
   reportId=report_id
).execute()

cloud_storage_path = report["metadata"]["googleCloudStoragePath"]

# Download file.
with open(output_file_path, "wb") as output:
  with closing(urlopen(cloud_storage_path)) as url:
    output.write(url.read())
  print("Download complete.")

পিএইচপি

// The ID of the parent query.
$queryId = query-id;

  // The ID of the report to download.
$reportId = report-id;

// The path to which to download the file.
$outputFilePath = output-file-path;

// Retrieve the report resource.
$report = $this->service->queries_reports->get($queryId, $reportId);

// Download the file.
file_put_contents(
    $outputFilePath,
    fopen($report->getMetadata()->getGoogleCloudStoragePath(), 'r')
);

printf(
    'Report %s successfully downloaded at %s.<br>',
    $reportId,
    $outputFilePath
);