Exporting Excel and PDF

I have problem with both exporting method.

As explained in instructions i put grid-excel-php and grid-pdf-php decompressed Archives in my codebase Archive while dhtmlxgrid_export.js was just present in “ext” Archive, inside Codebase
I included dhtmlxgrid_export.js in my page

This is an extract of the include from my page:

Cruscotto PMQC -------------------------------------------------------------------------------------------------------------- then i defined a toolbar and tested the buttons with this code:

toolbar.attachEvent(“onclick”,function(id){
if(id==“Estrai_Excel”){
ElenchiGrid.toExcel(“codebase/grid-excel-php/generate.php”);
}
if(id==“Estrai_Pdf”){
ElenchiGrid.toPDF(“codebase/grid-pdf-php/generate.php”);
}
});


with the first If on Excel, nothing happens. The browser (IE8) begin to work showing the progress bar but nothing else happens, no Windows are opened and no messages or error are shown.
I activate the debug in Generate.php and you can see attached the xml file in wich i don’t find anything strange.

With the second on PDF, something happens. Script open a Window but only an error message appears:

Fatal error: Call to a member function attributes() on a non-object in W:\www\test\codebase\grid-pdf-php\gridGenerator.php on line 267.

What’s wrong ? i don’t know what can i do !.

Many Thanks as Always.
debug_2013_06_05__23_42_47.zip (624 Bytes)

Hi,
you xml was exported correctly at local computer.
Please, try to update grid-pdf-php and grid-excel-php from attachment.
grid-excel-php.zip (790 KB)
grid-pdf-php.zip (979 KB)

Tanks Radyno,

I tried to use the file attached but nothing good. The results are exactly the same, included the error using PDF.

Other ideas !

I tried also to modify my grid excluding Split, Column grouping and the Custom Columns thinking that one of them could create the problem. Absolutuely nothing has changed.

A doubt. Is a particular php’s version required to run ? My server uses 5.1.1.1 and with the rest of your fantastic suite doesn’t seem to be problems !

Help please.

Hi,
please, provide a complete demo (including used js/css/images) to run it at local machine.
Export must work at PHP version 5.x.

Hi Radyno,

I finally built a demo to show you various problem that i’d like to solve.

I built the demo starting from your “contacts” tutorial so you can use your Database simply changing the paths to DB into the PHP scripts.

  1. Exporting Grid. As you can try in the demo when i try to export the grid with toExcel function nothin happens. The brower shows, just for a moment, the progress bar in the status bar below but Excel doesn’t run (of course Excel is normally installed on PC and runs correctly).
    Using toPDF functiont, instead, a window has open with the error that you can see in the attached picture (“to_pdf_error.jpg”)

  2. these other problems are on other arguments that i just described in this my post:
    viewtopic.php?f=2&t=30074

Picture: “disalignements.JPG”. This problem, that you could try with demo happens when, using Internet Explorer 8 (with 6 versione doesn’t happen), you click on a cell after having selected the row and mantain the pression for a moment. When you release the button the cell becomes shorter and the problem remains even if i scroll the grid. The same problem happens (always with IE8 and not with IE6) when you ungroup a group of column. In this case the column’s width doesn’t return to default.

Picture: “Problema01.JPG”. This is another problem linked to IE8 and runs correctly with IE6. I didn’t build it in the demo because i would need more data to show but is very strange. There is no way to align the words with the picture while with IE6 NO PROBLEM.

  1. this is not a real problem but it’s for me. (see Picture"order_Arrow_problem.JPG" and the demo). In my grid i have a 3 lines header and i understood that the grouped column in first row orders the grid on the first column. The problem is that i’d like that the orders arrows were enabled only on second line (the real column header) and disabled on the first line (only for grouping) and the third line (only for filtering). Is it possible ???

  2. and now last but no least, another strange behaviour (see “Tab_problem.JPG” and the demo).
    I’d like to use tabbars to built like a menu so i want to use different skins for the levels (row). The strange thing is that in second line i’m using “dhx_skyblue” skin, that’s my favourite and normally has black characters. If i use “dark_ blue” skin in the first line (characters white) this change the color to white also for “dhx_skyblue” tabbar. Why ? I’m using two different tabbar (see demo) not only one.

Many Many thanks for your patience but i hope to be useful for bug reporting.to_pdf_error.jpgdisalignements.JPGProblema01.JPGorder_Arrow_problem.JPGTab_problem.JPGgrid-excel-php.zip (799 KB)demo.zip (729 KB)


New post only for attaching Pictures.


Last post for attachments.

hi guys, where are you ?

Please i need your help.

Hi,
sorry for the delay in answerring.
I’ve tested your demo at local machine and it works correctly for me. I’ve generated PDF and Excel files.
Please, open file codebase/grid-pdf-php/generate.php and set variable $debug = true;
After that you should try to export your grid one more time. Then you will find in the same directory file debug.xml. Please, provide it.

Hi Radyno and welcome back. You were probably on holiday and holiday are a sacrament !

Thanks for your interesting in my problems. I attached the two debug report but i just checked this report without results.

The problem remains. with Excel nothing happens. No window or box are opened. With Pdf instead appears the window and the error that i attached to my previous post.

I also tried to enable the script debugger in Explorer but no error or warning. I also tried to use different pc to verify if the problem is caused by Excel installation but nothing.
I don’t know what else i can do.

Excuse me ! and what about the other problems that i described ?

debug_2013_06_28__11_09_11.zip (3.05 KB)debug_2013_06_28__11_09_11.zip (3.05 KB)
debug_2013_06_28__11_09_25.zip (3.05 KB)

Hi,
your debug file was exported correctly at local computer with export script which was attached earlier.
I guess some differences in server configuration may cause it.
Please, try to export file and then have a look at PHP log file. Maybe some error appears in log-file. If nothing then you should open file gridExcelWrapper.php and remove the follow line at the beginning:

error_reporting(0);

After that try to find errors in log-file.

Please, ask another questions here:
viewforum.php?f=2

This forum branch is only for export questions.

Many thanks Radyno

I found the solution. I used a more recent version of the web Server with a more recente PHP version and the export functions runs correctly. Probably my PHP previous version (5.1.1.1) was too old (e.g. PHP_ZIP.dll was non included).

For the other problems i can post somewhere else but you just have my demo to analize the problems ! and i just posted another post previously about these problems, except for “Order Arrows”, with no replies: viewtopic.php?f=2&t=30074.

Can you reply the same ? please

Thanks.