ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Need to Export Individual Results in Excel

Max_admin 30 Dec, 2008
Hi CS,

the problem is more related to your server config, I think somebody posted more details about this here in the forums before, you better try to use the CSV backup!

Regards
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
codeslayer 30 Dec, 2008
I want as it used to be the next page with full results.
I have pasted the above suggested code next edit link.

here is the code i pasted next to edit link:
	<p><a href="<?php     
            global $mainframe;
           $database =& JFactory::getDBO();

           include_once JPATH_BASE.DS.'administrator/components/com_chronocontact/excelwriter/'."Writer.php";
           //echo $_POST['formid'];
           //$formid = JRequest::getVar( 'formid', array(), 'post', 'array');
           $database->setQuery( "SELECT name FROM jos_chronoforms_cmcycle" );
           $formname = "anyform";//$database->loadResult();
           
           $tablename = "jos_chronoforms_cmcycle";
           $tables = array( $tablename );
           $result = $database->getTableFields( $tables );
           $table_fields = array_keys($result[$tablename]);
           
           $database->setQuery( "SELECT * FROM ".$tablename."" );
           $datarows = $database->loadObjectList();
           
           $xls =& new Spreadsheet_Excel_Writer();
           $xls->setVersion(8); // this fixes the 255 limit issue!🙂
           $xls->send("ChronoForms - ".$formname." - ".date("j_n_Y").".xls");
           $format =& $xls->addFormat();
           $format->setBold();
           $format->setColor("blue");
           if (strlen($formname) > 10){$formname = substr($formname,0,10);};
           $sheet =& $xls->addWorksheet($formname.' at '.date("m-d-Y"));
           $sheet->setInputEncoding('utf-8');

           $titcol = 0;
           foreach($table_fields as $table_field){
              $sheet->writeString(0, $titcol, $table_field, $format);
              $titcol++;
           }
                 
                 
           $datacol = 0;
           $rowcount = 1;
           foreach($datarows as $datarow){
              foreach($table_fields as $table_field){
                 $sheet->writeString($rowcount, $datacol, $datarow->$table_field, 0);
                 $datacol++;
              }
              $datacol = 0;
              $rowcount++;
           }
                 
           $xls->close();
           exit;
    ?>">excel</a></p>


What shoud I do to make working ?
codeslayer 30 Dec, 2008
Hi Max,

Thanks for the reply, I'll search for that too.
Meanwhile I have sent you 2 PMs yesterday, Please consider🙂

Regards
CS
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com