ChartBlocks / php-ssrs

PHP library for connecting to SSRS over SOAP
MIT License
25 stars 22 forks source link

Toolbar not showing #18

Closed dpossidonio closed 9 years ago

dpossidonio commented 9 years ago

Hi,

I am trying to use the library to render some reports and I have some Issues:

$output = $ssrs->render('HTML4.0', array('Toolbar' => true));

I also noticed that long reports are note paged, resulting in a huge scroll throughout the report.

How can I solve this issues?

Thank you!

rb-cohen commented 9 years ago

Hi @dpossidonio,

Unfortunately the 'Toolbar' option doesn't do what we'd all like it to. From the SSRS docs:

The toolbar is not rendered through the SOAP API. However, the Toolbar device information setting affects the way that the report is displayed when using the SOAP method Render. If the value of this parameter is true when using SOAP to render to HTML, only the first section of the report is rendered. If the value is false, the entire HTML report is rendered as a single HTML page. https://technet.microsoft.com/en-us/library/aa179583(v=sql.80).aspx

On that same page it mentions the 'Section' parameter, where if you set it to >0 it should paginate and return the page specified.

If you wanted the toolbar you probably want to display the parameters? To create a form of parameters for a user to manipulate you can take the parameters from the ExecutionInfo and build a form. In the master branch on Github there is a class to do this using Zend\Form that you could use, or create your own form adapter using Symfony Form or something custom. The class is: https://github.com/ChartBlocks/php-ssrs/blob/master/library/SSRS/Form/Adapter/ZendFramework2.php

Unfortunately SSRS doesn't make it as easy as perhaps it could, and php-ssrs is a little thinner than I'd like - so there are some gaps to fill in your own app. If I can be of assistance just ask.

dpossidonio commented 9 years ago

Hi @rb-cohen,

Thanks for your quick answer!

I think that is all I need to know. I will build a form, to send the parameters. There is any way to see how many pages did the report returned in order to implement the logic in the client side?

Thanks again, Regards

rb-cohen commented 9 years ago

It should all be in the ExecutionInfo, which is the object returned by most of the methods (i.e. Render, loadReport, setExeuctionParameters).

$executionInfo = $ssrs->loadReport($path);
var_dump($executionInfo->NumPages);
dpossidonio commented 9 years ago

Cool! Thanks a lot.

Cheers.