KoolReport's Forum

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

Unauthorized when click second level in Dashboard DrillDown #3470

Open Daniel Cordeiro opened this topic on on Feb 11 - 1 comments

Daniel Cordeiro commented on Feb 11

Hello,

I created a Drilldown in my dashboard. But, when I click in one month, the graph shows me the sentence;

{"panels":{"Page":["
\n
\n
\n
\n
\n
401<\/h1>\n
Unauthorized<\/h4>\n

This is restricted area, please contact admin for access granting.<\/p>\n <\/div>\n <\/div>\n <\/div>\n <\/div>\n<\/div>",null]},"scripts":[]}

This is my code:

class DrillDownDemo extends DrillDown
{
  protected function levels()
    {
        return [
            Level::create()
                ->title("Meses")
                ->widget(
                    KWidget::create()
                    ->use(\koolreport\widgets\google\ColumnChart::class)
                    ->dataSource(function($params, $scope){
                      return AutoMaker::table("pedidos ped")
                              ->selectRaw("extract(month from ped.data_resposta) as mes")
                              ->count("ped.identificacao")->alias("total")
                              ->where("extract(year from ped.data_resposta)",date('Y') ) 
                              ->where('ped.fk_cliente', 3455) 
                              ->groupBy("mes")->run();
                    })->columns([
                        "mes"=>["type"=>"string"],
                        "total"=>["type"=>"number"]
                    ])
                ),
            //Segundo Nivel
            Level::create()
                ->title(function($params){
                    return "Mes ".$params["mes"];
                })
                ->widget(
                    KWidget::create()
                    ->use(\koolreport\widgets\google\ColumnChart::class)
                    ->dataSource(function($params, $scope) {
                      return AutoMaker::table("pedidos ped")
                        ->selectRaw("extract(day from ped.data_resposta) as dia")
                        ->count("ped.identificacao")->alias("total")
                        ->where('ped.fk_cliente', 3455)
                        ->where("extract(year from ped.data_resposta)",date('Y'))
                        ->where("extract(mont from ped.data_resposta)",$params["mes"])
                        ->groupBy("dia")->run();
                    })
                    ->columns([
                        "dia"=>[
                            "type"=>"string"                          
                        ],
                        "total"=>[
                            "type"=>"number",
                        ]
                    ])
                ),
];
}

I don't use any permissions nether roles in my page.
Sebastian Morales commented 2 days ago

Sorry for the delay. Pls check these docs to see if your Dashboard uses the following permission:

Dashboard permission

Dashboard Admin panel permission

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

DrillDown