954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Form to Excel

Hello Guys,

I would like to know if its possible to have a form with four felds which when i press submit it stores the details to database and then excel or directly to excel, iv been searching around, and couldnt find much information, so would apericiate so help. Or if someone could give me a link to a tutorial.

Thank you

NoID
Light Poster
49 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

somebody on daniweb recently did a thing with php/excel with COM. I think you need to be running IIS, but I may be wrong. Search the last 4 days for posts on this.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

if only the data is important, the structure of the file constant,
mysql/php export the data as csv which excel can import and read as data
without fussing with .xls format
if the structure of the file is important, for calculated fields, a 'blank' .xls for download and then import the same comma separated values into it

If you need a lockdown .xls file try http://www.phpclasses.org/browse/package/3995.html

almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

Thank you guys for the help so far, i have been able to click on export and then "Microst Excel 2000" which has done what i want, but when i try to mail merge it just gives me an error, can someone please help, please note that i have found a tutorial but its not exactly what i want to thank you so far.

NoID
Light Poster
49 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

http://www.dreamincode.net/forums/showtopic10132.htm
This tutorial is easy to follow and will teach you how to write a tab delimited text file with a xls extension in php. It uses basic php text file functions such as fopen and fwrite.

buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
 

I think that you can use my little desktop_write routine to produce your excel file.

http://innovationsdesign.net/wb_2.7/pages/tech-resources/downloads.php

chrishea
Nearly a Posting Virtuoso
1,428 posts since Sep 2008
Reputation Points: 210
Solved Threads: 230
 

Are you wanting to do it via a website or inside excel itself?
I know that if you press some alt and function key or somethign, you can insert vb6 code inside excel. This also includes created forms. If done correctly you can load the form and it inserts the code inside the table.-- how its done, i couldnt' tell you

ctyokley
Light Poster
35 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

Hello Guys.

Thank you for replying back, what i need is 3 fields which are

Name
Age
Location

And when i fill this in, it stores the data to mysql database, which i know how to do,


But then i want to go to convertphptoexcel.php which then converts all the feilds and information to excel so i can download the file and open it so i can do mailmerge.

NoID
Light Poster
49 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

Hello Guys.

Thank you for replying back, what i need is 3 fields which are

Name Age Location

And when i fill this in, it stores the data to mysql database, which i know how to do,

But then i want to go to convertphptoexcel.php which then converts all the feilds and information to excel so i can download the file and open it so i can do mailmerge.

If its just for mail merge
output the query that gets the information as comma separated

/* select query for each selected row define file open file for writing*/ {
fput ($file,'/"'.$Name.'/",/"'.$Age'/",/"'.$Location'/"');
}
/* fclose rest of query set file for download*/


every mail merge can handle csv, an excel spreadsheet is unneccessary for the task,
like swatting a fly with an a-bomb

edit. do those "/" point the right way?

almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You