KoolReport's Forum

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

DrillDown is Re rendering the whole page after second and next levels after update PHP version #3342

Open Jorge Tobon opened this topic on on Sep 23 - 6 comments

Jorge Tobon commented on Sep 23

I use drilldown with 3 nested graphics (year, month and day), this worked fine with PHP 7.4, but when I updated PHP version to 8.3, this drilldown stopped working.

I attach some images for validation.

Thanks for help.

Sebastian Morales commented on Sep 24

Pls post your Drilldown report code for us to check it for you and test our Drilldown example in your PHP 8.3 environment:

https://www.koolreport.com/examples/reports/drilldown/drilldown/

Let us know the result.

Jorge Tobon commented on Sep 24

Good morning, the code is:

<?php

use GestionAdministrativa\Informes\FacturasCompra\FacturasCompraComparativoPorPeriodo\FacturasCompraComparativoPorPeriodo; use koolreport\drilldown\DrillDown; use koolreport\widgets\google\ColumnChart;

DrillDown::create([

"name" => "saleDrillDown",
"title" => I18n::t('Informes', 'Facturas de Compra por Periodo'),
"btnBack" => [
	"text" => I18n::t('Informes', 'Volver'),
],
"themeBase" => "bs4",
"levels" => [
	[
		"title" => I18n::t('Informes', 'Todos los Años'),
		"content" => function ($params, $scope) {
			$clase = new FacturasCompraComparativoPorPeriodo();
			$CURRENCY_SYMBOL = I18n::getCurrencyInfo(NumberFormatter::CURRENCY_SYMBOL);

			ColumnChart::create([
				"dataSource" => (
					$this->src("arrendasoft")->query($clase->getqueryYear())
				),
				"columns" => [
					"anio" => [
						"type" => "string",
						"label" => I18n::t('Informes', 'Año'),
					],
					"valor_total" => [
						"label" => I18n::t('Informes', 'Valor Total'),
						"prefix" => $CURRENCY_SYMBOL,
					],
					'valor_saldo' => [
						"label" => I18n::t('Informes', 'Valor Saldo'),
						"prefix" => $CURRENCY_SYMBOL,
					],
				],
				"clientEvents" => [
					"itemSelect" => "function(params) {
						saleDrillDown.next({year:params.selectedRow[0]});
					}",
				]
			]);
		}
	],
	[
		"title" => function ($params, $scope) {
			return I18n::t('Informes', 'Año') . " " . $params["year"];
		},
		"content" => function ($params, $scope) {
			$clase = new FacturasCompraComparativoPorPeriodo();
			$CURRENCY_SYMBOL = I18n::getCurrencyInfo(NumberFormatter::CURRENCY_SYMBOL);

			ColumnChart::create(array(
				"dataSource" => (
					$this->src("arrendasoft")->query($clase->getqueryMonth())
					->params(array(
						":year" => $params["year"]
					))
				),
				"language" => "es",
				"columns" => array(
					"mes" => array(
						"type" => "string",
						"formatValue" => function ($value) {
							$clase = new FacturasCompraComparativoPorPeriodo();
							$meses = $clase->getMonths();
							return $meses[$value];
						}
					),
					"valor_total" => [
						"label" => I18n::t('Informes', 'Valor Total'),
						"prefix" => $CURRENCY_SYMBOL,
					],
					'valor_saldo' => [
						"label" => I18n::t('Informes', 'Valor Saldo'),
						"prefix" => $CURRENCY_SYMBOL,
					],
				),
				"clientEvents" => array(
					"itemSelect" => "function(params){
						saleDrillDown.next({month:params.selectedRow[0]});
					}",
				)
			));
		}
	],
	[
		"title" => function ($params, $scope) {
			$clase = new FacturasCompraComparativoPorPeriodo();
			$meses = $clase->getMonths();
			return $meses[$params["month"]];
		},
		"content" => function ($params, $scope) {
			$clase = new FacturasCompraComparativoPorPeriodo();
			$CURRENCY_SYMBOL = I18n::getCurrencyInfo(NumberFormatter::CURRENCY_SYMBOL);

			ColumnChart::create(array(
				"dataSource" => (
					$this->src("arrendasoft")->query($clase->getqueryDay())
					->params(array(
						":year" => $params["year"],
						":month" => $params["month"],
					))
				),
				"language" => "es",
				"columns" => array(
					"dia" => array(
						"type" => "date",
						"formatValue" => function ($value, $row) {
							return I18n::asDate($row["fecha"]);
						},
					),
					"valor_total" => [
						"label" => I18n::t('Informes', 'Valor Total'),
						"prefix" => $CURRENCY_SYMBOL,
					],
					'valor_saldo' => [
						"label" => I18n::t('Informes', 'Valor Saldo'),
						"prefix" => $CURRENCY_SYMBOL,
					],
				)
			));
		}
	]
],

]);

Sebastian Morales commented on Sep 25

Pls open your browser's dev tool (F12) and see if there's any error message (in tab Console) or xhr request (in tab Network) when you click on a chart column?

Jorge Tobon commented on Sep 25

There is no any error in console, but, I identify that the ajax request was made by GET and not by POST, I attach the evidence.

Sebastian Morales commented on Sep 26

What is your Drilldown package's version? Is it possible for you to update to the latest Drilldown version which is 3.7.0 and test your report with it?

Jorge Tobon commented on Sep 26

I found the problem, it was a conflict with jquery library, thanks for help

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
solved

DrillDown