KoolReport's Forum

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

How to add custom field in excel report #821

Open Keerthiga opened this topic on on Apr 19, 2019 - 2 comments

Keerthiga commented on Apr 19, 2019

Hi Team, I have one report to calculate profit sale. now, I have to add all the profit values as total and need to display at the bottom of the excel page. Can you please help me , how to add total column and value in to excel. i have calculated profit values like as below code,

 $source->pipe(new CalculatedColumn(array(
            "profit"=>array(
                "exp"=>"{quoted_sale}-{quoted_cost}",
                "type"=>"number",
                 "decimals"=>2,
                ),
            )))

In my view file,

  if ($colName === 'profit')
              return array(
                  'label' => 'Date',
                   "footer"=>"sum",
                  "footerText"=>"@value",
              );

But, its not working. Please advise, how can i display the total value into Excel File. Thankyou !!.

Keerthiga commented on Apr 22, 2019

Hi team, I need to calculate total value for amount column. Can you please advice to get solution for calculating custom column in excel files.

David Winterburn commented on Apr 23, 2019

Hi Keerthiga,

Please check my answer on the following topic and see if it fits your case: https://www.koolreport.com/forum/topics/791 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
help needed

Export