<?php
$reportUrl = 'http://test/Reports/report/Reports/testreport';
$username = 'A';
$password = 'P';
$ch = curl_init($reportUrl);
curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:; ' . curl_error($ch);
} else {
header('Content-Type: application/pdf');
echo $response; // Output the report content
}
curl_close($ch);
?>
output : Error
Failed to load PDF document.
มีวิธีแก้ไขยังไงบ้างครับ
สอบถามเรื่อง ออก report builber .rdl ด้วย php ครับ
$reportUrl = 'http://test/Reports/report/Reports/testreport';
$username = 'A';
$password = 'P';
$ch = curl_init($reportUrl);
curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:; ' . curl_error($ch);
} else {
header('Content-Type: application/pdf');
echo $response; // Output the report content
}
curl_close($ch);
?>
output : Error
Failed to load PDF document.
มีวิธีแก้ไขยังไงบ้างครับ