|
-
Aug 11th, 2008, 10:19 AM
#1
Thread Starter
Addicted Member
-
Aug 11th, 2008, 03:10 PM
#2
Re: [2005] Save DGV to HTML
Where did you get the information telling you to save a DGV data to an HTML file and then to rename the file as XLS to make an excel file?
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Aug 11th, 2008, 03:50 PM
#3
Thread Starter
Addicted Member
-
Aug 12th, 2008, 10:38 AM
#4
Re: [2005] Save DGV to HTML
 Originally Posted by Alexandru_mbm
I tested it and it seems to work. However, there's no easy way to convert the data in a DGV to an html table... Using a streamwriter, you have to manually write the elements (table, tr, td...) yourself to a text file with fake xls extension.
What I did was to create an asp.net application with a test aspx page. On this page, I add an html table and fill up the cells with values, format the table and the cells as I like, then run the application. Once the web page displays, I view it source and save the file with an xls extension. It opens in Excel fine (except that all the excel grid lines you normally see now disappear). The data are in correct rows and columns.
I think you can do the same and use this test file as a sample (so that you know what needs to be written to your text file)
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Aug 12th, 2008, 04:24 PM
#5
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|