Can I stylize my query reports in erpnext,like i need to change the background color of the table and font color of the table contents.Please guide me in this regard.
Hey Tejas_K_V!
Ofcourse you can!
You need to write an formatter in your report!
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.query_reports["Budget Variance Report"] = {
filters: get_filters(),
formatter: function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (column.fieldname.includes(__("variance"))) {
if (data[column.fieldname] < 0) {
value = "<span style='color:red'>" + value + "</span>";
} else if (data[column.fieldname] > 0) {
value = "<span style='color:green'>" + value + "</span>";
}
}
I need the background of the header row to be changed .How can I do that?