is there a way to create a chart for a website with asp.net? The workbook would be updated sometimes so it needs to update itself on a website. If yes, will I be able to add this file to my other HTML, css and JavaScript files?
If it is possible I would be grateful for providing a sample code.
Related
I have created an excel package using EPPlus, however instead of downloading as an excel file, I want to see the contents of that package in an asp.net page.
The easiest way might be to display as a PDF, in which case you'd need a converter. Someone else had that problem here.
Otherwise, since the fields aren't symmetric, you would have to create a custom aspx template deigned to pick up the fields and display them in the right areas, or maybe create a table grid and fill the empty excel cells with empty values in the generated table.
I need a function to convert any HTML table to a excel file!
I like to add a button to my page and once that button is clicked I pass a complete HTML table in to such a function that will generate an excel file and past the html table into the file with the same layout and design!
I appreciate any help with this request.
I am using c# and asp.net
This is a nasty trick, but it works in recent version of excel.
You just save the html table as a normal html file, then just rename it to xls. If your application is a web application use response.setHeader("Content-Disposition", "attachment; filename=order.xls").
Recent version of excel support Microsoft Office XML Formats, so if the previous solution doesn't work, you may want to try to generate the xml from the html table.
See XML Spreadsheet Reference.
What I do, is to generate the xml from excel in the xml format, then hack into it. You can implement also advanced features like automatic filters, and cool layouts. I used a template engine to generate the xml (Freemarker, it's Java stuff, but I'm sure there are template engines also for .NET)
I want to export a few Pages to pdf/xls. By Pages I mean as the eye sees it - a screenshot of the Page's contents. I know how to build pdf/xls documents using 3rd party tools but is there any way to quickly export the rendered contents of say a Panel?
edit: maybe a tool that can render the page's output as a browser would, and save it as an image file?
There is an open source console program named wkhtmltopdf which you could call from asp.net to convert the page. It can convert to PDF or an image with wkhtmltoimage (JPG, PNG, etc.) using the webkit rendering engine.
Check my answer to this question to see an example of how to convert from a html to a pdf using C#:
Easiest way of porting html table data to readable document
I can recommend http://www.screengrab.org/ for firefox.
I know that there a quite a few techniques to export grid view to excel. Below are a few:-
HTML Rendering to HTMLTextWriter and Sending the Response Content Type as Excel.
Using XML technique and generating the XML String as Excel Sheets.
Using Office Interop dlls to create an object for excel document and work on it accordingly.
Now the requirement is, I have multiple Grid Views on a aspx page and these Grid views are loaded from different data sources. I have Export button, which have to export each grid view to separate work-sheet of a single excel file.
This can be done using second and third techniques mentioned above. Want to know the possibility of using the first technique i.e. using HTMLTextWriter
You can do using Open XML
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5124
http://openxmldeveloper.org/
I am exporting an aspx page as an xls (excel) file.
I have everything working fine, but am wondering if there is a way to section some data from the aspx page into different excel worksheets?
Here's how I export data from an ASP.NET page to Excel:
http://www.blackbeltcoder.com/Articles/asp/creating-downloadable-content-dynamically
If you have something else in mind, you'll need to be more specific.