KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

PivotMatrix widget is loading the entire view inside the report #1028

Closed Marco Arredondo opened this topic on on Aug 5 - 4 comments

Marco Arredondo commented on Aug 5

Hi Koolreport Team,

I'm using the pivot matrix widget for one of my projects. I'm retrieving a lot of data from my database query and for that reason I'm using the partialProcessing attribute, everything works fine in the initial load of data.

The problem arrives when I'm trying to expand the report and go to the data details using the expanding control , the report just loads the entire view inside the report section.

This happens only when I use the partialProcessing attribute.

I hope you can help me guys.

Cheers.

David Winterburn commented on Aug 6

Hi Marco,

When using "partialProcessing" with PivotMatrix, please add an unique "name" or "id" property to the widget like this:

PivotMatrix::create(array(
    "name" => "pivotMatrix1",
    ...

This unique id/name is used to identify the part of response data to update the widget when expanding row/column. Let us know if it solves your issue. Thanks!

Marco Arredondo commented on Aug 6

Thanks for your answer David!

This is the way I create the widget, I already have an ID assigned to it.

Unluckily this is the way the widget is not working. (I also tried using the name attribute)

I'm using the Laravel framework for this project, I don't know if the problem comes from the CSRF token in the scope, because when I don't use it instead of loading the entire view in the report section when I try to expand the information, the report shows a 419 status in the browser console.

Maybe with this you can have a better clue of what's happening here.

Best regards.

David Winterburn commented on Aug 7

Hi Marco,

Please try using this token code in scope:

                        "scope" =>  array(
				"_token" => csrf_token(),
			),

Let us know the result. Thanks!

Marco Arredondo commented on Aug 7

Hi David,

I just figured out what's happening.

I took a look to the PivotMatrix.js file, because I noticed that when you use the expand control to go to the information detail in the report, the library send a new request to the current location to retrieve the information.

The thing was that in the initial load of my user interface I always use the current date to retrieve the information. So when I used a different date, the library make the request but using current date, not the date that I used in the filter.

My solution was to use the date filter using GET requests and making validation in my code to verify if the date has changed.

So when PivotMatrix send the request it looks like this now.

I don't know if is the best approach but It works. If you have a better understanding of how to solve the problem any recommendation will be well received.

Cheers!

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
help needed

Pivot