We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Starting in 2019, the Reporting control is no longer included in Essential Studio. If you're experiencing issues with the Syncfusion Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion and appreciate your understanding.

PHP

Hello, can the reportviewer be used with PHP? I'm developing an AngularJS app and we would like to use this control. Is there a workaround? Thanks in advance!

9 Replies

YD Yuvaraj Devarajan Syncfusion Team April 15, 2016 12:53 PM UTC

Hi Javier,

Thanks for contacting Syncfusion support.

You can able to render ReportViewer control in PHP and we are using WebAPI to process the report, so we have to provide the WebAPI service to process the report. We have prepared the sample and it can be downloaded from below location.
http://www.syncfusion.com/downloads/support/directtrac/general/ze/ReportSample-322557388.zip

Regards,
Yuvaraj D


JA Javier Aragon April 15, 2016 11:44 PM UTC

Thanks a lot for this example. It is very helpful. I have noticed that it still uses asp. Is there a way to do it in PHP? Something like this:

$scope.samplevalue = 'php/getlist.php/list/1';
$scope.path = 'reps/catlists.rdl';
$scope.mode = ej.ReportViewer.ProcessingMode.Local;
$scope.Reportdatasources = getDatasource();

function getDatasource() {
return [{
value: [
{
object1}, {object2}, {object3},
        ],
name: "DataSet1"
}]
}
Thanks again for your help!


SR Soundara Rajan S Syncfusion Team April 18, 2016 07:45 AM UTC

Hi Javier,

As per request, we have prepared a PHP sample with angular and it can be downloaded from below location,
http://www.syncfusion.com/downloads/support/forum/123733/ze/ReportViewerPhpDemo-851847762.zip

Regards,
Soundara Rajan S.


JA Javier Aragon April 18, 2016 02:33 PM UTC

Hello Soundara,

Excellent example it is very useful. I'm really sorry to boder you again with this bust I keep noticing the line $scope.samplevalue = 'http://ssrs.syncfusion.com/ReportingWebAPIService/api/SSRSReport'; is using ASP. The API is .Net, right? Is there a way to use PHP instead of ASP? I tried but in the browsers console I got the error :

angular.min.js:107 TypeError: Cannot read property 'selectItemsByIndices' of undefined
    at Object.t.widget._initToolbar (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:5220254)
    at Object.t.widget._initViewer (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:5056438)
    at Object.t.widget._init (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:5056004)
    at Object.<anonymous> (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:17786)
    at n.fn.(anonymous function) [as ejReportViewer] (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:18816)
    at post (http://localhost/gcf/libs/syncfusion/scripts/common/ej.widget.angular.min.js:10:8093)
    at ea (http://localhost/gcf/libs/angularjs/angular.min.js:73:293)
    at D (http://localhost/gcf/libs/angularjs/angular.min.js:62:190)
    at g (http://localhost/gcf/libs/angularjs/angular.min.js:55:105)
    at D (http://localhost/gcf/libs/angularjs/angular.min.js:62:134) <div id="container" ej-reportviewer="ej-reportviewer" e-processingmode="mode" e-reportpath="path" e-datasources="ds" style="height:680px" class="e-reportviewer e-js" tabindex="">

Is it because my backend is PHP?

Attachment: Error_d8e67e32.zip


YD Yuvaraj Devarajan Syncfusion Team April 19, 2016 08:59 AM UTC

Hi Javier,

 I'm really sorry to boder you again with this bust I keep noticing the line $scope.samplevalue = 'http://ssrs.syncfusion.com/ReportingWebAPIService/api/SSRSReport'; is using ASP. The API is .Net, right? Is there a way to use PHP instead of ASP?
Yes, we have created the shared WebAPI service link using ASP.Net WebAPI. We can consume the WebAPI service using PHP to render the report, but we could not use WebAPI in PHP.
I tried but in the browsers console I got the error :

angular.min.js:107 TypeError: Cannot read property 'selectItemsByIndices' of undefined
    at Object.t.widget._initToolbar (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:5220254)
    at Object.t.widget._initViewer (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:5056438)
    at Object.t.widget._init (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:5056004)
    at Object.<anonymous> (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:17786)
    at n.fn.(anonymous function) [as ejReportViewer] (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:18816)
    at post (http://localhost/gcf/libs/syncfusion/scripts/common/ej.widget.angular.min.js:10:8093)
    at ea (http://localhost/gcf/libs/angularjs/angular.min.js:73:293)
    at D (http://localhost/gcf/libs/angularjs/angular.min.js:62:190)
    at g (http://localhost/gcf/libs/angularjs/angular.min.js:55:105)
    at D (http://localhost/gcf/libs/angularjs/angular.min.js:62:134) <div id="container" ej-reportviewer="ej-reportviewer" e-processingmode="mode" e-reportpath="path" e-datasources="ds" style="height:680px" class="e-reportviewer e-js" tabindex="">

Is it because my backend is PHP?

We are unable to reproduce the mentioned issue and it’s working fine at our end. The issue might have occurred while rendering the toolbar control within the ReportViewer. So, share the reproducible sample with ej.web.all.min.js script and CSS files used in your application to validate the mentioned issue at our end. 





Regards,
Yuvaraj D


CA CarefreeXT replied to Javier Aragon September 13, 2018 09:18 AM UTC

Hello Soundara,

Excellent example it is very useful. I'm really sorry to boder you again with this bust I keep noticing the line $scope.samplevalue = 'http://ssrs.syncfusion.com/ReportingWebAPIService/api/SSRSReport'; is using ASP. The API is .Net, right? Is there a way to use PHP instead of ASP? I tried but in the browsers console I got the error :

angular.min.js:107 TypeError: Cannot read property 'selectItemsByIndices' of undefined
    at Object.t.widget._initToolbar (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:5220254)
    at Object.t.widget._initViewer (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:5056438)
    at Object.t.widget._init (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:5056004)
    at Object.<anonymous> (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:17786)
    at n.fn.(anonymous function) [as ejReportViewer] (http://localhost/gcf/libs/syncfusion/scripts/web/ej.web.all.min.js:10:18816)
    at post (http://localhost/gcf/libs/syncfusion/scripts/common/ej.widget.angular.min.js:10:8093)
    at ea (http://localhost/gcf/libs/angularjs/angular.min.js:73:293)
    at D (http://localhost/gcf/libs/angularjs/angular.min.js:62:190)
    at g (http://localhost/gcf/libs/angularjs/angular.min.js:55:105)
    at D (http://localhost/gcf/libs/angularjs/angular.min.js:62:134) <div id="container" ej-reportviewer="ej-reportviewer" e-processingmode="mode" e-reportpath="path" e-datasources="ds" style="height:680px" class="e-reportviewer e-js" tabindex="">

Is it because my backend is PHP?

Attachment: Error_d8e67e32.zip

Hello,If create one empty jquery object,then this similar problem will occur at this time.
for example:
$("<div />").ejReportViewer().appendTo("body");

ej.web.all.min.js:10 Uncaught TypeError: Cannot read property 'clientHeight' of null at Object._renderViewer (ej.web.all.min.js:10) at Object._init (ej.web.all.min.js:10) at new <anonymous> (ej.web.all.min.js:10) at w.fn.init.n.fn.(anonymous function) [as ejReportViewer] (http://localhost:8080/ej/web/ej.web.all.min.js:10:24081) at Object.<anonymous> (app.ts:18) at Object.execCb (require.js:1696) at Module.check (require.js:883) at Module.<anonymous> (require.js:1139) at require.js:134 at require.js:1189

If me dynamic create one ejDialog and content is ejReportViewer,then this problem will happen at this time.
I think the reason is div has't in current html page,but some calculte logic is need,so is error.


MM Mageshyadav M Syncfusion Team September 14, 2018 01:22 PM UTC

Hi Li, 
 
We have checked the mentioned problem by initializing the ReportViewer component and its working properly at our end. On further analysis of the shared code snippet it seems to be the ReportViewer is not initialized in PHP platform. So can you please confirm your platform used to initialize the ReportViewer and also share the ReportViewer initialization page which would be helpful for us to validate the mentioned problem at our end.  
 
Regards, 
Mageshyadav.M 



CA CarefreeXT September 15, 2018 12:48 AM UTC

Hello, I has't PHP development environment.
If you think reproduce the problem,you only need one html file.Add some javascript code in startup script.

for example.
$("<div />").ejReportViewer().appendTo("body");

Or you can dynamic create one ejDialog,it content is ejReportViewer(it is dynamic created).

summary dynamic create one ejReportViewer and appendTo current html page,can reproduce the problem.



MM Mageshyadav M Syncfusion Team September 18, 2018 01:59 PM UTC

Hi Li, 
 
On further analysis of the shared code example, you have initialized the ReportViewer control to the dynamic creating div element before appending to the body tag or any root element. So can you please initialize the ReportViewer control to div element after appending to the body tag and also specify the ID for dynamically created div element as shown in below code example to avoid the mentioned problem at your end, 
 
 
$("<div id='test'/>").css({ height: "600px", width: "950px" }).appendTo("body").ejReportViewer();     
 
 
Regards, 
Mageshyadav.M 


Loader.
Live Chat Icon For mobile
Up arrow icon