KoolReport's Forum

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

How can I using fields() in SimpleCard Widget? #2968

Closed Daniel Cordeiro opened this topic on on Jan 31, 2023 - 2 comments

Daniel Cordeiro commented on Jan 31, 2023

Hi, When I using SimpleCard, the examples show me to use the value() function, but I need change the content to BRL and decimal(2). I try change, but, nothing happenning.

Sebastian Morales commented on Jan 31, 2023

You can call method useRaw(true) for your SimpleCard and format the value yourself in function value():

class MyCard extends SimpleCard
{
    protected function onInit()
    {
        $this
        ...
        ->useRaw(true)
        ;
    } 

    protected function value()
    {
        //return formatted value here
    }
Daniel Cordeiro commented on Feb 1, 2023

This worked like a charm! Thanks!!

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

Dashboard