+ $oldLineWidth = $this->GetLineWidth();
+ $this->SetLineWidth($height + 1);
+ parent::line($this->pageWidth - $this->rightMargin, $row ,$this->leftMargin, $row);
+ $this->SetLineWidth($oldLineWidth);
+ }
+
+ /**
+ * Underlines the contents of a cell, but not the cell padding area.
+ * Primarily useful for the last line before a "totals" line.
+ * @param int $c Column number to underline.
+ * @param int $r Print the underline(s) this number of rows below the current position. Can be negative in order to go up.
+ * @param int $type Type of underlining to draw. Possible values are:<ul><li>1: single underline (default)</li><li>2: double underline</li></ul>
+ * @param int $linewidth Thickness of the line to draw. Default value of zero will use the current line width defined for this document.
+ * @param array $style Line style. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array).
+ * @access public
+ * @see SetLineWidth(), SetDrawColor(), SetLineStyle()
+ */
+ function UnderlineCell($c, $r = 0, $type = 1, $linewidth = 0, $style = array())
+ {
+ // If line width was specified, save current setting so we can reset it
+ if ($linewidth != 0)
+ {
+ $oldLineWidth = $this->GetLineWidth();
+ $this->SetLineWidth($linewidth);
+ }
+
+ // Figure out how far down to move the line based on current font size
+ // Calculate this because printing underline directly at $this->row goes on top
+ // of the parts of characters that "hang down", like the bottom of commas &
+ // lowercase letter 'g', etc.
+ if ($this->fontSize < 10)
+ $y_adj = 2;
+ else
+ $y_adj = 3;
+ parent::line($this->cols[$c] + $this->cMargin, $this->row - $r - $y_adj, $this->cols[$c + 1] - $this->cMargin, $this->row - $r - $y_adj, $style);
+
+ // Double underline, far enough below the first underline so as not to overlap
+ // the first underline (depends on current line thickness (aka "line width")
+ if ($type == 2)
+ parent::line($this->cols[$c] + $this->cMargin, $this->row - $r - $y_adj - ($this->GetLineWidth() + 2), $this->cols[$c + 1] - $this->cMargin, $this->row - $r - $y_adj - ($this->GetLineWidth() + 2), $style);
+
+ // If line width was specified, reset it back to the original setting
+ if ($linewidth != 0)
+ $this->SetLineWidth($oldLineWidth);
+ }
+
+ function NewLine($l=1, $np=0, $h = NULL)
+ {
+ // If the line height wasn't specified, use the current setting
+ if ($h == NULL)
+ $h = $this->lineHeight;
+
+ // Move one line down the page
+ $this->row -= ($l * $h);
+
+ // Check to see if we're at the bottom and should insert a page break
+ if ($this->row < $this->bottomMargin + ($np * $h))
+ $this->NewPage();
+ }
+
+ function NewPage()
+ {
+ if ($this->pageNumber==0)
+ {
+ // check if there is pdf header template for this report
+ // and set if it is found
+ $tmpl_pdf = find_custom_file("/reporting/forms/".$this->headerTmpl.".pdf");
+ if ($tmpl_pdf) {
+ $this->tmplSize = $this->setSourceFile($tmpl_pdf);
+ }
+ }
+
+ $this->pageNumber++;
+ parent::newPage();
+
+ if ($this->tmplSize) {
+ $this->row = $this->pageHeight - $this->topMargin; // reset row
+ $id = $this->importPage(min($this->pageNumber, $this->tmplSize));
+ $this->useTemplate($id);
+ }
+
+ // include related php file if any
+ $tmpl_php = find_custom_file("/reporting/forms/".$this->headerTmpl.".php");
+ if ($tmpl_php) {
+ include($tmpl_php);
+ }
+
+ if (method_exists($this, $this->headerTmpl)) // draw predefined page layout if any
+ $this->{$this->headerTmpl}();
+ }