problems exporting

Questionsproblems exporting
josep asked 10 years ago

I have a PHPGRID whose data is loaded from an array

I want to export to CSV or Excel 7 for this use

$grid["export"] = array("format"=>"csv", "filename"=>"fichero_averias");

$g->set_actions(array(
"add"=>false,
"edit"=>false,
"delete"=>false,
"view"=>true,
"rowactions"=>false,
"autofilter" => true,
"export_csv"=>true,
"search" => "advance",
"showhidecolumns" => true,
"refresh" => false

)
) ;

but does not export any data, just an html header

example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
<html lang="es">

what can be due?

Regards,

2 Answers
josep answered 10 years ago

The header of the html was a blip.
The message I get is

Please specify tablename or select command

and opens a blank CSV file

Abu Ghufran answered 10 years ago

Make sure you set table to your array data.

$g->table = $arr;

Code: http://phpgrid.org/demo/demos/loading/load-array.phps
Live: http://phpgrid.org/demo/demos/loading/load-array.php

Your Answer

16 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?