Click here to Skip to main content
15,886,085 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Setting value for datarow if its null Pin
kishorgh3-Jun-09 0:46
kishorgh3-Jun-09 0:46 
GeneralRe: Setting value for datarow if its null Pin
kishorgh3-Jun-09 0:59
kishorgh3-Jun-09 0:59 
QuestionRegarding deployment Pin
kumarjammula2-Jun-09 18:15
kumarjammula2-Jun-09 18:15 
AnswerRe: Regarding deployment Pin
Christian Graus2-Jun-09 18:28
protectorChristian Graus2-Jun-09 18:28 
AnswerRe: Regarding deployment Pin
Abhijit Jana2-Jun-09 18:38
professionalAbhijit Jana2-Jun-09 18:38 
QuestionExport data from datatable to Excel Pin
sarang_k2-Jun-09 17:52
sarang_k2-Jun-09 17:52 
AnswerRe: Export data from datatable to Excel Pin
Abhijit Jana2-Jun-09 18:41
professionalAbhijit Jana2-Jun-09 18:41 
AnswerRe: Export data from datatable to Excel Pin
Kapil Thakur2-Jun-09 22:01
Kapil Thakur2-Jun-09 22:01 
give a linkbutton "export to excel" and do the following code on its click event

Dim Grid As New System.Web.UI.WebControls.GridView
Try

      Grid.AutoGenerateColumns = True
      Grid.RowStyle.Wrap = True
      Grid.AlternatingRowStyle.Wrap = True

      Grid.DataSource = [YOUR DATASET]
      Grid.DataBind()

      -- header style required by you for excel
      Grid.HeaderRow.Cells(0).Width = 200
      Grid.HeaderRow.Style("font-family") = "Verdana"
      Grid.HeaderRow.Style("font-size") = "12px"
      Grid.HeaderRow.Font.Bold = True
      Grid.HeaderRow.ForeColor = Color.White
      Grid.HeaderRow.BackColor = Color.Blue

      For Each row As System.Web.UI.WebControls.GridViewRow In Grid.Rows
            -- row style required by you for excel
            row.Cells(0).Width = 100
            row.Style("font-family") = "Verdana"
            row.Style("font-size") = "12px"
            row.Style("text-align") = "left"
      Next

      Response.Clear()
      Response.AddHeader("content-disposition", "attachment;filename=" & [YOUR PREFERRED FILE NAME] & ".xls")
      Response.Charset = ""
      Response.Cache.SetCacheability(HttpCacheability.NoCache)
      Response.ContentType = "application/vnd.xls"

      Dim stringWrite As New System.IO.StringWriter()
      Dim htmlWrite As New HtmlTextWriter(stringWrite)

      Grid.RenderControl(htmlWrite)
      Response.Write(stringWrite.ToString())
      Response.End()

Catch ex As Exception
Finally
      Grid.Dispose()
      Grid = Nothing
End Try

Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com

Questionproblem Pin
battulga_dddddd2-Jun-09 17:43
battulga_dddddd2-Jun-09 17:43 
AnswerRe: problem Pin
Christian Graus2-Jun-09 18:12
protectorChristian Graus2-Jun-09 18:12 
GeneralRe: problem Pin
battulga_dddddd3-Jun-09 15:39
battulga_dddddd3-Jun-09 15:39 
QuestionCan I expand an ajax collapsiblepanel from a button in a different user control? Pin
Goalie352-Jun-09 16:17
Goalie352-Jun-09 16:17 
AnswerRe: Can I expand an ajax collapsiblepanel from a button in a different user control? Pin
Herman<T>.Instance2-Jun-09 22:05
Herman<T>.Instance2-Jun-09 22:05 
QuestionMenu Items on hover clickable area Pin
compninja252-Jun-09 11:01
compninja252-Jun-09 11:01 
AnswerRe: Menu Items on hover clickable area Pin
Goalie352-Jun-09 16:28
Goalie352-Jun-09 16:28 
GeneralRe: Menu Items on hover clickable area Pin
compninja253-Jun-09 3:24
compninja253-Jun-09 3:24 
Questionpublish web site Pin
hahii2-Jun-09 10:53
hahii2-Jun-09 10:53 
AnswerRe: publish web site Pin
Abhishek Sur2-Jun-09 10:59
professionalAbhishek Sur2-Jun-09 10:59 
GeneralRe: publish web site Pin
hahii2-Jun-09 11:10
hahii2-Jun-09 11:10 
GeneralRe: publish web site Pin
N a v a n e e t h2-Jun-09 15:31
N a v a n e e t h2-Jun-09 15:31 
GeneralRe: publish web site Pin
Abhijit Jana2-Jun-09 18:50
professionalAbhijit Jana2-Jun-09 18:50 
Questionweb.config values before install Pin
DCHAND2-Jun-09 8:36
DCHAND2-Jun-09 8:36 
AnswerRe: web.config values before install Pin
Manas Bhardwaj2-Jun-09 10:29
professionalManas Bhardwaj2-Jun-09 10:29 
GeneralRe: web.config values before install Pin
DCHAND2-Jun-09 10:33
DCHAND2-Jun-09 10:33 
QuestionASP.NET Documentation. Pin
Baeltazor2-Jun-09 2:44
Baeltazor2-Jun-09 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.