Ejemplo n.º 1
0
 function PrepareForExcel($str, $encoding)
 {
     $ret = StringUtils::EscapeString($str, $encoding);
     if (substr($ret, 0, 1) == "=") {
         $ret = "=" . substr($ret, 1);
     }
     return $ret;
 }
Ejemplo n.º 2
0
 function RenderGrid(Grid $Grid)
 {
     $Rows = array();
     $HeaderCaptions = array();
     $Grid->GetDataset()->Open();
     foreach ($Grid->GetExportColumns() as $Column) {
         $HeaderCaptions[] = $Column->GetCaption();
     }
     while ($Grid->GetDataset()->Next()) {
         $rowValues = $Grid->GetDataset()->GetCurrentFieldValues();
         $Row = array();
         foreach ($Grid->GetExportColumns() as $Column) {
             $Row[] = StringUtils::EscapeString($this->RenderViewColumn($Column, $rowValues), $Column->GetGrid()->GetPage()->GetContentEncoding());
         }
         $Rows[] = $Row;
     }
     $this->DisplayTemplate('export/csv_grid.tpl', array('Grid' => $Grid), array('HeaderCaptions' => $HeaderCaptions, 'Rows' => $Rows));
 }
Ejemplo n.º 3
0
 private function PrepareColumnCaptionForXml($caption, $encoding)
 {
     return StringUtils::EscapeString(str_replace(' ', '', $caption), $encoding);
 }