We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

PHP API - Generating a Report

The https://products.aspose.cloud/words/php/report/ page shows a graph with LINQ expressions.

Is the graph created in the document via the PHP API or is it done within the word document?

If the graph is a part of the word document it would be useful to be able to download the template.docx used in the code to see how the graph is setup - is this available?


We will provide you specified template document soon. Meanwhile, you can check the following documentation and github repo for more Reporting engine templates.


Please find the required sample template and data file along with the sample code.



try {

	//TODO: Get your ClientID and ClientSecret at https://dashboard.aspose.cloud (free registration is required).		

	$wordsApi = new Aspose\Words\WordsApi($ClientId,$ClientSecret);	
        $reportingFolder = "data";
        $localDocumentFile = "Chart.docx";
        $localDataFile = file_get_contents($reportingFolder . "/Chart.json");

        $requestTemplate = $reportingFolder . "/" . $localDocumentFile;
        $requestReportEngineSettings = new Aspose\Words\Model\ReportEngineSettings(array(
            "data_source_type" => "Json",
            "json_data_load_options" => new Aspose\Words\Model\JsonDataLoadOptions(array("exact_date_time_parse_formats" => array("dd.MM.yyyy")))
        $request = new Aspose\Words\Model\Requests\BuildReportOnlineRequest(

        $result = $wordsApi->buildReportOnline($request);
        copy($result->getPathName(),$reportingFolder . "/Chart_out.docx");
} catch (Exception $e) {
    echo  "Something went wrong: ",  $e->getMessage(), "\n";


Chart.zip (21.2 KB)

Thank you for supplying the Word document and sample code.

1 Like