Imports System
Imports System.Data
Imports System.Data.SqlClient


Partial Class Reports_PreRegister
    Inherits System.Web.UI.Page
    Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExport.Click

        ExportData()


    End Sub


	Public Overrides Sub VerifyRenderingInServerForm(ByVal control As System.Web.UI.Control)
		'MyBase.VerifyRenderingInServerForm(control)
	End Sub

    Public Sub ExportData()
        Response.Clear()
        Response.Charset = ""
        Response.AddHeader("content-disposition", "attachment;filename=PreRegisteredSignUp.xls")
        Response.ContentType = "application/vnd.ms-excel"
        Dim stringWrite As New System.IO.StringWriter()
        Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite)
        GridView1.AllowPaging = False
        GridView1.DataBind()
        GridView1.RenderControl(htmlWrite)
        stringWrite.GetStringBuilder.Insert(0, "Sign-Ups for Product Pre-Registration")
        Response.Write(stringWrite.ToString())
        Response.End()
    End Sub
	
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        If Not GridView1.AllowPaging Then
            GridView1.AllowPaging = True
            GridView1.DataBind()
        End If
    End Sub
End Class
