export to excel error-rectify

Posted by Oswaldlily under ASP.NET on 10/12/2011 | Points: 10 | Views : 1149 | Status : [Member] | Replies : 1
<asp:gridview id="gv" runat="server">
<asp:TemplateField HeaderText="name"
<HeaderTemplate>
<asp:LinkButton ID="lnk" runat="server"
Width="200" Font-Underline="false"
ForeColor="AntiqueWhite" Text="Name"></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lbl1" runat="server" Text='<%# Eval("Employee_id") %>'
Style="word-break: break-all; word-wrap: break-word;" Width="200px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</asp:gridview>


page_load
{
name="hsh"
id="12"
chap="sadsda"
gv.datasource=_mapper.functionname(name,id,chap)
gv.databind()
}

/*now exporting to excel from gridview */

Dim xlApp As New Microsoft.Office.Interop.Excel.Application
linkbutton(ByVal sender As Object, ByVal e As EventArgs)
{
Dim i As Integer = 5
For r As Integer = 0 To gv.Rows.Count - 1
xlApp.ActiveSheet.cells(i, 3) = "" & gv.Rows(r).Cells(0).Text
i += 1
next
}

solution:Datas got binded to gridview in webpage
Error:Datas which binded in gridview not exporting to excel.displayin as blank..
my values not passing here why??




Responses

Posted by: Oswaldlily on: 10/12/2011 [Member] Starter | Points: 25

Up
0
Down
concluded and got output..thnks for all who visited..

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response