pasting an excel grid into an HTML form and pasting it back into an excel document - html

A friend of mine asked me about this 2 weeks ago and I am still trying to think about the best way to solve the problem.
Apparently the users ended up with a system where they get an excel file where they
have to manually fill up a column (I am expecting a lot of data).
the user would have to the grid into an html form
Have the pasted excel rows create rows in the DB
Is there is a clean way to handle this problem? Should he write any client side to format the pasted text or should he handle it on the front end? I also worry about any mistakes made by the user pasting the wrong number of cells.

If you can't get rid of the Excel step, you could write a program that reads that Excel file and store the values in the DB.
I did some Excel processing with Apache POI in Java.

Related

Tableau isn't converting my csv data source to tables

When I import a csv to Tableau, it gets the same format of the original csv file (a single column with every label on it). How can I make Tableau separate the columns based on commas?
I can't see why this is happening, since in every tutorial I checked Tableau already converts the .csv to a tabular format.
Here's what I get
Note: I'm using Tableau's trial version.
Sometimes when you open a csv in Excel it can mess with the formatting like your image shows. If you think you opened it in Excel before connecting, try downloading your source again and connecting first with Tableau. If that doesn't work, I happen to have this dataset in a .tde if you would like to use that. vgsales.tde
Edit: Thinking regional settings might be a factor.
Click the dropdown on the right of the data source. Select Text File Properties
To get this window:
Can you match these settings?

Top row blank in xlsx import into MS-Access

I have a collection of MS-Excel datasets in both .xlsx and .csv that get updated regularly.During an update, I save them to my C drive and convert the .csv files as .xlsx. Following this, I import them into MS-Access for processing.
However, I've a tedious issue, which I think is related to the previous file format before the conversion, but not entirely sure:
Every time I import the collection to MS-Access, some of the tables have an extra blank row added to the top of the table, which can interfere with some of the processes I run.
Now, it would appear that the files that were originally .xlsx are the ones that have this extra row, while the files that were originally .csv and then converted do not have this problem.
I can't give a reproducible example due to data sensitivity, but I'd like to ask if there is any general solution to this issue?
Help is greatly appreciated.
Thanks

R Writing Excel Document

My question is whether or not anybody knows of a better way to do what I'm already doing. I'm creating a report as a list, and trying to render it both in HTML and Excel.
I'm developing a shiny app that generates reports for Qualtrics surveys.
The results table is a list of HTML strings that I paste together and display in a shinydashboard. Here's a dput of the example results tables.
Here's how I'm creating the html results tables list -- the html_tabelize() function in my package. Here's a dput of the example input.
In the shiny server.R file the way I create the Excel file is with the following code:
output$downloadResults <- downloadHandler(
filename = 'tables.xls',
content = function(file) {
write(html_tabelize(main()[['blocks']]), file)
}
)
To summarize: I get the blocks, I run html_tabelize on them, and then I write the HTML output to a file called "tables.xls". When I open that file, because Excel can render HTML, it renders something like this:
My concern and problem with what I'm doing are two-fold:
If I were writing an Excel document instead of simply rendering HTML in Excel, then I could perhaps get a better formatted document. I'd like that.
When you download the results tables xls file and try to open it, you get a warning from Excel. I don't want the users of my app to see this warning, because it's distracting and could worry them about something that isn't really a concern.
I know that options exist for writing Excel files in R, but so far what I've seen indicates that their input must be either a data frame, or a list of data frames. The list I am rendering from has different types of components, like the question text, as well as data frames of results. Originally I was using pandoc, but pandoc, even when run from R, is a system binary, and it's difficult to list as a dependency (and if I can't list it as a dependency, it's tough to make sure it's installed for the users of my app). Additionally, I found out pandoc doesn't even convert to "real" Excel -- it also just saves HTML in a .xls file. Does anybody have any suggestions as to how I can improve this part of my app?

adding text to an xls file with bash script

I'm trying to understand if it's possible to write to an xls file with a bash script. Situation is outlined below.
I have a cronjob that runs every monday and generates an xls and emails to my client. This xls is filled with data from a MySQL DB. when the report is empty and the client attempts to open it, it shows as corrupt. Originally I addressed this issue by excluding empty files from the email with an if statement. However, the constraint is that all 4 reports much reach the client - empty or not.
So my question is, can I simply add a row of text at the top with a bash script so the file never "empty"? I'm not an expert in bash scripting by any means, so feedback here would be great. thanks!
Tony
I'm not aware of any pure bash implementation for writing XLS files. There are solutions in other languages such as Perl, Python, or PHP. If you think outside the box there is another option available to you. You mentioned that you currently use an if statement to not attach empty files. Create a blank spreadsheet in a program like MS Excel, optionally enter some text in A1 like "No records", save it, and transfer that to a known location on the server that runs the cronjob. Rather that skipping the attachment, whenever you detect an empty file in your if statement just attach the blank "No records" template XLS file. You may need to copy the template to a temporary location before attaching if you need to rename the file.

Convert excel spreadsheet into html using vb.net?

I would like to see some code/tutorials on reading an excel spreadsheet (a calender) into VB.NET. I'm pretty much okay from there. I want to convert it to an HTML table and output it into an html file for inclusion on a website.
Where can I find tutorials OR can someone post some code with a desciption to get me startd?
BONUS:
Is there a better way to include a xls file in a webpage?
There is an excel reader available on Codeproject here. The article covers the Excel file format layout, and the related material from Sun, in respect to how OpenOffice reads in the Excel spreadsheet.
AFAIK, there is no way to include an xls in a webpage unless you are talking about showing the actual data, it may be possible under IE only, to trigger the end user's Excel application, but IMHO that would be a dangerous assumption as that assumes the user has MS-Office installed.
Hope this helps,
Best regards,
Tom.