OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Export table as CSV

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Export table as CSV

Postby jjgitties » Tue Jul 29, 2014 1:32 pm

Hello, I am trying to implement a simple action where the user clicks on a link and it exports the current data into a CSV file in browser. Similar to the link below.

http://snipplr.com/view/2234/export-mys ... ts-to-csv/

Is there a built into plugin or function I am use? We are using a very old version of OJS. I can see that there is a function in the new one

http://$sitename/index.php/journal/mana ... portPlugin

Can one copy and paste those plugins and use them in an older version?

My code in the DAO so far is:
Code: Select all
   function &exportToCSV() {
                $sql = 'SELECT * FROM table';
                $result = &$this->retrieve($sql);
               
                $out = '';
                $returner = &$this->_returnTableDataFromRow($result->GetRowAssoc(false));
      //$returner = new DAOResultFactory($result, $this, '_returnTableDataFromRow');
                $result->Close();

                print_r( $returner );
                die('exporting');
      return $returner;
   }          
jjgitties
 
Posts: 20
Joined: Tue Nov 12, 2013 11:11 am

Re: Export table as CSV

Postby asmecher » Tue Jul 29, 2014 1:39 pm

Hi jjgitties,

Back-porting code to an old release will cost you a lot of time -- potentially more than just upgrading. I'd suggest investing some time in an upgrade and you'll solve the CSV export problem in the bargain.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8851
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest