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 :)
Related
I need to export data to an Excel template that contains VBA code and data validation in PHP.
I tried using PHPExcel library but it is removing the VBA code and data validations from the template.
I tried using PHPReport library, didn't get proper solution.
The template contains multiple worksheets and they are interdependent.
E.g.: Worksheet 1 contains employee data, then worksheet 2 contains salary with respect to employee name.
I have spent a great deal of time working on this problem, and the problem of memory consumption for large data sets. All of the PHP libs I have found keep all of the cells in memory, which is not viable for anything more than a small sheet.
What I ended up doing was writing a set of Java utilities using Apache POI and packaged them with PHP/Java Bridge so I can call them from PHP. This will allow you to create a new workbook based upon a template, keeping the macros intact. You can also use POI's streaming API, so you can handle massive data sets without crashing your server.
If you have Java chops, I highly recommend going this route, it's really the only way to do brain surgery on Excel files from PHP.
If you have any questions about how to do this or would like some example code, I'll be glad to help.
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 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 developed a VBA spreadsheet that runs locally and with obtain data from other sources continuously.
I want to find a way to extract / access the data inside this spreadsheet through php and then output some processed data using a browser and these data will update accordingly as the spreadsheet updates itself.
Anyone can show me how to achieve this? Both the spreadsheet and the php will run locally on a windows machine if that is easier...
Thanks very much for your help :)
I just developed an application that does this the idea is to use http requests on_change events in the spreadsheet.
vba code for request in excel
Function httpRequest(ByVal path As String) As String
Set HttpReq = CreateObject("MSXML2.ServerXMLHTTP")
HttpReq.Open "GET", path, False
HttpReq.Send
httpRequest = HttpReq.ResponseText
End Function
On your php side you have to develop the part where the data is mapped in the database. And of course the view of the data. As for realtime you have to go for something more elaborate like a table that holds the latest changes and check for such changes every now and then unless there is some mechanism to do so.
In excel there exist timers to acomplish polled checking for updates
for web you should to use ajax for seamless updates have a look at http://datatables.net/
You can use PHP Excel Reader to display the data quite easily from the spreadsheet - I think this is the simplest of the PHP Excel libraries that will do what you want and simply set the page to refresh on a regular basis.
Using this library is pretty much as simple as this:
<?php echo $data->dump(true,true); ?>
Once you have told it where the file is to display the output pretty much as would be expected to see in an Excel Workbook. (Here is a link to an example that they have up and running online)
This means you won't get any locking issues as the read is done rather quickly (assuming a reasonable file size and users won't really ever be more than a few minutes/seconds behind.
You want PHP to just generate HTML from Excel sheets? Excel supports HTML generation natively.
Try Save as Web Page to test the quality of HTML produced by Excel. If it's OK then all you'll have to do is write a small piece of VBA that will be generating HTML from your spreadsheets automatically.
Sort of CMS build in Excel.
Alright, see if I can pick your brains from you all.
I'm currently working on a project where all the information comes from different clients, the only thing in common is that the received data is done with excel. The excel spread sheet that they present is just a bunch of references and codes, and the problem than I'm facing is that I need the references and codes to be entered in certain format in order for the website to work.
The perfect situation will be to go to each client and teach how I would need the data, but I can't do that because of the large number of clients, and more importantly I will be interrupting their work flow. Each client has its own codes and reference model and they are not willing to change their process
The good news is that there is a standard pattern for the codes, but I'm talking close to 200 thousand codes with a bunch of combination.
They way that we are currently solving the problem is that we have a person who checks each excel sheet received, runs a few macros, and manually fixes those codes in which the macro was not able to fix.
The person that is doing this, is already burn out and frustrated and I would like to automatize this process with php.
Suggestions?
There's a nice class called PHPExcel that allows you to write and read from a variety of document types:
http://www.codeplex.com/PHPExcel
You need to enable the php_zip extension for Excel 2007 documents
you can use dbTube.org to solve your problem. You can configure the mapping
in graphical editor. The import definition can be saved and reused. It is
not neccessary to change the excel sheet.
Greetings Andreas