I have an HTML table on a webpage and can edit the contents manually. However, it would make my life much easier if I can copy the data from a file to the clipboard and just paste in onto the form. Can BHOs in IE do this? Any pointers will be helpful.
I have a superset of the data in a file and I don't want to type it all into the webpage.
If your file can be saved as a CSV (using Excel or some other program), then you can use a tool such as the one here (or write your own) to convert it to HTML.
Related
I'm trying to create data to paste into InDesign and I'm using the following code to copy my data to the clipboard:
Clipboard.generalClipboard.setData("dms", xml.toXMLString());
But when I paste it into InDesign, it shows the code rather than the formatted content. I don't know if the ClipboardFormat is correct and I don't know if my data is correct (it is the whole IDMS XML document). Does anyone have a working example or tell me what's wrong?
Here is what I get when I check the formats property of the Clipboard.generalClipboard.formats array. It also contains the format value:
air:file list:null
air:url:null
It is copying a file or file reference to the clipboard.
I am trying to export a spreadsheet file from a website. The data is a bit too complex for a simple csv, so I figured the best way to do it was to format it into a file containing nothing but an HTML table. If I give it a .xls extension, it will open, but only after throwing an error and asking for confirmation. Is there a way to set up the file so that Excel knows that it is supposed to have HTML code in it, and so that the OS knows that Excel is supposed to open it?
This is going to be used by people who aren't going think to open Excel and drag the file in or open it from inside Excel. They're going to be double-clicking on the file.
I want to create .csv files with the Report Generation Toolkit in Labview.
They must actually be .csv files which can be opened with Notepad or something similar.
Creating a .csv is not that hard, it's just a matter of adding the extension to the file name that's going to be created.
If I create a .csv file this way it opens nicely in excel just the way it should, but if I open it in Notepad it shows all kind of characters and it doesn't even come close to the data I wrote to the file.
I create the files with the Labview code below:
Link to image (can't post image yet because I've got to few points)
I know .csv files can be created with the Write to Spreadsheet VI but I would like to use the Report Generation Toolkit because it's pretty easy to add columns and rows to the file and that is something I really need.
you can use the Robust CSV package on the lavag.org forum to read and write 2D arrays to CSV files.
http://lavag.org/files/file/239-robust-csv/
Calling a file "csv" does not make it a CSV file. I never used the toolkit to generate an Excel file, but I'm assuming it creates an XLS or XLSX file, regardless of what extension you give it, which is why you're seeing gibberish (probably XLS, since it's been around for a while and I believe XLSX is XML, not binary).
I'm not sure what your problem is with the write spreadsheet VI. It has an append input, so I assume you can use that to at least add rows directly to a file, although I can't say I ever tried it. I would prefer handling all the data in memory explicitly, where you can easily use the array functions to add rows or columns to the array and then overwrite the entire file.
I've generated a table using play's #{list} tag and get pretty decent results. Now I need to be able to generate and download an xls version of the table and have no idea what to do. Any pointers at all will be much appreciated
Well you have various options.
Excel will open HTML files. So instead of rendering your table as HTML you can it to stream it to the browser and set the content type as XLS.
While Excel will open it this it will still be an HTML file rather than an XLS(X) document.
You can generate as CSV from your data model and stream this to the browser. Again this will be a CSV rather than a proper XLS(X) document.
There also seem to be some solutions around which can do it using Javscript. See as a starting point: Generate excel sheet from html tables using jquery
Finally you can can use something like Apache POI or JXLS to generate a 'proper' xls(x) document and stream this to the browser. I have some code here that will export HTML to 'proper' xlsx file if this is the route you wish to go. Workflow is then to create some HTML from your data model and use this to convert to Excel rather than having to programmatically build the Excel document using POI. https://github.com/alanhay/html-exporter
I have to convert an Access VBA app over to VB.NET and one of the text boxes (format set to RichText) on the VBA app accepts a straight paste from a Word document including its formatting and saves it to the Access database as HTML... The HTML is then read from the database and displayed as it was originally pasted when retrieved. The issue I have now is, I can use a web browser control to display the data properly from the database, but the RichTextBox gives an Invalid File Format error. When I wish to edit the data I switch the web browser control to the back and copy the data and paste it into the RichTextBox control and then bring the RichTextBox control to the front. This works fine, but once an update is attempted, the data gets saved in RTF format which is not HTML and then when I try to bring it up again from the database, the browser doesn't interpret it as it is not HTML. How can I save it from the RichTextBox, to HTML into the database like the VBA app can?
I've used this in C#:
Create a WebBrowser. Copy and paste the contents from your richtextbox to the webbrowser. And then read the html content (DocumentText) property from the webbrowser.
Edit:
Another way:
Use Office Interop, create a Word file, copy and paste into this file and then save as html.