Конфигурация отчетов

Вы можете задать персональный стиль файлов отчетов — цветовая раскраска, шрифты, выравнивание и т.п. Чтобы это сделать, необходимо:

  1. В конфигурационном файле задать переменную AVL_REPORTS_STYLES_FILE со значением $ADF_ROOT_PATH/custom/reports_config.xml. Эта переменная задает путь к XML файлу, содержащему конфигурацию стилей файлов отчетов.
  2. Создать файл reports_config.xml в кодировке UTF-8, содержащий конфигурацию, и поместить его в папку custom.

Пример содержимого файла конфигурации:

<report bg_color="e5e8e9" indent="20,20,20,20">
	<images>
		<img1 align="l" src="plugins/trace_front/images/trace_b2b.png?nolink"></img1>
	</images>
	<fonts chart="DejaVuSans.ttf" default="DejaVuSans.ttf"></fonts>
	<head align="cc" bg_color="57a4c1" border="3" border_color="ffffff" font_color="ffffff" font_size="15" img="img1" space_after="50"></head>
	<content bg_color="e5e8e9" font_size="15"></content>
	<unit_name align="cc" bg_color="57a4c1" border="3" border_color="ffffff" font_color="ffffff" font_size="12" min_height="50" space_after="40"></unit_name>
	<table_defs>
		<trips_table>
			<table_name align="cc" bg_color="aaaac1" border="1" border_color="57a4c1" font_color="000000" font_size="12" min_height="0" space_after="50"></table_name>
			<table_header align="cc" bg_color="cfd1d1" border="1" border_color="57a4c1" column_no_wrap="0,2" font_size="10" repeat_header="1"></table_header>
			<table_body align="lc" bg_color="e5e8e9,f4f4f4" border="1" border_color="57a4c1" colors_to_rows="1" font_size="10" space_after="30"></table_body>
		</trips_table>
		<total_table>
			<table_name align="cc" bg_color="aaaac1" border="1" border_color="57a4c1" font_color="000000" font_size="12" min_height="0" space_after="50"></table_name>
			<table_header align="cc" bg_color="cfd1d1" border="1" border_color="57a4c1" font_size="10" repeat_header="1"></table_header>
			<table_body align="cc" bg_color="e5e8e9,f4f4f4" border="1" border_color="57a4c1" colors_to_rows="1" font_size="10" space_after="30"></table_body>
		</total_table>
		<default>
			<table_name align="cc" bg_color="aaaac1" border="1" border_color="57a4c1" font_color="000000" font_size="12" min_height="0" space_after="50"></table_name>
			<table_header align="cc" bg_color="cfd1d1" border="1" border_color="57a4c1" font_size="10" repeat_header="1"></table_header>
			<table_body align="lc" bg_color="e5e8e9,f4f4f4" border="1" border_color="57a4c1" colors_to_rows="1" font_size="10" space_after="30"></table_body>
		</default>
	</table_defs>
	<tables>
		<style def_id="trips_table" table="Trips"></style>
		<style def_id="total_table" table="Total"></style>
	</tables>
	<chart caption_top="1" dset_color="ff0000,ff00,ff" font="chart" font_axis_size="16" font_name_size="40" grid_color="0000cc" height="350" scale="2"></chart>
</report>

Common report options: <report>

orientation_landscape: "0" page format A4, orientation portrait
		       "1" page format A4, orientation landscape
		
password: 		"any string" set password for reading document[only pdf]
			"" no password
		
indent:			"n,n,n,n" set page indents[only pdf]
			[left,right,top,bottom] 
							   
content:		"0" do not make content table
			"1" make content table
								
unit_new_page:		"0" unit placement without page transfer
			"1" each unit on new page
		
bg_color		"rrggbb" set report background color

Font aliases, used in report: <fonts>

alias="font_file.ttf", like default="DejaVuSans.ttf{B}" 
possible flags after font name: {B} - bold : {I} - italic : or its combination [html only]

Images, used in report: <images>

On the first place set unique name of image (img1 src=«…» align=«r»)

src		"path_to_image" (only PNG picture)

align		"s" set image align (right or left)

Report header options: <head>

bg_color: 		"rrggbb" set report header background color

font_color: 		"rrggbb" set report header font color

font_size: 		"n" set report header font size

font: 		 	alias from <fonts>

border: 		"n" set report header border width [0 - no border]

align: 			"ss" set report header text align: first char - horizontal align, possible values 'l' - left; 'c' - center; 'r' - right	second char - vertical align, possible values 't' - top; 'c' - center; 'b' - bottom example : "rt" - text in the right and top corner

min_height:		"n" set report header rect minimal height

space_after:		"n" set free space after header

border_color:		"rrggbb" set report header border color

img			"unique_name_of_image"

Content table options: <content>

bg_color:		"rrggbb" set content table background color

font_color:		"rrggbb" set content table font color

font_size:		"n" set content table font size

font:			alias from <fonts>

border:			"n" set content table border width [0 - no border]

Unit name options: <unit_name>

bg_color: 		"rrggbb" set table name background color

font_color: 		"rrggbb" set table name font color

font_size: 		"n" set table name font size

font: 		 	alias from <fonts>

border: 		"n" set table name border width [0 - no border]

align: 			"ss" set table name text align

min_height:		"n" set table name rect minimal height

space_after:		"n" set table name after header

border_color:		"rrggbb" set unit name border color

Data table definition: <table_defs>

Use in this tag unique table name for definition table style:

<table_defs>
	<table1>
		<!-- Here use tags for discription table -->
		<table_name> ... </table_name>
		<table_header> ... </table_header>
		<table_data> ... </table_data>
	</table1>
</table_defs>

Data table name options: <table_name>

bg_color: 		"rrggbb" set table name background color

font_color: 		"rrggbb" set table name font color

font_size: 		"n" set table name font size

font: 		 	alias from <fonts>

border: 		"n" set table name border width [0 - no border]

align: 			"ss" set table name text align

min_height:		"n" set table name rect minimal height

space_after:		"n" set table name after header

border_color:		"rrggbb" set table name border color

Data table header options: <table_header>

bg_color:		"rrggbb[,rrggbb,rrggbb,...]" set array of header background colors

font_color:		"rrggbb[,rrggbb,rrggbb,...]" set array of header text colors

font_size:		"n" set table header font size

font:			alias from <font>

border:			"n" set table header border width [0 - no border]

align:			"ss,[ss,ss,...]" set array of cells aligns: see <head align>

column_no_wrap:		"n,[n,n,...]" set array of unwrapped cells

border_color:		"rrggbb" set table header border color

Data table body options: <table_body>

bg_color: 		"rrggbb[,rrggbb,rrggbb,...]" set array of data text colors

font_color:		"rrggbb[,rrggbb,rrggbb,...]" set array of data text colors

font_size:		"n" set table data font size

font, font_normal, font_bold, font_italic:	alias from <fonts>, uses in report row with flags: AVL_REPORT_ROW_FLAG_BOLD, AVL_REPORT_ROW_FLAG_ITALIC

border:			"n" set table header border width [0 - no border]

align:			"ss,[ss,ss,...]" set array of cells aligns: see <head align>

colors_to_rows:		"0" - background and text colors applies to table columns
	  		"1" - background and text colors applies to table rows

space_after:		"n" set free space after table

border_color:		"rrggbb" set table body border color

Tables styles: <tables>

table 		Имя таблицы в системе, например, "total", "unit_cmds"

def_id 		Стиль из раздела <table_defs>

Доступные таблицы: total (Статистика), unit_trips (Поездки), unit_stays (Стоянки), unit_events (События и Нарушения), unit_smses (SMS-сообщения), unit_stops (Остановки), unit_conn_quality (Потери связи), unit_engine_hours (Моточасы), unit_speedings (Превышения скорости), unit_rides (Рейсы и Незавершенные рейсы), unit_fuel_events (Заправки и Сливы), unit_zones_visit (Геозоны), unit_digital_sensors (Цифровые датчики), unit_chat (История переписки), unit_cmds (Выполненные команды), unit_location (Последние данные), unit_chronology (Хронология), unit_visited_streets (Посещенные улицы), logins (Логины пользователя), unit_maintenance (Техобслуживание), unit_utilization_cost (Стоимость эксплуатации), unit_counter_sensors (Датчики счетчиков), unit_zones_pass (Пропущенные геозоны), unit_routes (Маршруты), unit_route_points (Точки маршрута), driver_bindings (Назначения водителя), unit_sensors_tracing (Трассировка датчика), unit_traffic_gprs (GPRS-трафик), unit_insurance_cases (Страховые случаи), unit_insurance_summary (Сводка по страхованию), custom_fields (Произвольные поля).

Chart options: <chart>

font_colors:		"rrggbb,rrggbb,rrggbb[,rrggbb,..]" first three colors applies to chart name, legend and axis text colors, next triple of colors applies to next chart etc...

bg_color: 		"rrggbb[,rrggbb,rrggbb,...]" set array of charts background colors

grid_color:		"rrggbb[,rrggbb,rrggbb,...]" set array of charts grid colors

caption_top:		"0" chart caption draws in the bottom
			"1" chart caption draws in the top

legend_align:		"s[,s,...]" set charts legend position
			possible values: "l"(left),"r"(right),"t"(top),"b"(bottom)

x_axis_vertical:	"0"	x axis has horizontal lables
			"1"	x axis has vertical lables from up to down
			"2"	x axis has vertical lables from down to up

dset_color:		"rrggbb[,rrggbb,rrggbb,...]" set array of datasets colors (same in the every chart)

dset_interpolate:	"n[,n,n,...]" set array of datasets to interpolate (same in the every chart)
			example "1,0,1" means that 1,3 datasets in the chart draws with interpolation, 2 - without

font:			alias from <fonts>

font_name_size:		"n" set chart name font max initial size

font_legend_size:	"n" set chart legend font size

font_axis_size:		"n" set chart axis font size

scale:			"n" set chart image scale aspect

height:			"n" set resulting image height

space_after:		"n" set free space after chart
Was this helpful?
Thank you!