PDA

View Full Version : form submit and sending headers(to open excel, for example)



aramaki
23 Jan 2011, 7:02 AM
hi 2 all.
i have the simple formpanel, on submit I`ve send some params and at succcess I expect to make xls file and send it to browser (for open or save) by users. but in this case ajax coomunications failed, so as I`ve send some additional headers by server-side.
is any solutions for this problem
// yes, in princible it`s possible to save file at server and show user just link, but I guess it is not better solution
thx

fay
23 Jan 2011, 7:45 AM
Can you clarify your question?

Is it "how do I send additional headers to the server?" This was answered yesterday - http://www.sencha.com/forum/showthread.php?121750-How-can-I-add-headers-to-getForm.Submit()-calls

See also:

http://www.sencha.com/forum/showthread.php?32400-GridPanel-directly-to-Excel.
http://www.sencha.com/forum/showthread.php?121864-Exporting-to-Excel

valititi
23 Jan 2011, 2:39 PM
heuh... yes. just spoke few days before on :
http://www.sencha.com/forum/showthread.php?121864-Exporting-to-Excel. (http://www.sencha.com/forum/showthread.php?121864-Exporting-to-Excel)
Nothing else to do on Ext, just a simple call to the php server file, and there, you have all the freedom to make 100% what you wish by sending pure html (ONLY body content ! without <html><head>...<body> and </body><html>). Just what you will normally put in the between <body> and </body>. You can specify all the css you want, link on images, etc..
Good luck :-)

aramaki
23 Jan 2011, 11:37 PM
no,guys. I`ve just send some params via Ajax to server-side of application,then i make xls file by php and send it to browser. then sending it starting, ajax communication have got error, because some headers and files going to output.
thx

valititi
23 Jan 2011, 11:45 PM
"no,guys" means that this don't work ?
heuh... because this works very well at at least 2-3 guys except me...
(I made 3 Excel for each grid, and I had, until now, more than 30 grids)... :-)
I don't now how to crash the Ajax??? There is no Ajax, There are only a simple window.open... with the phpurl, return then false... No need for Ajax call, because you don't need a json with... Nothing... The server, send the correct header !!! And the client browser, in return, propose Excel for opening the downloaded stuff...
Whatever... If this don't work write me pm. Not spending too much space here...

aramaki
24 Jan 2011, 5:34 AM
thx for all, I`ve find the solution here
http://www.sencha.com/forum/showthread.php?80036-SOLVED-Download-data-from-variable-with-a-browser-prompt&p=385087#post385087