<?php $data[0] = array('company', 'region', 'district', 'store', 'sales'); $data[1] = array('Foo, Inc.', 'Region A', 'District X', 'Store #1', 1500.0); $data[2] = array('Foo, Inc.', 'Region A', 'District X', 'Store #2', 1300.0); $data[3] = array('Foo, Inc.', 'Region A', 'District Y', 'Store #3', 2000.0); $data[4] = array('Foo, Inc.', 'Region A', 'District Y', 'Store #4', 1800.0); $data[5] = array('Foo, Inc.', 'Region B', 'District M', 'Store #11', 2500.0); $data[6] = array('Foo, Inc.', 'Region B', 'District M', 'Store #12', 2300.0); $data[7] = array('Foo, Inc.', 'Region B', 'District N', 'Store #13', 3000.0); $data[8] = array('Foo, Inc.', 'Region B', 'District N', 'Store #14', 2800.0); $rlib = rlib_init(); rlib_version(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); $output_format = 'xml'; if (isset($argv[1])) { $output_format = $argv[1]; } rlib_add_report($rlib, "breaks.xml"); rlib_set_output_format_from_text($rlib, $output_format); rlib_set_output_parameter($rlib, "debugging", "yes"); rlib_set_output_parameter($rlib, "only_quote_strings", "yes"); rlib_set_locale($rlib, "en_US"); rlib_execute($rlib); // header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
$moredata[39][0] = "39"; $moredata[40][0] = "40"; $moredata[41][0] = "41"; $moredata[42][0] = "42"; $moredata[43][0] = "43"; $moredata[44][0] = "44"; $moredata[45][0] = "45"; $moredata[46][0] = "46"; $moredata[47][0] = "47"; $moredata[48][0] = "48"; $moredata[49][0] = "49"; $moredata[50][0] = "50"; $moredata[51][0] = "51"; $moredata[52][0] = "52"; $moredata[53][0] = "53"; $moredata[54][0] = "54"; $moredata[55][0] = "55"; $moredata[56][0] = "56"; $moredata[57][0] = "57"; $moredata[58][0] = "58"; $moredata[59][0] = "59"; $rlib = rlib_init(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_add_query_as($rlib, "local_array", "moredata", "moredata"); rlib_add_report($rlib, "flow_part.xml"); rlib_set_output_format_from_text($rlib, "pdf"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
$data[6][1] = "13"; $data[6][2] = "18"; $data[6][3] = "Task B"; $data[6][4] = "B'"; $data[6][5] = "red"; $data[6][6] = "white"; $data[7][0] = "3"; $data[7][1] = "13"; $data[7][2] = "22"; $data[7][3] = "Task C"; $data[7][4] = "C'"; $data[7][5] = "red"; $data[7][6] = "white"; $data[8][0] = "4"; $data[8][1] = "13"; $data[8][2] = "23"; $data[8][3] = "Task D"; $data[8][4] = "D'"; $data[8][5] = "red"; $data[8][6] = "white"; $rlib = rlib_init(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "header_data", "header_data"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_set_output_parameter($rlib, "html_image_directory", "/tmp"); rlib_set_output_parameter($rlib, "trim_links", "1"); rlib_add_report($rlib, "gantt.xml"); rlib_set_output_format_from_text($rlib, "html"); rlib_execute($rlib); rlib_spool($rlib); rlib_free($rlib);
$data[0][0] = "first_name"; $data[0][1] = "last_name"; $data[0][2] = "color"; $data[0][3] = "group"; $data[0][4] = "breakfast"; $data[1][0] = "Bob"; $data[1][1] = "Doan"; $data[1][2] = "blue"; $data[1][3] = "1"; $data[1][4] = "Green Eggs And Spam I Am I Am"; $Alloc_Cnt = "-1"; $rlib = rlib_init(); rlib_set_locale($rlib, "pt_BR"); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_add_report($rlib, "expressions.xml"); rlib_add_function($rlib, "bobdoan", "bobdoan", 1); rlib_add_function($rlib, "mikeroth", "mike_roth", 2); rlib_set_output_format_from_text($rlib, "text"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib); function mike_roth($a, $b) { return "pancakes are yummier then {$a} and {$b}"; } function bobdoan($a) { return strtoupper($a); }
} $data[0][0] = "row_field"; $data[0][1] = "bar_start"; $data[0][2] = "bar_stop"; $data[0][3] = "label_field"; $data[0][4] = "bar_label"; $data[0][5] = "bar_color"; $data[0][6] = "bar_label_color"; for ($i = 1; $i <= 18; $i++) { $data[$i][0] = $i; $data[$i][1] = $i; $data[$i][2] = $i + 4; $data[$i][3] = $i; $data[$i][4] = $colors[$i - 1]; $data[$i][5] = $colors[$i - 1]; $data[$i][6] = "black"; if ($colors[$i - 1] == "black" || $colors[$i - 1] == "navy") { $data[$i][6] = "white"; } } $rlib = rlib_init(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "header_data", "header_data"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_set_output_parameter($rlib, "html_image_directory", "/tmp"); rlib_set_output_parameter($rlib, "trim_links", "1"); rlib_add_report($rlib, "gantt_colors.xml"); rlib_set_output_format_from_text($rlib, "html"); rlib_execute($rlib); rlib_spool($rlib); rlib_free($rlib);
$inventory[1][8] = "0"; $inventory[1][9] = "0"; $inventory[1][10] = "0"; $inventory[2][0] = "2"; $inventory[2][1] = "BUN, KAISER"; $inventory[2][2] = ".70"; $inventory[2][3] = "DOZEN"; $inventory[2][4] = "176"; $inventory[2][5] = "0"; $inventory[2][6] = "0"; $inventory[2][7] = "0"; $inventory[2][8] = "0"; $inventory[2][9] = "0"; $inventory[2][10] = "0"; $sillypants = 5; $rlib = rlib_init(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "yields", "yields"); rlib_add_query_as($rlib, "local_array", "coupons", "coupons"); rlib_add_query_as($rlib, "local_array", "deposits", "deposits"); rlib_add_query_as($rlib, "local_array", "petty_cash", "petty_cash"); rlib_add_query_as($rlib, "local_array", "misc_income", "misc_income"); rlib_add_query_as($rlib, "local_array", "inv_transfer", "inv_transfer"); rlib_add_query_as($rlib, "local_array", "inventory", "inventory"); rlib_add_report($rlib, "fixed_part.xml"); rlib_set_output_format_from_text($rlib, "xml"); rlib_signal_connect($rlib, "part_iteration", "callback"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
<?php dl("rlib.so"); $hostname = "localhost"; $username = "******"; $password = "******"; $database = "rlib"; $rlib = rlib_init(); rlib_add_datasource_odbc($rlib, "local_mysql", "test", "user", "password"); rlib_add_query_as($rlib, "local_mysql", "select * FROM plu", "products"); rlib_add_report($rlib, "products.xml"); rlib_set_output_format_from_text($rlib, "txt"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
$sales_data2[4] = array('Foo, Inc.', 'Region A', 'District Y', 'Store #4', 1800.0); $sales_data2[5] = array('Foo, Inc.', 'Region B', 'District M', 'Store #11', 2500.0); $sales_data2[6] = array('Foo, Inc.', 'Region B', 'District M', 'Store #12', 2300.0); $sales_data2[7] = array('Foo, Inc.', 'Region B', 'District N', 'Store #13', 3000.0); $sales_data2[8] = array('Foo, Inc.', 'Region B', 'District N', 'Store #14', 2800.0); $rlib = rlib_init(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_add_query_as($rlib, "local_array", "line_data", "line_data"); rlib_add_query_as($rlib, "local_array", "pie_data", "pie_data"); rlib_add_query_as($rlib, "local_array", "pie_data2", "pie_data2"); rlib_add_query_as($rlib, "local_array", "sales_data", "sales_data"); rlib_add_query_as($rlib, "local_array", "sales_data2", "sales_data2"); rlib_set_output_parameter($rlib, "html_image_directory", "/tmp"); rlib_set_output_parameter($rlib, "trim_links", "1"); rlib_add_report($rlib, "graph.xml"); $allowable_formats = array('pdf', 'xml', 'txt', 'csv', 'html'); if (isset($argv[1]) && in_array($argv[1], $allowable_formats)) { rlib_set_output_format_from_text($rlib, $argv[1]); } else { if (isset($_REQUEST['format']) && in_array($_REQUEST['format'], $allowable_formats)) { rlib_set_output_format_from_text($rlib, $_REQUEST['format']); } else { rlib_set_output_format_from_text($rlib, "xml"); } } rlib_execute($rlib); //header(rlib_get_content_type($rlib)); $ct = rlib_get_content_type($rlib); $my_header = split("\n", rlib_get_content_type($rlib)); foreach ($my_header as $x) {
$data[10][3] = "2"; $data[11][0] = "Jennifer"; $data[11][1] = "Jennifer"; $data[11][2] = "purple"; $data[11][3] = "2"; $data[12][0] = "Lauren"; $data[12][1] = "Lauren"; $data[12][2] = "purple"; $data[12][3] = "2"; $data[13][0] = "Logan"; $data[13][1] = "Logan"; $data[13][2] = "purple"; $data[13][3] = "2"; $data[14][0] = "Eggs"; $data[14][1] = "Eggs"; $data[14][2] = "purple"; $data[14][3] = "2"; $data[15][0] = "Bacon"; $data[15][1] = "Bacon"; $data[15][2] = "purple"; $data[15][3] = "2"; $rlib = rlib_init(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_add_report($rlib, "pages_across.xml"); // rlib_add_report($rlib, "x.xml"); rlib_set_output_format_from_text($rlib, "html"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
<?php dl("rlib.so"); $rlib = rlib_init(); rlib_version(); rlib_add_datasource_xml($rlib, "local_xml"); rlib_add_query_as($rlib, "local_xml", "data.xml", "data"); rlib_add_report($rlib, "array.xml"); rlib_set_output_format_from_text($rlib, "pdf"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
$data[2][3] = "1"; $data[2][4] = "Green Eggs And Spam I Am I Am"; $data[3][0] = "Mike"; $data[3][1] = "Roth"; $data[3][2] = "yellow"; $data[3][3] = "2"; $data[3][4] = "Green Eggs And Spam I Am I Am"; $data[4][0] = "Bob"; $data[4][1] = "Kratz"; $data[4][2] = "pink"; $data[4][3] = "2"; $data[4][4] = "Green Eggs And Spam I Am I Am"; $data[5][0] = "Steve"; $data[5][1] = "Tilden"; $data[5][2] = "purple"; $data[5][3] = "2"; $data[5][4] = "Dude"; $more_data[0][0] = "initials"; $more_data[1][0] = "WRD"; $more_data[2][0] = "ERB"; $rlib = rlib_init(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); // rlib_add_query_as($rlib, "local_array", "more_data", "more_data"); // rlib_add_resultset_follower($rlib, "data", "more_data"); rlib_add_report($rlib, "follower.xml"); rlib_set_output_format_from_text($rlib, "txt"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
$data[36][3] = "Doylestown"; $data[36][4] = "PA"; $data[36][5] = "18901"; $data[37][0] = "SICOM Systems 37"; $data[37][1] = "4140 Skyron Drive"; $data[37][2] = "Test Suite Abc"; $data[37][3] = "Doylestown"; $data[37][4] = "PA"; $data[37][5] = "18901"; $data[38][0] = "SICOM Systems 38"; $data[38][1] = "4140 Skyron Drive"; $data[38][2] = "Test Suite Abc"; $data[38][3] = "Doylestown"; $data[38][4] = "PA"; $data[38][5] = "18901"; $data[39][0] = "SICOM Systems 39"; $data[39][1] = "4140 Skyron Drive"; $data[39][2] = "Test Suite Abc"; $data[39][3] = "Doylestown"; $data[39][4] = "PA"; $data[39][5] = "18901"; $rlib = rlib_init(); rlib_version(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_add_report($rlib, "labels.xml"); rlib_set_output_format_from_text($rlib, "pdf"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
<?php $rlib = rlib_init(); rlib_add_datasource_csv($rlib, "local_csv"); rlib_add_query_as($rlib, "local_csv", "data.csv", "data"); rlib_add_report($rlib, "csv.xml"); rlib_set_output_format_from_text($rlib, "json"); rlib_set_output_parameter($rlib, "debugging", "yes"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
$data[2][1] = "Eburuschkin"; $data[2][2] = "green"; $data[2][3] = "1"; $data[2][4] = "Green Eggs And Spam I Am I Am"; $data[3][0] = "Mike"; $data[3][1] = "Roth"; $data[3][2] = "yellow"; $data[3][3] = "2"; $data[3][4] = "Green Eggs And Spam I Am I Am"; $data[4][0] = "Bob"; $data[4][1] = "Kratz"; $data[4][2] = "pink"; $data[4][3] = "2"; $data[4][4] = "Green Eggs And Spam I Am I Am"; $data[5][0] = "Steve"; $data[5][1] = "Tilden"; $data[5][2] = "purple"; $data[5][3] = "2"; $data[5][4] = "Dude"; $rlib = rlib_init(); rlib_version(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_add_report($rlib, "hungary.xml"); rlib_set_output_format_from_text($rlib, "pdf"); rlib_set_output_encoding($rlib, "ISO8859-2"); // rlib_set_output_encoding($rlib, "UTF-8"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
$data[4][2] = "pink"; $data[4][3] = "2"; $data[4][4] = "Green Eggs And Spam I Am I Am"; $data[4][5] = "4"; $data[5][0] = "Steve"; $data[5][1] = "Tilden"; $data[5][2] = "purple"; $data[5][3] = "2"; $data[5][4] = "Dude"; $data[5][5] = "82"; $data[6][0] = "Steve"; $data[6][1] = "Tilden 2"; $data[6][2] = "purple"; $data[6][3] = "2"; $data[6][4] = "Dude"; $data[6][5] = "82"; $data[7][0] = "Steve"; $data[7][1] = "Tilden 3"; $data[7][2] = "purple"; $data[7][3] = "2"; $data[7][4] = "Dude"; $data[7][5] = "82"; $rlib = rlib_init(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_add_report($rlib, "images.xml"); rlib_set_output_format_from_text($rlib, "pdf"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);
$data[0][3] = "constitution"; for ($i = 0; $i < 1; $i++) { $spot = 1 + $i * 4; $data[$spot][0] = "Line 1"; $data[$spot][1] = "Mike"; $data[$spot][2] = "Roth Loves All The Letters Of The Alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL"; $data[$spot][3] = "0"; $data[$spot + 1][0] = "Line 2"; $data[$spot + 1][1] = $bill; $data[$spot + 1][2] = $constitution; $data[$spot + 1][3] = "2"; $data[$spot + 2][0] = "Line 3"; $data[$spot + 2][1] = "Oscar"; $data[$spot + 2][2] = "Meyer"; $data[$spot + 2][3] = "0"; $data[$spot + 3][0] = "Line 4"; $data[$spot + 3][1] = $constitution; $data[$spot + 3][2] = $bill; $data[$spot + 3][3] = "1"; } $rlib = rlib_init(); rlib_version(); rlib_add_datasource_array($rlib, "local_array"); rlib_add_query_as($rlib, "local_array", "data", "data"); rlib_add_report($rlib, "multiline.xml"); rlib_set_output_format_from_text($rlib, "pdf"); rlib_set_output_parameter($rlib, "debugging", "yes"); rlib_execute($rlib); header(rlib_get_content_type($rlib)); rlib_spool($rlib); rlib_free($rlib);