KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Need some information on platesPHP #2136

Open Komuraiah A opened this topic on on Jun 9 - 15 comments

Komuraiah A commented on Jun 9

Dear Team, Cloud you please provide some befits and particle example on platesPHP because I am not getting an clear idea on platesphp.

And when I am implementing the example of platesPHP I am getting stuck with an error cloud please provide a solutions.

Code

<?php
require_once "vendor/koolreport/core/autoload.php";

class demoreport extends \koolreport\KoolReport
{
    use \koolreport\platesphp\Engine;
    
    protected function connection()
    {
		return [
 "connectionString"=>"mysql:host=". $_SESSION['sqlHost'] .";dbname=". $_SESSION['c_db'] ."",
            "username"=>$_SESSION['sqlUserName'],
            "password"=>$_SESSION['sqlPassword'],
            "charset"=>"utf8"
        ];
    }
	
	protected function platesInit()
    {
        return League\Plates\Engine::create(dirname(__FILE__).'/../views');
    }

}

error

Fatal error: Trait 'koolreport\platesphp\Engine' not found in C:\xampp\htdocs\crmapp\pages\demoreport.php on line 5
Komuraiah A commented on Jun 9

Dear Team, Please help me on platesPHP .

require_once "vendor/koolreport_pro-5.0.4/examples/load.koolreport.php";
require_once "vendor/platesphp_1.0.0/platesphp/Engine.php"

class demoreport extends \koolreport\KoolReport
{
    use \koolreport\platesphp\Engine;
    
    /*protected function connection()
    {
		return [
            "connectionString"=>"mysql:host=". $_SESSION['sqlHost'] .";dbname=". $_SESSION['c_db'] ."",
            "username"=>$_SESSION['sqlUserName'],
            "password"=>$_SESSION['sqlPassword'],
            "charset"=>"utf8"
        ];
    }*/
	
	protected function platesInit()
    {
        return League\Plates\Engine::create(dirname(__FILE__).'/../views');
    }

}
Parse error: syntax error, unexpected 'class' (T_CLASS) in C:\xampp\htdocs\crmapp\pages\demoreport.php on line 7
KoolReport commented on Jun 9

Please remove this line, it is not neccessary

require_once "vendor/platesphp_1.0.0/platesphp/Engine.php"

By the way, there error you get is because of you lack of ";" at the end above command.

Komuraiah A commented on Jun 10

Dear Team, As per your instructions I have tested my code by removing the above line but still I am facing with the error as below.

Fatal error: Trait 'koolreport\platesphp\Engine' not found in C:\xampp\htdocs\crmapp\pages\demoreport.php on line 5
Komuraiah A commented on Jun 10

Dear Team, Please help me.

KoolReport commented on Jun 10

Hi, could you please check if you have the koolreport/platephp folder. If not then please download the package from here. Here is the documentation of installation.

Komuraiah A commented on Jun 10

Dear Team, I have already downloaded the platesphp package and the example I am implementing is from same documentation but still I am facing the issue.

<?php
require_once "vendor/koolreport_pro-5.0.4/examples/load.koolreport.php";


class demoreport extends \koolreport\KoolReport
{
    use \koolreport\platesphp\Engine;
    
    protected function connection()
    {
		return [
            "connectionString"=>"mysql:host=". $_SESSION['sqlHost'] .";dbname=". $_SESSION['c_db'] ."",
            "username"=>$_SESSION['sqlUserName'],
            "password"=>$_SESSION['sqlPassword'],
            "charset"=>"utf8"
        ];
    }
	
	protected function platesInit()
    {
        return League\Plates\Engine::create(dirname(__FILE__).'/../views');
    }

}

error

Fatal error: Trait 'koolreport\platesphp\Engine' not found in C:\xampp\htdocs\crmapp\pages\demoreport.php on line 5
KoolReport commented on Jun 10

Please make sure that you put package into "vendor/koolreport_pro-5.0.4/koolreport" folder (the place that you install koolreport pro where you see "core","datagrid" folder)

Komuraiah A commented on Jun 10

Dear Team, As per your instruction I have place the platesphp folder in to the "vendor\koolreport_pro-5.0.4\koolreport" and when I have refreshed the page the following error

Fatal error: Uncaught League\Plates\Exception\RenderTemplateException: Template path C:\xampp\htdocs\crmapp\pages/../views\viewmyreport.phtml is not a valid path for template: viewmyreport in C:\xampp\htdocs\crmapp\pages\vendor\koolreport_pro-5.0.4\koolreport\platesphp\vendor\league\plates\src\RenderTemplate\ValidatePathRenderTemplate.php:22 Stack trace: #0 C:\xampp\htdocs\crmapp\pages\vendor\koolreport_pro-5.0.4\koolreport\platesphp\vendor\league\plates\src\Extension\LayoutSections\LayoutRenderTemplate.php(11): League\Plates\RenderTemplate\ValidatePathRenderTemplate->renderTemplate(Object(League\Plates\Template), Object(League\Plates\RenderTemplate\ComposeRenderTemplate)) #1 C:\xampp\htdocs\crmapp\pages\vendor\koolreport_pro-5.0.4\koolreport\platesphp\vendor\league\plates\src\RenderTemplate\ComposeRenderTemplate.php(17): League\Plates\Extension\LayoutSections\LayoutRenderTemplate->renderTemplate(Object(League\Plates\Template), Object(League\Plates\RenderTemplate\ComposeRenderTemplate)) #2 C:\xampp\htdocs\crmapp\pages\ven in C:\xampp\htdocs\crmapp\pages\vendor\koolreport_pro-5.0.4\koolreport\platesphp\vendor\league\plates\src\RenderTemplate\ValidatePathRenderTemplate.php on line 22
KoolReport commented on Jun 10

So do you have the "views" folder with the "viewmyreport.phtml" file.

Abhishek commented on Jun 10

Dear Team, Sorry I don't have "views" folder in the platesphp folder.

Cloud you please help me where to create the "views" folder.

KoolReport commented on Jun 10

You can create "views" folder at place that suits your need and specify the path here:

return League\Plates\Engine::create(dirname(__FILE__).'/../views'); //<-- Please change the path correctly to point to your views folder.
Komuraiah A commented on Jun 10

Dear Team, As per your instruction I have provided the path of the view file location but still I am unable to get the output. I mean a blank page is getting appeared.

viewmyreport.phtml

<html>
<head>
    <title>Report</title>
</head>
<body>
    <?php
    \koolreport\widgets\koolphp\Table::create(array(
        "dataSource"=>$report->dataStore("sales")->query("select * from users"),
    ));
    ?>
</body>
</html>

I am facing the following issue for above code.

Fatal error: Uncaught Error: Call to undefined method koolreport\core\DataStore::query() in C:\xampp\htdocs\crmapp\pages\viewmyreport.phtml:8 Stack trace: #0 C:\xampp\htdocs\crmapp\pages\vendor\koolreport_pro-5.0.4\koolreport\platesphp\vendor\league\plates\src\RenderTemplate\PhpRenderTemplate.php(27): include() #1 C:\xampp\htdocs\crmapp\pages\vendor\koolreport_pro-5.0.4\koolreport\platesphp\vendor\league\plates\src\RenderTemplate\PhpRenderTemplate.php(20): League\Plates\RenderTemplate\PhpRenderTemplate::League\Plates\RenderTemplate\{closure}('C:\\xampp\\htdocs...', Array) #2 C:\xampp\htdocs\crmapp\pages\vendor\koolreport_pro-5.0.4\koolreport\platesphp\vendor\league\plates\src\Util\util.php(21): League\Plates\RenderTemplate\PhpRenderTemplate->League\Plates\RenderTemplate\{closure}() #3 C:\xampp\htdocs\crmapp\pages\vendor\koolreport_pro-5.0.4\koolreport\platesphp\vendor\league\plates\src\RenderTemplate\PhpRenderTemplate.php(21): League\Plates\Util\obWrap(Object(Closure)) #4 C:\xampp\htdocs\crmapp\pages\vendor\koolreport_pro in C:\xampp\htdocs\crmapp\pages\viewmyreport.phtml on line 8

And if I remove this line of code "->query("select * from users")" then the output is as follow

No data available in table
Komuraiah A commented on Jun 11

Dear Team,please help me on above issue

KoolReport commented on Jun 11

dataStore does not have the query() method.

Komuraiah A commented on Jun 11

Dear Team,when I'm passing a table name in the data store still I'm not able to get the output. So is there any alternative way to check the output.

viewmyreport.phtml

<html>
<head>
    <title>Report</title>
</head>
<body>
    <?php
    \koolreport\widgets\koolphp\Table::create(array(
        "dataSource"=>$report->dataStore("tblname"),
    ));
    ?>
</body>
</html>

error output

No data available in table

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None