KoolReport's Forum

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

Laravel Production Env #3147

Closed Charlie May opened this topic on on Sep 14, 2023 - 2 comments

Charlie May commented on Sep 14, 2023

Hello, It looks like I'm having some issues while in production. After deploying the latest version with KoolReports it is failing to resolve the KoolReport in the F12 console. The expected result works fine within my dev environment (Windows) but when I push to my production environment I get those errors in the JS Console.

Server Info: OS - Ubuntu 22.04 PHP - v8.1 Laravel - v10 Node Version - 18.17.1 KoolReport Pro - v6.2.0

It should look like this

Report Class:


<html>

<head>
    <title>Regional Compliance Report</title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>

<body style="background-color: #ffffff;">
    <div class="report-content">
        <div class="text-center">
            <h1>Compliance Report</h1>
            <p class="lead">
                Displaying all Licenses, Permits, CLIA's, and POC/Fines for your region.
            </p>
        </div>

        <div class="w-full flex justify-between">
            <form method="POST" class="ml-2">
                <div class="inline-flex gap-x-2">
                    <input type="hidden" name="_token" value="<?php echo csrf_token() ?>" />
                    <?php
                    \koolreport\inputs\DateRangePicker::create([
                        'name' => 'dateRange',
                        'language' => 'en',
                        'format' => 'YYYY-MM-DD',
                        'ranges' => [
                            '30 Days' => [now()->subDay()->timezone('America/Los_Angeles'), now()->addDays(30)->timezone('America/Los_Angeles')],
                            '60 Days' => [now()->subDay()->timezone('America/Los_Angeles'), now()->addDays(60)->timezone('America/Los_Angeles')],
                            '90 Days' => [now()->subDay()->timezone('America/Los_Angeles'), now()->addDays(90)->timezone('America/Los_Angeles')],
                            '120 Days' => [now()->subDay()->timezone('America/Los_Angeles'), now()->addDays(120)->timezone('America/Los_Angeles')],
                        ]
                    ]);
                    ?>
                    <button type='submit' class='btn btn-primary'>Submit</button>
                </div>
            </form>
            <form method="post" action="/reports/compliance/export" class="mr-2">
                <input type="hidden" name="_token" value="<?php echo csrf_token() ?>" />
                <input type="hidden" name="dateRangeStart" value="<?php echo $this->params["dateRange"][0]; ?>" />
                <input type="hidden" name="dateRangeEnd" value="<?php echo $this->params["dateRange"][1]; ?>" />
                <button class="btn btn-primary">Export to PDF</button>
            </form>
        </div>

        <div>
            <h4>Licenses</h4>
            <?php
            if ($this->dataStore("license")->countData() > 0) {
                \koolreport\widgets\koolphp\Table::create([
                    "dataSource" => $this->dataStore("license"),
                    'cssClass' => [
                        'table' => 'table table-striped',
                        'tr' => '',
                        'th' => 'text-sm text-wrap',
                        'td' => 'text-sm text-wrap'
                    ],
                ]);
            }
            ?>

            <h4 style="margin-top: 5rem;">Permits</h4>
            <?php
            if ($this->dataStore("permit")->countData() > 0) {
                \koolreport\widgets\koolphp\Table::create([
                    "dataSource" => $this->dataStore("permit"),
                    'cssClass' => [
                        'table' => 'table table-striped',
                        'tr' => '',
                        'th' => 'text-sm text-wrap',
                        'td' => 'text-sm text-wrap'
                    ],
                ]);
            }

            ?>

            <h4 style="margin-top: 5rem;">CLIAs</h4>
            <?php
            if ($this->dataStore("clia")->countData() > 0) {
                \koolreport\widgets\koolphp\Table::create([
                    "dataSource" => $this->dataStore("clia"),
                    'cssClass' => [
                        'table' => 'table table-striped',
                        'tr' => '',
                        'th' => 'text-sm text-wrap',
                        'td' => 'text-sm text-wrap'
                    ],
                ]);
            }
            ?>

            <h4 style="margin-top: 5rem;">Defficiencies & Penalties</h4>
            <?php
            if ($this->dataStore("penalty")->countData() > 0) {
                \koolreport\widgets\koolphp\Table::create([
                    "dataSource" => $this->dataStore("penalty"),
                    'cssClass' => [
                        'table' => 'table table-striped',
                        'tr' => '',
                        'th' => 'text-sm text-wrap',
                        'td' => 'text-sm text-wrap'
                    ],
                ]);
            }
            ?>
        </div>
    </div>
</body>

</html>
Sebastian Morales commented on Sep 18, 2023

Pls make sure that your report view file matches your report class file case sensitively. On Windows myreport.view.php is the same as MyReport.view.php but on Linux (such as Ubuntu) they are different.

Charlie May commented on Sep 18, 2023

Well now I feel dumb...

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
help needed

None