forked from reportico-web/reportico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reportico_defaults.php.example
113 lines (100 loc) · 4.84 KB
/
reportico_defaults.php.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/*
* Global reportico customization ..
* Set styles :-
* Styles can be applied to the report body, details page, group headers, trailers,
* cell styles and are specified as a series of CSS like parameters.
* Styles are applied to HTML and PDF formats
*
* Add page headers, footers with styles to apply to every report page
*
*/
function reportico_defaults($reportico)
{
// Grey report body with black border and defautl font trebuchet
$styles = array(
"background-color" => "#cccccc",
"border-width" => "2px 2px 2px 2px",
"border-style" => "solid",
"border-color" => "#000000",
"color" => "#003f00",
"padding" => "0 20 0 20",
"margin" => "0 0 0 5",
"font-family" => "trebuchet",
);
$reportico->apply_styleset("BODY", $styles, false, "PDF");
// Lght blue report detail sections with dark blue border
$styles = array(
"background-color" => "#ddeeee",
"border-width" => "8px 8px 8px 8px",
"border-style" => "solid",
"border-color" => "#777777",
"color" => "#003f00",
"margin" => "0 5 0 5",
);
$reportico->apply_styleset("PAGE", $styles, false, "PDF");
// Light grey detail row section
$styles = array(
"background-color" => "#eeeeee",
"margin" => "0 10 0 10",
);
$reportico->apply_styleset("ROW", $styles, false, "PDF");
// White on black group headers and big text in different font
// And force page break if 8cm not available
$styles = array(
"background-color" => "#000000",
"color" => "#ffffff",
"font-family" => "comic",
"font-size" => "18px",
"padding" => "0 10 0 10",
"requires-before" => "8cm",
"margin" => "0 10 0 0",
);
$reportico->apply_styleset("GROUPHEADERVALUE", $styles, false, "PDF");
$styles = array(
"background-color" => "#000000",
"color" => "#ffffff",
"font-family" => "comic",
"font-size" => "18px",
"padding" => "0 10 0 10",
"margin" => "0 0 0 0",
"requires-before" => "8cm",
);
$reportico->apply_styleset("GROUPHEADERLABEL", $styles, false, "PDF");
// Every cell has a border
$styles = array(
"font-family" => "times",
"border-width" => "1px 1px 1px 1px",
"border-style" => "solid",
"border-color" => "#888888",
);
$reportico->apply_styleset("ALLCELLS", $styles, false, "PDF");
$styles = array(
"color" => "#880000",
"font-weight" => "bold",
"font-style" => "italic",
);
$reportico->apply_styleset("CELL", $styles, "id", "PDF");
$styles = array(
"font-weight" => "bold",
"font-style" => "italic",
"color" => "#bbbb00",
);
$reportico->apply_styleset("COLUMNHEADERS", $styles, false, "PDF");
// Create Report Title Page Header on every page of PDF
$reportico->create_page_header("H1", 1, "Report: {REPORT_TITLE}{STYLE border-width: 1 1 1 1; border-color: #000000; font-size: 18; border-style: solid;padding:10px 14px 0px 6px; height:1cm;margin: 1cm 0cm 0cm 4cm; color: #000000; width: 90%}" );
$reportico->set_page_header_attribute("H1", "ShowInHTML", "no" );
$reportico->set_page_header_attribute("H1", "ShowInPDF", "yes" );
$reportico->set_page_header_attribute("H1", "Justify", "right" );
// Create Image on every page of PDF
$reportico->create_page_header("H2", 1, "{STYLE width: 100; height: 50; margin: 0 0 0 0; background-color: #003333; background-image:images/reportico100.png;}" );
$reportico->set_page_header_attribute("H2", "ShowInHTML", "no" );
// Create Image on every page of PDF
$reportico->create_page_header("H3", 1, "Time: date('Y-m-d H:i:s'){STYLE font-size: 18; text-align: right}" );
$reportico->set_page_header_attribute("H3", "ShowInHTML", "no" );
$reportico->set_page_header_attribute("H3", "Justify", "right" );
// Create Page No on bottom of PDF page
$reportico->create_page_footer("F1", 1, "Page: {PAGE}{STYLE margin: 2 0 0 0; }" );
//$reportico->set_page_header_attribute("H1", "Justify", "center" );
}
?>