KoolReport's Forum

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

Pivot table piping & formatting #226

Open michelp opened this topic on on Mar 7, 2018 - 9 comments

michelp commented on Mar 7, 2018

Hi,

I have created a report with pivottable. However I'm trying to do some formatting like I do with normal table. But it looks like things like prefix are not working

  ->pipe(new ColumnMeta(array(
                "kioskname"=>array(
                    "prefix" => "TEST-",
                ),
            )))


            ->pipe(new Pivot(array(
                "dimensions" => array(
                    "column" => "resultdate",
                    "row" => "parentparentcompany,parentcompany, maincompany, kioskname"
                ),
                "aggregates"=>array(
                    "count" => "tblresultid"
                )
            )))
            ->pipe($this->dataStore('wizardpivot'));

In the case above I would expect to have "TEST-<value>" in the table.

In the view I'm using this:

PivotTable::create(array(
    "dataStore"=>$this->dataStore('wizardpivot'),
    "columns"=>array(
        "kioskname"=>array(
            'formatValue'=>'<b>@value</b>',

        )
    )



));

From which I would expect to see the value in bold.

Apart from that I'm trying to change the design of the pivot table. For example bold headers, each row in different color etc. But it looks like cssStyle is not available pivot. Is that correct?

Thanks

KoolReport commented on Mar 9, 2018

PivotTable settings is different from Table so I beg your patient, I will ask the PivotTable's developer to answer you.

KoolReport commented on Mar 20, 2018

Sorry for my late reply, if you want the data cell to be bold, please add this css style to the view:

<style>
    .pivot-data-cell
    {
        font-weight:bold;
    }
</style>
michelp commented on Mar 22, 2018

Hi,

indeed, I can do it with CSS, but how can I target specific cells? This is what I want in the end:

I was wondering if you also had the time to look at the text/font issue I've sent via mail? Spaces are shown in the PDF, where it shouldn't be:

These spaces are not shown in the 'normal' view.

David Winterburn commented on Mar 29, 2018

Hi there,

Regarding CSS, we would consider adding a cssClass property for the pivot widget so you and likewise users could customize its display.

Regarding the export issue, would you please try exporting to pdf with normal tables and let us know if the problem is the same. Also, is there custom css rule in your page and if there is, try commenting them to see if it affects the pdf exporting?

Thanks,

michelp commented on Apr 5, 2018

Hi,

Great! do you have any idea on the timeframe for the cssclass?

the space issue seems to occur at all tables, not just pivottable. I tried arround, and seems something with the embeded.css, especially this part:

body

{
    zoom:_zoom_ !important;

}

If I remove the zoom, the spacing is gone (but then the table doesn't fit the page anymore)

With:

Without:

Looks like the zoom is screwing up the spacing for some reason..

KoolReport commented on Apr 6, 2018

We have tried to replicate the issue but have not succeed yet. You are using Linux, aren't you?

There are 3 properties which you can play with viewportRatio dpi and zoom

->pdf(array(
    ...
    "viewportRatio"=>2,
    "dpi"=>72,
    "zoom"=>1; // 1 in windows and 0.5 in linux
))

May be you just play with 3 combination to see how.

michelp commented on Apr 6, 2018

Hi,

I've played around with those values, but can't get it fixed. If I change zoom to 1, it's better, but still not 100% (but of course it won't fit the page anymore)

It's indeed linux Would it help if I gave you access on the environment?

KoolReport commented on Apr 6, 2018

Sure, could you please setup a place where I can make test, please send the information to support@koolreport.com

michelp commented on Apr 6, 2018

Hi,

I have sent you the details. Thanks already!

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
None yet

None