function each_line($val)
 {
     reportico_report::each_line($val);
     // Set the values for the fields in the record
     $this->results["data"][$this->line_ct] = array();
     if ($this->line_ct == 0) {
         $qn = get_query_column("golap", $this->columns);
         if ($qn) {
             $arr = explode(",", $qn->column_value);
             foreach ($arr as $k => $v) {
                 $arr1 = explode("=", $v);
                 $this->results["displaylike"][$arr1[0]] = $arr1[1];
             }
         }
     }
     foreach ($this->query->display_order_set["column"] as $col) {
         $qn = get_query_column($col->query_name, $this->columns);
         $coltitle = $col->derive_attribute("column_title", $col->query_name);
         $coltitle = str_replace("_", " ", $coltitle);
         $coltitle = ucwords(strtolower($coltitle));
         $coltitle = sw_translate($coltitle);
         $disp = $col->derive_attribute("column_display", "show");
         if ($disp == "hide") {
             continue;
         }
         $this->results["data"][$this->line_ct][$coltitle] = $qn->column_value;
     }
     $this->line_ct++;
 }
예제 #2
0
 function each_line($val)
 {
     reportico_report::each_line($val);
     // Set the values for the fields in the record
     $record = array();
     foreach ($this->query->display_order_set["column"] as $col) {
         $qn = get_query_column($col->query_name, $this->columns);
         $this->results[$qn->query_name][] = $qn->column_value;
         $ct = count($this->results[$qn->query_name]);
     }
 }
 function each_line($val)
 {
     reportico_report::each_line($val);
     if ($this->page_line_count == 1) {
         //$this->text .="<tr class='swPrpCritLine'>";
         //foreach ( $this->columns as $col )
         //$this->format_column_header($col);
         //$this->text .="</tr>";
     }
     $this->soapline = array();
     foreach ($this->query->display_order_set["column"] as $col) {
         $this->format_column($col);
     }
     $this->soapdata[] = new soapval('ReportLine', 'ReportLineType', $this->soapline);
 }
 function each_line($val)
 {
     reportico_report::each_line($val);
     if (session_request_item("target_style", "TABLE") == "FORM") {
         if (!$this->page_started) {
             $formpagethrow = $this->query->get_attribute("formBetweenRows");
             switch ($formpagethrow) {
                 case "newpage":
                     if ($this->page_line_count > 0) {
                         $formpagethrow = "swRepPageFormLine swNewPage";
                     } else {
                         $formpagethrow = "swRepPageFormLine";
                     }
                     break;
                 case "blankline":
                     $formpagethrow = "swRepPageFormBlank";
                     break;
                 case "solidline":
                     $formpagethrow = "swRepPageFormLine";
                     break;
             }
             $this->text .= '<TABLE class="' . $this->query->getBootstrapStyle("page") . 'swRepPage ' . $formpagethrow . '" ' . $this->get_style_tags($this->query->output_page_styles) . '>';
             $this->page_started = true;
         }
         foreach ($this->query->groups as $val) {
             for ($i = 0; $i < count($val->headers); $i++) {
                 $col =& $val->headers[$i];
                 $col =& $val->headers[$i]["GroupHeaderColumn"];
                 $custom = $val->headers[$i]["GroupHeaderCustom"];
                 $this->format_group_header($col, $custom, true);
             }
         }
         foreach ($this->query->display_order_set["column"] as $k => $w) {
             if ($w->attributes["column_display"] != "show") {
                 continue;
             }
             $this->format_group_header($w, false, false);
         }
         $this->page_line_count++;
         $this->line_count++;
         $this->text .= '</TABLE>';
         $this->page_started = false;
         return;
     }
     if ($this->page_line_count == 1) {
         //$this->text .="<tr class='swPrpCritLine'>";
         //foreach ( $this->columns as $col )
         //$this->format_column_header($col);
         //$this->text .="</tr>";
     }
     //foreach ( $this->columns as $col )
     if ($this->body_display == "show" && get_reportico_session_param("target_show_detail")) {
         $this->begin_line();
         if (!$this->page_started) {
             $this->text .= '<TABLE class="' . $this->query->getBootstrapStyle("page") . 'swRepPage" ' . $this->get_style_tags($this->query->output_page_styles) . '>';
             $this->page_started = true;
         }
         foreach ($this->query->display_order_set["column"] as $col) {
             $this->format_column($col);
         }
         $this->end_line();
     }
     //if ( $y < $this->abs_bottom_margin )
     //{
     //$this->finish_page();
     //$this->begin_page();
     //}
 }
예제 #5
0
 function each_line($val)
 {
     if (!$this->columns_calculated) {
         // Calulate position and width of column detail taking into account
         // Report Body and Page styles
         $this->calculateColumnMetrics();
         $this->columns_calculated = true;
     }
     reportico_report::each_line($val);
     if (session_request_item("target_style", "TABLE") == "FORM") {
         $this->end_line();
         // Throw new page if set to throw between rows
         $formpagethrow = $this->query->get_attribute("formBetweenRows");
         if ($this->line_count > 1 && $formpagethrow == "newpage") {
             $this->finish_page();
             $this->begin_page();
         }
         // Throw new page if current position + number headers + line + headers > than bottom margin
         $ln = 0;
         $totheaderheight = 0;
         $prevheight = $this->calculated_line_height;
         $this->apply_style_tags("ROW", $this->query->output_before_form_row_styles);
         $y = $this->document->GetY();
         $this->set_position($this->abs_left_margin, $y);
         $this->unapply_style_tags("ROW", $this->query->output_before_form_row_styles);
         foreach ($this->query->groups as $val) {
             for ($i = 0; $i < count($val->headers); $i++) {
                 $col =& $val->headers[$i]["GroupHeaderColumn"];
                 $this->format_group_header($col, false);
                 $totheaderheight += $this->calculated_line_height;
             }
         }
         foreach ($this->query->display_order_set["column"] as $k => $w) {
             if ($w->attributes["column_display"] != "show") {
                 continue;
             }
             $ct++;
             $this->format_group_header($w, false);
             $totheaderheight += $this->calculated_line_height;
         }
         $this->calculated_line_height = $totheaderheight;
         $y = $this->document->GetY();
         $this->check_page_overflow();
         $this->calculated_line_height = $prevheight;
         // Between form solid line or blank line
         if ($formpagethrow == "blankline") {
             $this->end_line();
             $this->end_line();
         } else {
             $this->end_line();
             $this->apply_style_tags("AFTERFORMROW", $this->query->output_after_form_row_styles);
             $y = $this->document->GetY();
             $this->set_position($this->abs_left_margin, $y);
             $this->draw_cell($this->abs_right_margin - $this->abs_left_margin, $this->vsize, "RR");
             // Blank cell to continue page breaking at this size
             $this->unapply_style_tags("AFTERFORMROW", $this->query->output_after_form_row_styles);
             $this->end_line();
         }
         return;
     }
     $y = $this->document->GetY();
     $this->check_graphic_fit();
     $this->yjump = 0;
     if ($this->body_display == "show" && get_reportico_session_param("target_show_detail")) {
         $this->row_styles = array();
         $this->apply_style_tags("EACHHEADMID", $this->mid_cell_reportbody_styles, false, false, "ROW");
         $this->apply_style_tags("EACHLINEMID", $this->mid_row_page_styles, false, false, "ROW");
         $this->apply_style_tags("ROW2", $this->mid_cell_row_styles, false, false, "ROW");
         $this->draw_mode = "CALCULATE";
         $this->no_columns_printed = 0;
         $this->no_columns_to_print = 0;
         $this->cell_row_top_addition = $this->all_page_row_styles["style_border_top"];
         $this->cell_row_bottom_addition = $this->all_page_row_styles["style_border_bottom"];
         foreach ($this->columns as $col) {
             $this->format_column($col);
         }
         $this->cell_row_top_addition = 0;
         $this->cell_row_bottom_addition = 0;
         $this->unapply_style_tags("ROW2", $this->mid_cell_row_styles);
         $this->unapply_style_tags("EACHLINEMID", $this->mid_row_page_styles);
         $this->unapply_style_tags("EACHHEADMID", $this->mid_cell_reportbody_styles);
         $this->draw_mode = "DRAW";
         $this->check_page_overflow();
         $prev_calculated_line_height = $this->calculated_line_height;
         $prev_current_line_height = $this->current_line_height;
         $prev_max_line_height = $this->max_line_height;
         if ($this->column_header_required) {
             $this->format_headers();
             $this->column_header_required = false;
         }
         $this->current_line_height = $prev_current_line_height;
         $this->calculated_line_height = $prev_calculated_line_height;
         $this->max_line_height = $prev_max_line_height;
         // Line page wrapper
         $this->new_report_page_line_by_style("LINE5PAGE", $this->mid_page_reportbody_styles, false);
         $this->new_report_page_line_by_style("LINE2PAGE", $this->mid_page_page_styles, false);
         $this->new_report_page_line_by_style("LINE2PAGE", $this->all_page_row_styles, false);
         // Page Styles
         $this->apply_style_tags("EACHHEADMID", $this->mid_cell_reportbody_styles, false, false, "ROW");
         $this->apply_style_tags("EACHLINEMID", $this->mid_row_page_styles, false, false, "ROW");
         $this->apply_style_tags("ROW2", $this->mid_cell_row_styles, false, false, "ROW");
         $this->cell_row_top_addition = $this->all_page_row_styles["style_border_top"];
         $this->cell_row_bottom_addition = $this->all_page_row_styles["style_border_bottom"];
         $this->no_columns_printed = 0;
         foreach ($this->columns as $col) {
             $this->format_column($col);
         }
         $this->cell_row_top_addition = 0;
         $this->cell_row_bottom_addition = 0;
         $this->page_line_count++;
         $this->unapply_style_tags("ROW2", $this->mid_cell_row_styles);
         $this->unapply_style_tags("EACHLINEMID", $this->mid_row_page_styles);
         $this->unapply_style_tags("EACHHEADMID", $this->mid_cell_reportbody_styles);
         $nextliney = $this->document->GetY() + $this->max_line_height;
         $this->end_line();
     }
 }
 function each_line($val)
 {
     // PDF
     reportico_report::each_line($val);
     if (session_request_item("target_style", "TABLE") == "FORM") {
         $this->end_line();
         // Throw new page if set to throw between rows
         $formpagethrow = $this->query->get_attribute("formBetweenRows");
         if ($this->line_count > 1 && $formpagethrow == "newpage") {
             $this->finish_page();
             $this->begin_page();
         }
         // Throw new page if current position + number headers + line + headers > than bottom margin
         $ln = 0;
         $totheaderheight = 0;
         $prevheight = $this->calculated_line_height;
         $this->apply_style_tags($this->query->output_before_form_row_styles);
         $y = $this->document->GetY();
         $this->set_position($this->abs_left_margin, $y);
         $this->draw_cell(400, $this->vsize, "");
         // Blank cell to continue page breaking at this size
         $this->unapply_style_tags($this->query->output_before_form_row_styles);
         foreach ($this->query->groups as $val) {
             for ($i = 0; $i < count($val->headers); $i++) {
                 $col =& $val->headers[$i]["GroupHeaderColumn"];
                 $this->format_group_header($col, false);
                 $totheaderheight += $this->calculated_line_height;
             }
         }
         foreach ($this->query->display_order_set["column"] as $k => $w) {
             if ($w->attributes["column_display"] != "show") {
                 continue;
             }
             $ct++;
             $this->format_group_header($w, false);
             $totheaderheight += $this->calculated_line_height;
         }
         $this->calculated_line_height = $totheaderheight;
         $y = $this->document->GetY();
         $this->check_page_overflow();
         $this->calculated_line_height = $prevheight;
         // Between form solid line or blank line
         if ($formpagethrow == "blankline") {
             $this->end_line();
             $this->end_line();
         } else {
             $this->end_line();
             $this->apply_style_tags($this->query->output_after_form_row_styles);
             $y = $this->document->GetY();
             $this->set_position($this->abs_left_margin, $y);
             $this->draw_cell($this->abs_right_margin - $this->abs_left_margin, $this->vsize, "");
             // Blank cell to continue page breaking at this size
             $this->unapply_style_tags($this->query->output_after_form_row_styles);
             $this->end_line();
         }
         return;
     }
     $y = $this->document->GetY();
     $this->check_graphic_fit();
     $this->yjump = 0;
     if ($this->body_display == "show" && get_reportico_session_param("target_show_detail")) {
         $this->row_styles = array();
         $this->apply_style_tags($this->query->output_row_styles, false, false, "ROW");
         $this->draw_mode = "CALCULATE";
         $this->no_columns_printed = 0;
         $this->no_columns_to_print = 0;
         foreach ($this->columns as $col) {
             $this->format_column($col);
         }
         $this->unapply_style_tags($this->query->output_row_styles);
         $this->draw_mode = "DRAW";
         $this->check_page_overflow();
         //$this->set_position($this->abs_left_margin, false);
         //$this->draw_cell($this->abs_right_margin - $this->abs_left_margin, $this->calculated_line_height, "xx", 0, 0);
         //$this->disable_style_tag($this->query->output_header_styles, "border-width");
         $this->apply_style_tags($this->query->output_row_styles, false, false, "ROW");
         $this->no_columns_printed = 0;
         foreach ($this->columns as $col) {
             $this->format_column($col);
         }
         $this->page_line_count++;
         $this->unapply_style_tags($this->query->output_row_styles);
         $nextliney = $this->document->GetY() + $this->max_line_height;
         $this->end_line();
         $this->set_position(false, $nextliney);
     }
     //if ( $this->yjump )
     //$this->set_position(false, $y + $this->yjump);
     //if ( $y + $this->vsize > $this->abs_bottom_margin )
     //{
     //$this->finish_page();
     //$this->begin_page();
     //}
 }
예제 #7
0
 function each_line($val)
 {
     reportico_report::each_line($val);
     // Excel requires group headers are printed as the first columns in the spreadsheet against
     // the detail.
     foreach ($this->query->groups as $name => $group) {
         if (count($group->headers) > 0) {
             foreach ($group->headers as $gphk => $col) {
                 $qn = get_query_column($col["GroupHeaderColumn"]->query_name, $this->query->columns);
                 $padstring = $qn->column_value;
                 echo "\"" . $padstring . "\"";
                 echo ",";
             }
         }
     }
     //foreach ( $this->columns as $col )
     foreach ($this->query->display_order_set["column"] as $col) {
         $this->format_column($col);
     }
     echo "\n";
 }
예제 #8
0
 function each_line($val)
 {
     reportico_report::each_line($val);
     //if ( $this->line_ct > 3 ) return;
     // Set the values for the fields in the record
     $this->results[] = array("id" => $this->line_ct, "cell" => array());
     $this->results[count($this->results) - 1]["cell"][] = "options";
     // Excel requires group headers are printed as the first columns in the spreadsheet against
     // the detail.
     foreach ($this->query->groups as $name => $group) {
         if (count($group->headers) > 0) {
             foreach ($group->headers as $gphk => $col) {
                 $qn = get_query_column($col->query_name, $this->query->columns);
                 $coltitle = $col->derive_attribute("column_title", $col->query_name);
                 $coltitle = str_replace("_", " ", $coltitle);
                 $coltitle = ucwords(strtolower($coltitle));
                 $coltitle = sw_translate($coltitle);
                 if ($col->query_name == $this->key_column) {
                     $this->results[count($this->results) - 1]["id"][] = $qn->column_value;
                 }
                 $this->results[count($this->results) - 1]["cell"][] = $qn->column_value;
                 if ($this->line_ct == 0) {
                     $this->colmodel[] = array("name" => $col->query_name, "index" => $col->query_name, "editable" => derive_jquerygrid_col_params($this->report_name, $col->query_name, "editable", false), "edittype" => "text", "sorttype" => "text", "jsonmap" => $col->query_name, "width" => derive_jquerygrid_col_params($this->report_name, $col->query_name, "width", "80"));
                     // Map colname to col
                     $this->colmap[$col->query_name] = count($this->colmodel) - 1;
                     if ($v = derive_jquerygrid_col_params($this->report_name, $col->query_name, "edittype", "")) {
                         $this->colmodel[count($this->colmodel) - 1]["edittype"] = $v;
                     }
                     if ($v = derive_jquerygrid_col_params($this->report_name, $col->query_name, "sorttype", "")) {
                         $this->colmodel[count($this->colmodel) - 1]["sorttype"] = $v;
                     }
                     if ($v = derive_jquerygrid_col_params($this->report_name, $col->query_name, "editoptions", "")) {
                         $this->colmodel[count($this->colmodel) - 1]["editoptions"] = $v;
                     }
                     if ($v = derive_jquerygrid_col_params($this->report_name, $col->query_name, "filtertype", "")) {
                         if ($v == "select") {
                             $this->colmodel[count($this->colmodel) - 1]["stype"] = "select";
                             if (!$this->colmodel[count($this->colmodel) - 1]["editoptions"]) {
                                 $this->colmodel[count($this->colmodel) - 1]["editoptions"] = array();
                                 $this->colfilters[$col->query_name] = array();
                                 $this->colmodel[count($this->colmodel) - 1]["editoptions"]["value"] = ":All";
                             }
                         }
                     }
                     $this->colnames[] = $coltitle;
                 }
                 if ($this->colmodel[$this->colmap[$col->query_name]]["stype"] == "select") {
                     if (!array_key_exists($qn->column_value, $this->colfilters[$col->query_name])) {
                         //$this->colmodel[$this->colmap[$col->query_name]]["editoptions"][$qn->column_value] = $qn->column_value;
                         $this->colfilters[$col->query_name][$qn->column_value] = "1";
                         $this->colmodel[$this->colmap[$col->query_name]]["editoptions"]["value"] .= ";" . $qn->column_value . ":" . $qn->column_value;
                     }
                 }
             }
         }
     }
     foreach ($this->query->display_order_set["column"] as $col) {
         $qn = get_query_column($col->query_name, $this->columns);
         $coltitle = $col->derive_attribute("column_title", $col->query_name);
         $coltitle = str_replace("_", " ", $coltitle);
         $coltitle = ucwords(strtolower($coltitle));
         $coltitle = sw_translate($coltitle);
         if ($col->query_name == $this->key_column) {
             $this->results[count($this->results) - 1]["id"] = $qn->column_value;
         }
         $disp = $col->derive_attribute("column_display", "show");
         if ($disp == "hide") {
             continue;
         }
         if ($this->line_ct == 0) {
             $this->colmodel[] = array("name" => $col->query_name, "index" => $col->query_name, "editable" => derive_jquerygrid_col_params($this->report_name, $col->query_name, "editable", false), "edittype" => "text", "sorttype" => "int", "jsonmap" => $col->query_name, "width" => derive_jquerygrid_col_params($this->report_name, $col->query_name, "width", "80"));
             // Map colname to col
             $this->colmap[$col->query_name] = count($this->colmodel) - 1;
             if ($v = derive_jquerygrid_col_params($this->report_name, $col->query_name, "hidden", "")) {
                 $this->colmodel[count($this->colmodel) - 1]["hidden"] = $v;
             }
             if ($v = derive_jquerygrid_col_params($this->report_name, $col->query_name, "edittype", "")) {
                 $this->colmodel[count($this->colmodel) - 1]["edittype"] = $v;
             }
             if ($v = derive_jquerygrid_col_params($this->report_name, $col->query_name, "sorttype", "")) {
                 $this->colmodel[count($this->colmodel) - 1]["sorttype"] = $v;
             }
             if ($v = derive_jquerygrid_col_params($this->report_name, $col->query_name, "filtertype", "")) {
                 if ($v == "select") {
                     $this->colmodel[count($this->colmodel) - 1]["stype"] = "select";
                     if (!$this->colmodel[count($this->colmodel) - 1]["editoptions"]) {
                         $this->colmodel[count($this->colmodel) - 1]["editoptions"] = array();
                         $this->colfilters[$col->query_name] = array();
                         $this->colmodel[count($this->colmodel) - 1]["editoptions"]["value"] = ":All";
                     }
                 }
             }
             if ($v = derive_jquerygrid_col_params($this->report_name, $col->query_name, "editoptions", "")) {
                 $this->colmodel[count($this->colmodel) - 1]["editoptions"] = $v;
             }
             $this->colnames[] = $coltitle;
         }
         // Add value to filter options if type is select
         if ($this->colmodel[$this->colmap[$col->query_name]]["stype"] == "select") {
             if (!array_key_exists($qn->column_value, $this->colfilters[$col->query_name])) {
                 //$this->colmodel[$this->colmap[$col->query_name]]["editoptions"][$qn->column_value] = $qn->column_value;
                 $this->colfilters[$col->query_name][$qn->column_value] = "1";
                 $this->colmodel[$this->colmap[$col->query_name]]["editoptions"]["value"] .= ";" . $qn->column_value . ":" . $qn->column_value;
             }
         }
         $this->results[count($this->results) - 1]["cell"][] = $qn->column_value;
     }
     // $this->results[] = $cells;
     $this->line_ct++;
 }