title: Send RDLC in an email using vb.net
body: <p>Okay my website generates thousands of PDFs using RDLCs but my problem is sometimes I want to email them but I don't want to attach a PDF to an email. So what I need is a way to generate the report then either convert it into text or html so I can send it as the body of an email. </p>
  
  <p>Also I am using reportviewr version 11</p>
  
  <p>Also I have tried exporting it as a .doc then trying to convert it to text and i have tried to export it to an excel document then tried to convert it and none of it works. </p>
  
  <pre><code>    Dim warn() As Warning = Nothing
      Dim streamids() As String = Nothing
      Dim mimeType As String = String.Empty
      Dim encoding As String = String.Empty
      Dim extension As String = String.Empty
      Dim bytes() As Byte
  
      bytes = rv.LocalReport.Render("MHTML", Nothing, mimeType, encoding, extension, streamids, warn)
  
      'Only one copy of the notice is needed
      'If Not Directory.Exists(strFilePath) Then Directory.CreateDirectory(strFilePath)
      Dim fs As New FileStream(strFilePath, FileMode.Create)
      fs.Write(bytes, 0, bytes.Length)
      fs.Close()
  </code></pre>
  
  <p>here is the code i'm using but it gives me an error : <code>Specified argument was out of the range of valid values. Parameter name: format</code> </p>
  
  <p>Also i know this code works because I use the exact same thing to export the rdlc to a PDF</p>