Topic: Sequencing Header2() in reports

The FrontReport method Header2() uses the property $formData which gets populated in it's method SetCommonData(). Therefore in all the reports, the SetCommonData() method and it's dependant data must be called before the header2() method is called. It is the Header2() method that calls the doctext.inc and header2.inc file which need the elements of the $formData property.

The $formData property is primarily a single dimension array with fields from various tables and variables.
If the same field name is culled from several tables and populated into the said property, then only the last one prevails.

2 (edited by apmuthu 12/29/2014 07:07:39 pm)

Re: Sequencing Header2() in reports

For reporting/rep110.php the following is in order:

--- old/reporting/rep110.php    Mon Sep 29 21:21:28 2014
+++ new/reporting/rep110.php    Mon Dec 29 23:35:10 2014
@@ -94,13 +95,13 @@
                     $rep->filename = "Packing_slip" . $myrow['reference'] . ".pdf";
                 }
             }
-            $rep->SetHeaderType('Header2');
             $rep->currency = $cur;
             $rep->Font();
             $rep->Info($params, $cols, null, $aligns);
 
             $contacts = get_branch_contacts($branch['branch_code'], 'delivery', $branch['debtor_no'], true);
             $rep->SetCommonData($myrow, $branch, $sales_order, '', ST_CUSTDELIVERY, $contacts);
+            $rep->SetHeaderType('Header2');
             $rep->NewPage();
 
                $result = get_customer_trans_details(ST_CUSTDELIVERY, $i);

Re: Sequencing Header2() in reports

Thanks @joe: The sequencing of the header type assignment listed in the previous posts here is not necessary as the actual file inclusion of the header2.inc happens only when the new page method is called in line 944-945 of reporting/includes/pdf_report.inc. It still does no harm in keeping them together.