PHP Generate Report using web viewer

Options
chalia
edited February 11, 2022 in Analytics #1
I am currently use the codes similar as following to generate PDF, HTML and XLS code.

$run_url = 'http://localhost:8080/preview?__report=sample.rptdesign&__format=pdf';
$fp = fopen($run_url, 'r');
$content = '';
while(!feof($fp)){
$buffer = fgets($fp, 4096);
$content .= $buffer;
}
fclose($fp);

//then write content to a file
write_content_to_file($content);

As one of our legacy report has large set of data. We want to output the report in CSV format instead of XLS (excel) format.

Anyone find any idea to do so? I saw there is csv emitter on the web. But failed to deploy it on birt web viewer.