Giter Club home page Giter Club logo

stimulsoft / stimulsoft.reports.php Goto Github PK

View Code? Open in Web Editor NEW
4.0 11.0 4.0 421.55 MB

Reports.PHP is a report generator intended to create, view, print, and export reports online using client-server technology. Includes the JS report engine, report designer and viewer. Support PHP 5, PHP 7, and PHP 8 versions.

Home Page: https://www.stimulsoft.com/en/products/reports-php

License: Other

PHP 100.00%
php7 php8 report-engine reporting-tool barcode-generator chart-js export-data export-excel export-pdf export-tool

stimulsoft.reports.php's Introduction

Stimulsoft Reports.PHP

Stimulsoft Reports.PHP is a reporting tool designed to create, edit and view reports in the Internet using a client-server technology. The PHP script works on the server side and controls the report generation. The JavaScript report engine works on the client side and provides a universal mechanism for reports generation almost on any client. Fast and powerful report engine, rich and intuitive interface, deployment and licensing.

Installation

The product is distributed using the Composer repository. You can add the necessary libraries using the command:

composer require stimulsoft/reports-php

Usage

Add the minimum required code to the page:

<?php
require_once 'vendor/autoload.php';
?>

Render the necessary scripts in the <head> section

<head>
<?php
    $js = new \Stimulsoft\StiJavaScript(\Stimulsoft\StiComponentType::Viewer);
    $js->renderHtml();
?>
</head>

Create and render a request handler in the <script> section of the page:

<script>
<?php
    $handler = new \Stimulsoft\StiHandler();
    $handler->renderHtml();
?>
</script>

Create and render the component in the <script> section of the page:

<script>
<?php
    $viewer = new \Stimulsoft\Viewer\StiViewer();
    $report = new \Stimulsoft\Report\StiReport();
    $report->loadFile('reports/SimpleList.mrt');
    $viewer->report = $report;
    $viewer->renderHtml();
?>
</script>

Useful links:

Live Demo

Sample Projects

Product Page

Free Download

License

stimulsoft.reports.php's People

Contributors

atapatel avatar e-belair avatar ivan-trusov avatar kubekin2 avatar vladimirhot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stimulsoft.reports.php's Issues

Undefined variable $relativePath

Hello,
I wanted to bring to your attention that there is a bug in versions 2024.2.1 and 2024.2.2 for Laravel.
in designer.blade.php :

 <?php
        $js = new \Stimulsoft\StiJavaScript(\Stimulsoft\StiComponentType::Designer);
        $js->renderHtml();
    ?>

The error message states: "Undefined variable $relativePath."
However, version 2024.1.4 works perfectly fine on Laravel.
Thank you for your attention to this matter. Best regards.

Support of relative path when loading JavaScript files

Hello,

In my projects I prefer to use loading the JavaScript files via PHP.
This is very good, but in my case, every report has a separate PHP file in separate directory.

In your script StiJavaScript.php you already have a variable which do partial solution to relative paths
It is called useRelativeUrls and if set to true you do like this

    $root = $this->useRelativeUrls ? '' : '/';
    $result .= "<script src=\"{$root}vendor/stimulsoft/$product/scripts/$name\" type=\"text/javascript\"></script>\n";

This assumes that the report php file should be placed in root project directory, which causes error when it is not here.

I suggest to add new property like relativePath and change the code like this

....
    public $usePacked = false;
    public $useRelativeUrls = true;
    public $relativePath ="";    // <-- here r=the new properrt
.....

    foreach ($scripts as $name) {
        $product = strpos($name, 'dashboards') > 0 ? 'dashboards-php' : 'reports-php';
        $root = $this->useRelativeUrls ? $this->relativePath : '/';  //     <----- here the fix
        $result .= "<script src=\"{$root}vendor/stimulsoft/$product/scripts/$name\" type=\"text/javascript\"></script>\n";
    }

And then I do

    $js = new \Stimulsoft\StiJavaScript(\Stimulsoft\StiComponentType::Viewer);
    $js->relativePath ="../../../";
    $js->renderHtml();

I hope you understand what I mean.

Of course there are better solutions, but I hope you will add this feature

Thank you.

Best Regards,
Tony

Support for PHP 8.2

Hello, I am trying to run the package on a Laravel application which uses php 8.2.

I am getting some errors (already messaged stimulsoft support via email).

I wasn't able to show the designer or view because of the error linked under. On local development I was running 8.1 and all was alright, when I switched to 8.2, I'm getting these errors.

Will your package support newest php 8.2?

The error shown is in StiDataAdapter.php:

   protected function parseUnknownParameter($parameter, $name, $value)
    {
        if ($this->driverType == 'PDO' && mb_strlen($parameter) > 0) {
            if (mb_strlen($this->info->dsn) > 0)        <-- here is the error
                $this->info->dsn .= ';';

            $this->info->dsn .= $parameter;
        }
    }

Also other error I was able to debug in StiLicense.php:

    /** Get the HTML representation of the component. */
    public function getHtml()
    {
        $result = '';

        if (strlen($this->licenseKey) > 0)      <-- here is the error
            $result .= "Stimulsoft.Base.StiLicense.Key = '$this->licenseKey';\n";
        else if (strlen($this->licenseFile) > 0)      <-- also here
            $result .= "Stimulsoft.Base.StiLicense.loadFromFile('$this->licenseFile');\n";

        $this->isHtmlRendered = true;
        return $result;
    }

The stacktrace:

{"handlerVersion":null,"adapterVersion":null,"checkVersion":true,"success":false,"notice":"[1] Uncaught Error: Invalid callback Stimulsoft\\StiHandler::stiErrorHandler, cannot access private method Stimulsoft\\StiHandler::stiErrorHandler() in /www/hosting/[sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php:110\nStack](http://sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php:110%5CnStack) trace:\n#0 /www/hosting/[sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php(110)](http://sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php(110)): mb_strlen()\n#1 /www/hosting/[sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php(100)](http://sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php(100)): Stimulsoft\\Adapters\\StiDataAdapter->parseUnknownParameter()\n#2 /www/hosting/[sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php(70)](http://sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php(70)): Stimulsoft\\Adapters\\StiDataAdapter->parseParameters()\n#3 /www/hosting/[sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiFirebirdAdapter.php(57)](http://sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiFirebirdAdapter.php(57)): Stimulsoft\\Adapters\\StiDataAdapter->parse()\n#4 /www/hosting/[sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/classes/StiDataHandler.php(84)](http://sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/classes/StiDataHandler.php(84)): Stimulsoft\\Adapters\\StiFirebirdAdapter->parse()\n#5 /www/hosting/[sas-report.cz/crm/vendor/stimulsoft/reports-php/src/StiHandler.php(314)](http://sas-report.cz/crm/vendor/stimulsoft/reports-php/src/StiHandler.php(314)): Stimulsoft\\StiDataHandler->getDataAdapterResult()\n#6 /www/hosting/[sas-report.cz/crm/public/handler.php(135)](http://sas-report.cz/crm/public/handler.php(135)): Stimulsoft\\StiHandler->process()\n#7 {main}\n  thrown (/www/hosting/[sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php](http://sas-report.cz/crm/vendor/stimulsoft/reports-php/src/adapters/StiDataAdapter.php), Line 110)"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.