Welcome Guest, Not a member yet? Register   Sign In
how to export html table to excel || new question -> how to export rows generated by mysql queries to excel??
#8

[eluser]johnmiller[/eluser]
Thanks a lot...
but, dcunited08, your code is for creating CSV file, right?
I would like to create an excel.
Derek is right, dynamic means generated by db only.
And actually I am exporting to excel using query.
Means... suppose... I have first_name and last_name in the dynamic table.
If I hit 'export to excel' button, all the details related to listed people have to export to excel (like first_name, last_name, address, city, state, zip etc...)
So I am trying to export data from database to excel (using query)

I tried using http://codeigniter.com/wiki/Excel_Plugin/

The below is what I did

controller

Code:
function app_details_export()
    {
       $id = $this->uri->segment(3);
       $this->load->plugin('to_excel');
       to_excel($this->app_model->app_export($id));
       to_excel($query, 'app_details');
       to_excel($query);
    }

model

Code:
function app_export($id)
    {    
       $this->load->plugin('to_excel');
       // my select query here...
       to_excel($query, 'app_details');
    }

and /system/plugins/to_excel_pi.php

but when i run this, i get a fatal error like below...

Fatal error: Call to a member function field_data() on a non-object in C:\wamp\www\mywork\system\plugins\to_excel_pi.php on line 15


Messages In This Thread
how to export html table to excel || new question -> how to export rows generated by mysql queries to excel?? - by El Forum - 11-17-2008, 02:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB