Logo Search packages:      
Sourcecode: facturalux version File versions  Download package

void MReportEngine::initTemplate (  )  [protected]

Walks the document tree, setting the report layout

Definition at line 603 of file mreportengine.cpp.

References dFooters, dHeaders, pFooter, pHeader, rFooter, rHeader, rt, setDetailAttributes(), setDetMiscAttributes(), setReportAttributes(), and setSectionAttributes().

{
  QDomNode report;
  QDomNode child;

  // Get the report - assume there is only one.

  for (report = rt.firstChild (); !report.isNull (); report = report.nextSibling ())
      if (report.nodeName () == "KugarTemplate")
        break;

  setReportAttributes (&report);

  // Get all the child report elements
  QDomNodeList children = report.childNodes ();
  int childCount = children.length ();

  for (int j = 0; j < childCount; j++)
      {
        child = children.item (j);

        if (child.nodeType () == QDomNode::ElementNode)
            {
              // Report Header
              if (child.nodeName () == "ReportHeader")
                  setSectionAttributes (&rHeader, &child);
              else if (child.nodeName () == "PageHeader")
                  setSectionAttributes (&pHeader, &child);
              else if (child.nodeName () == "DetailHeader")
                  {
                    MReportSection *dHeader = new MReportSection;

                    dHeaders.append (dHeader);
                    setDetMiscAttributes (dHeader, &child);
                  }
              else if (child.nodeName () == "Detail")
                  setDetailAttributes (&child);
              else if (child.nodeName () == "DetailFooter")
                  {
                    MReportSection *dFooter = new MReportSection;

                    setDetMiscAttributes (dFooter, &child);
                    dFooters.append (dFooter);
                  }
              else if (child.nodeName () == "PageFooter")
                  setSectionAttributes (&pFooter, &child);
              else if (child.nodeName () == "ReportFooter")
                  setSectionAttributes (&rFooter, &child);
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index