How to get live data from excel to a webpage? - html

I have an excel which gets live data from a thrid party. I want to display that live data from excel in a webpage. Can someone guide on how to do it?
Any inputs appreciate
Thank you

Your server will need to make a query of the same source. The following is one of dozens of ways to do this.
Set up a cron job to to the following:
1:Use curl to pull the data.
2:Use an awk program to reformat the data to a data file as a table with html table markup.
3:Concatenate a header file, your data file, and a trailer file to make a valid html file that you want.
4:Store that file on the web server.
If you want to do live updates rather than have the user reload the file you either have to push the data, or write JavaScript to reload the webpage element at intervals.
This is an excellent project. Learn this and you’ll have a big step up in your web building skills.

Related

HTML load CSV and make editable Table

is it possible to load a CSV-file to a table in HTML, make it editable and save it at the same time or with a button to the same same CSV file without installing additional software. Only with HTML?
I am looking for a solution with HTML because i want to load this on several screens and make it editable for more users (not atthe same time)
No for that you need some JavaScript to interact with browser file APIs or send the request to save data on backend.

Save html table data locally with electron

I'm new to coding and its a lot of try and error. Now I'm struggling with html tables.
For explanation: I am building an Electron Desktop application for stocks. I am able to input the value via GUI in an html table, and also export this as Excel file. But, every time I reload the app, all data from the table are gone. It would be great to save this data permanently, and simply add new data to the existing table after an application restart.
What's the best way to achieve this?
In my mind, it would the best way to overwrite the existing Excel file with the new work (old and new data from the table), because it would be easy to install the tool on a new PC and simply import the Excel file to have all data there. I don't have access to a web server, so I think a local Excel file would be better than a php solution.
Thank you.
<table class="table" id="tblData" >
<tr>
<th>Teilenummer</th>
<th>Hersteller</th>
<th>Beschreibung</th>
</tr>
</table>
This is the actual table markup.
Your question has two parts, it seems to me.
data representation and manipulation
data persistence
For #1, I'd suggest taking a look at Tabulator, in particular its methods of importing and exporting data. In my projects, I use the JSON format with Tabulator and save the data locally so it persists between sessions.
So for #2, how and where to save the data? Electron has built-in methods for getting the paths to common user directories. See app.getPath(name). Since it sounds like you have just one file to save, which does not need to be directly accessible to the user, appData is probably a good place to store it.
As for the "how" to store it – you can just write a file to that path using Node fs, though I like fs-jetpack too. Tabulator can save data as well.
Another way to store data is with electron-store. It works very well, though I've only used it with small amounts of data.
So the gist is that when your app starts, it loads the data and when the app quits, it saves the data, along with any changes which have been made, though I'd suggest saving after every change.
So, there are lots of options depending on your needs.

is it possible to save data from a html form to an excel file with web services?

I have made a newsletter with html and CSS, and in that newsletter I have 4 text boxes which takes the users name,family name,phone number,email address.Can I use a web service to transfer this data from the HTML form to an excel file, or a database on a host?
Is it possible at all? saving data from a html form to an excel file with web services?
If yes, how?
First of all, I assume you save this data into a database. That would be my approach at least.
So:
Send the data using a form to your server application (ASP.NET or something alike);
Save it in the database (or process it right away);
Then use a package like EPPlus to generate the Excel file in a web service. See their project page about the how to do that;
Return the result to the client.
yes thats possible but you would need a fifth button like send information that would post those fields to a php script on your server and then save it into your database
look here to see how to post information to your server
http://www.w3schools.com/php/php_forms.asp
and here for a small mysql tutorial
http://www.w3schools.com/php/php_mysql_intro.asp

Streaming CSV to browser

Busy building a website for a client using classic ASP (It will reside on an old server) which is going to be used internally only.
The admin is able to view a paginated table of data and export this to CSV. This works fine when I save the CSV data to a CSV file but I have now been asked to try avoid the creation of the file if possibly and create the CSV in memory without the need for a file.
I have my doubts that this is possible but might be completely wrong. Is there anyway to send the CSV data to the browser such that it will open in Excel rather than having to create a CSV file and link to it as I am currently doing ?
TIA
John
Response.ContentType = "text/csv" will help you here. In the past I've paired that with a rewrite rule so that the URL is something like foo.com/example.csv but there are plenty of other ideas to be found in the following question: Response Content type as CSV

How can I create PDF output from rrdcgi?

I have created a rrdcgi script to display information about the system performance with graphs. Now I would like to add an option for the users to create PDF on the fly with the details on current page (images and information) and header and footer. I also want the generated PDF files to be saved in some location so that that can be easily accessed next time. Is this possible to do with rrdcgi or any Perl code would be really appreciated.
I need this options
You need to consider what you want to put in the PDF: Do you want an exact replica of the web page the user is viewing (too hard to be close to impossible without having the user's browser installed on your side and using its print output) or do you want the same information in a roughly similar layout?
An important issue is how you are generating the HTML: I did something similar once to generate PDF receipts for experiment participants (now, I just output HTML with print styles).
The HTML is generated using HTML::Template although Template.pm would be just as fine.
It is then trivial to write another template, one that generates a LATEX document which can be processed using pdflatex. If you save the data the time the snapshot is requested, you can add the snapshot to a queue that generates documents asynchronously so that requests do not tie up the web server.
Update: Looking at rrdcgi, I now realize that it already does use a template. That is perfect: Instead of putting HTML in the template, put LATEX code in the template and run rrdcgi with the --filter option to create a LATEX source file which you can run through pdflatex. I guess the problem to solve there is to be able to use the exact same data that was used to generate the page the user is looking at.
If it is not possible to re-run rrdcgi with the exact same data, consider adding some JavaScript that submits the HTML source of the page the user is reviewing (or some JSON representation thereof) to a CGI script that parses the HTML and outputs LATEX. Writing clean HTML in the original template and judicious use of class and id attributes would help there.
I do not have time to test any of these ideas right now, but I will take a look again within the next couple of days.
Is it worth the effort?
Why don't you add a FAQ explaining how to setup a PDF-printer on Windows/MAC/Linux and provide a 'clean' page that can then be printed?
Since you apparently have to create the PDF,
take a look at this (what-is-the-best-perl-module-to-use-for-creating-a-pdf-from-scratch) post here on SO.
There is also this post, that could combine the 'clean' HTML page and a server-side print.
Regarding the LaTeX route, if you have rrdcgi generate graphs in pdf format, pdflatex will be able to integrate them directly into the document, producing super quality pdf with graphs ... very slick. Sorry, no code.