luisdias / CakePHP-Report-Manager-Plugin

CakePHP 2.x Report Manager Plugin
MIT License
42 stars 22 forks source link

Loading saved reports #7

Closed georgetony closed 11 years ago

georgetony commented 11 years ago

Hi,

Thank you for the nice plugin. It works well except for this issue: When I choose a saved report from the dropdown list and click load, it prints out the entire array on top of the page rather than show a formatted report.

Best regards, Tony.

luisdias commented 11 years ago

Hi Tony!

Are you working with the latest tag v0.4.5 ? And what version of CAKE?

https://github.com/luisdias/CakePHP-Report-Manager-Plugin/archive/v0.4.5.zip

Best regards

Luís

georgetony commented 11 years ago

Hello Luis,

Thank you for your quick reply. The version is v0.4.5 (Changelog for version 0.4.5 is inside the README.md)

The CakePHP version I am using is v2.2.3.

Attached is the screenshot for your reference. I hope this is useful.

Best regards, Tony.

georgetony commented 11 years ago

Hello Luis,

Looks like the image didn't get attached. Here is a link: http://postimage.org/image/7lnmaccjf/

Greetings, Tony.

luisdias commented 11 years ago

Hi Tony

It seems that the saved report file (*.crp) do not have the $reportFields variable. You can see at the saveReport method (ReportsController.php line 148) that the whole report is saved as a $reportFields array. Please, check the file with your text editor at your reports folder and let me know, ok?

Best regards Luís

georgetony commented 11 years ago

Hello Luis,

Thank you for the quick feedback. Yes, this was the problem. Here is the solution that worked for me:

In the controller of the plugin: public function saveReport($modelClass = null,$oneToManyOption = null) { $content='<?php $reportFields=';

I added the php

Then in the reportdisplay.ctp, at line 95, change to __

Now seems to work well.

Thanks again for the nice plugin.

Best regards, Tony George.

georgetony commented 11 years ago

Hello Luis,

Just updated my comment because the formatting was wrong when I replied from email.

I am closing this also since it is working well now.

Cheers, Tony.