None of the exports are working under php 8 latest version of grid

QuestionsNone of the exports are working under php 8 latest version of grid
Michael Olson asked 2 years ago

I get a garbled mess for export and xls.

 

pdf I get the following error: TCPDF ERROR: Some data has already been output to browser, can’t send PDF file

 

csv doesn’t offer a download/save dialog

and HTML just displays a table.

6 Answers
Abu Ghufran Staff answered 2 years ago

Hello,

I can suggest better by reviewing the grid code.

There are usually 2 reasons for this.

1) Blank space character at the very start of current file OR some included file (new line or space or enter)
2) Invisible BOM character at start of file

In case #1, It will give header already sent error.

In case #2, It will push all pdf data binary as html text.

White spaces can be removed by checking top and end of all included files.
To remove invisible BOM character, i would recommend Notepad++ -> Open file -> Encoding menu -> Encode UTF without BOM

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Michael Olson answered 2 years ago

Here is code:


PHPGRID_DBTYPE,
"server" => PHPGRID_DBHOST,
"user" => PHPGRID_DBUSER,
"password" => PHPGRID_DBPASS,
"database" => PHPGRID_DBNAME
);

$g = new jqgrid($db_conf);

// set few params
$opt["caption"] = "Employee Paychex";
$opt["sortname"] = 'employee_sak';
$opt["sortorder"] = "asc";

$g->set_options($opt);

$g->set_actions(array(
"clone"=>false,
"bulkedit"=>false,
"rowactions"=>true,
"export"=>true,
"export_pdf"=>true,
"export_excel"=>true,
"export_csv"=>true,
"export_html"=>true,
"import"=>false,
"autofilter" => true,
"search" => "simple",
"inlineadd" => false,
"showhidecolumns" => true
));

// set database table for CRUD operations
$g->table = "employee_paychex";

// pass the cooked columns to grid
$g->set_columns($cols);

// render grid and get html/js output
$out = $g->render("list");
/* ******** Grid4PHP ******** */
?>

Abu Ghufran Staff answered 2 years ago

This code segment is fine. Issues could be when integrating this code with other files.
Please share complete file OR you can email me at [email protected] if there are many.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Michael Olson answered 2 years ago

Thanks Abu I have sent that code

Michael Olson answered 2 years ago

Heya did you get my email containing the code?

 

Abu Ghufran Staff answered 2 years ago

Yes, your code seems fine. We might need remote session to debug this case. I’ve sent you messages on email and googel chat as well.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

17 + 2 =

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?