Ok we have this prefilled excel spreadsheet that we just update our name, mileage, and location on once a month. The spreadsheet calculates our millage with the built in formulas. What I would like to do is have this page on our website. I would pull from a sql database depending on the options you select prefill my labels on the web and save it to the correct spot on the excel spreadsheet once submitted. Sounds easy in theory but I'm not sure how to go about doing this or if it is even possible? Can someone help me out or get me started in the right direction. Thanks
Take a look at PHPExcel. It allows you to read and write Excel documents (and PDFs, and OpenOffice.org Calc documents and more).
Related
A few months ago, my supervisor needed me to create a form to collect some data - at the time, the most sensible thing to do was just to whip together a Google Form, no problem. Now it turns out that the data collection program needs to expand, and it makes more sense to direct the form to a MySQL database (using PHP) instead - again, no problem, already done. However, for reasons I won't elaborate on here, my supervisor still wants that data to go to the original Google Sheet as well.
My question - is it possible to submit form data to two separate sheets when one is a MySQL table and the other is a Google Sheet?
Thanks!
I know that feel bro ;)
There's some resources to handle boss requests:
PHPExcel Class is a library written in pure PHP and providing a set of classes that allow you to write to and read from different spreadsheet file formats, like Excel (BIFF) .xls, Excel 2007 (OfficeOpenXML) .xlsx, CSV, HTML...
You will need an script to process the outputs.
Excel / CSV > MySQL
MySQL > Excel / CSV
If you need directly to work with Google Docs, you will have to follow the previous steps and play with the following project:
php-google-spreadsheet-client is a library that provides a simple interface to the Google Spreadsheet API.
You will need to store data in MySQL and pass it to Google.
Second idea:
If your boss neet it NOW, you can give a chance to Zapier and do it fast. If you don't need a very fast sync time, it can be a good free option.
I hope it helps :)
Very sorry if this is not in the right place etc. I have been researching this for a while but its raised more questions!
I have developed a spreadsheet which I use to set a teams duties for a shift. There are 5 teams, each with staff which can change day to day.
the spreadsheet works fine, but its too complicated for some users. I am therefore trying to develop a straightforward web based form.
All the data is on the spreadsheet, held on a network drive (essentially locally).
I need to be able to have several combo/select boxes which get their values from a range of cells from the XLS. Along with the ability to output the final selections to a XLS sheet.
Finally, it needs to be able to load the previous day values on load.
What is the best way of developing a web page for this? Is Jscript the best option? Can I access a local file with jScript?
Thanks in advance
Adrian
The easiest option for you is to use google web forms. These allow creation of forms that will submit data to a google spreadsheet. Which is essentially an uploaded version of your local spreadsheet and can be downloaded to excel.
In case if you want more control and programming, pure javascript cant play with files, you need server side too. Javascript is not necessary unless you want to make your app do some visually fancy stuff. Since you mentioned php as a tag of this question, it seems you are a bit familiar with php. The task you have mentioned can be done using php programming as below:
Read excel file using an excel plugin
Parse relevant data using a text matching function, may require regular expressions knowledge.
display the form by building up the html and putting in the variables using the data obtained above.
Write a method to save the data submitted by the form to the same excel file using the excel plugin.
As its not convenient to play around with excel files. A better option would be to generate csv file or use a database using a database class . csv files can be parsed easily using text.
I have written some PHP that uses a simple HTML form to take in an ISBN number, uses that number to search Amazon's database, gets the book title and pricing information and then exports the information to notepad.
What I need to do now is change it so that a large number of ISBN's can be searched automatically. I was thinking I could do it either by having an excel sheet of ISBN's that I upload, or copy and pasting all of the ISBN's at once into a form.
I need some guidance on how to do this. I do not have a lot of PHP experience.
Thanks!
Here's a PHP library I use for my Excel needs: PHPExcel
It comes with good examples and documentation to get you started.
I am working on an online time card system to replace the paper time cards. What I have done is create a webpage in PHP that takes the time in and out along with job description and other values the user inputs and stores them in a MySQL database. Everything is working just fine.
What I would like to work on next is to take the information from the database for the specific user and week and have it fill in a PDF template file I have created from scanning the old paper time card and making it into a PDF form. I dont know if this is possible I have been researching it online and all I can come up with is how to generate a new PDF file. I am hoping someone here can point me to a source of information on how to do this.
Here is an example of exactly what I want to do http://try.fillpdf-service.com/
Hi congratulation for you about done the 1st step in time,
You can use very complete pdf generator php class TCPDF
It started in 2002, TCPDF is now one of the world's most active Open Source projects, used daily by millions of users and included in thousands of CMS and Web applications.
http://www.tcpdf.org/ for genarating your pdf what kind your want this class has very useful documnet and simple to use
Cheers,
Farzam
Take a look ath this
http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
It can be invoked as a command line tool and among the other functions let fill form fields, (on an already existing PDF you supply).
Maybe FPDF is quite old, but still good to handle for PDF generation. Just take a Template PDF (create as you like) and put the informations you want on it. You will have to place your data on the specific positions, see the tutorial section for a better understanding.
Another popular solution is to use Zend_PDF from well known Zend Framework, but I think FPDF would be a tick easier to work with if you are not very experienced.
i have been reading around looking for a way to get graphs and so on into my spread sheet i export out of my database and to make it look better for my employee who wants reports of everything in a certain way and so on. I have found PhpExcel.. which seems really good it can do everything i want it to plus more.. but i haven't been able to work out how to use data from my mysql table to fill in the cells since it seems like they all have to be manually set to a value...
i have read over this post How to set cell value Dynamically
i have attempted to use the code provided in this page to try and help me out but i havent been able to get it to work for some reason i am always receiving an error.
i am hoping someone may be able to help me out with trying to get this MySQL table data into a spreadsheet using php excel or even if there are any other links i may have missed i would really appreciate it...
If you install phpmyadmin to connect to your database.
Then you can write SQL queries for whatever reports you need.
And Export (see image 1) the results to CSV or CSV for MS Excel (see image 2).
Export option below the query results
Choose export data format
I have done this using the PEAR classes for PHP. You can read the data from the MYSQL database and then write the script using the PHP and PEAR classes to create an excel file for the same.
Here is link to the SpreadSheet Writer
This tutorial will help you to install PEAR and write the data to the excel sheet.
Hope this will solve the problem you are facing.
I'm doing a lot of work with PHPExcel... I wrote a little class to simplify exporting, you can download it here.
You just need to get your data from database into array, pass it to this class and specify the output format. I hope it helps.