ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2014-07-23 22:17:49

hgaspar
Member
Registered: 2014-06-05
Posts: 8

Export to HTML

Hi

i need to send the content of grid by email.
it works fine, but i must to save to disk then load from disk

is possible to get a string with html directly from grid?

      
Dim fsHTML As New System.IO.FileStream("c:\sample.html", System.IO.FileMode.Create, System.IO.FileAccess.Write)
Grd.ExportAsHTML(fsHTML)


Dim sReader As New System.IO.StreamReader("c:\sample.html")

'Read the entire text, and set it to a string
Dim strFileContents As String = sReader.ReadToEnd()

'send email
Dim eMail As New eMail
eMail.IsBodyHtml = True
eMail.SendMail("[email protected]", "", "", "subject:  html test", strFileContents, New List(Of eAttachment), False)

thanks

Offline

#2 2014-07-24 03:46:44

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Export to HTML

It can work with stream so output the html into memory stream, then convert it to string:

Dim ms As New System.IO.MemoryStream()
grid.ExportAsHTML(ms)

Dim htmlstr As String = System.Text.Encoding.Default.GetString(ms.GetBuffer)

'do something

Last edited by Jingwood (2014-07-24 05:22:59)

Offline

Board footer

Powered by FluxBB