Click here to Skip to main content
15,891,810 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionNeed Help Pin
kavitha_blueindia29-Nov-08 3:14
kavitha_blueindia29-Nov-08 3:14 
AnswerRe: Need Help Pin
AlexeiXX329-Nov-08 6:44
AlexeiXX329-Nov-08 6:44 
AnswerRe: Need Help Pin
Christian Graus29-Nov-08 13:42
protectorChristian Graus29-Nov-08 13:42 
GeneralRe: Need Help Pin
Muhammad Gouda30-Nov-08 3:32
Muhammad Gouda30-Nov-08 3:32 
GeneralRe: Need Help Pin
Christian Graus30-Nov-08 12:35
protectorChristian Graus30-Nov-08 12:35 
AnswerRe: Need Help Pin
Brij30-Nov-08 0:22
mentorBrij30-Nov-08 0:22 
AnswerRe: Need Help Pin
Vimalsoft(Pty) Ltd30-Nov-08 2:23
professionalVimalsoft(Pty) Ltd30-Nov-08 2:23 
QuestionError Pin
shanthi jothi29-Nov-08 2:53
shanthi jothi29-Nov-08 2:53 
Hi,
I have create chart in excel for grid data in asp.net 2.0.

my code is

Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet

xlWorkBook = New Excel.Application().Workbooks.Add(Missing.Value)
xlWorkBook.Application.Visible = True
xlWorkSheet = xlWorkBook.ActiveSheet

' Gets the dataset containing the data

'ds4 is gridview dataset
Dim dsData As DataSet = ds4
Dim i As Integer = 2

' Outputting the fieldnames in pink bold color
xlWorkSheet.Cells(1, 1) = "Student ID"
xlWorkSheet.Cells(1, 2) = "Student Name"
xlWorkSheet.Cells(1, 3) = "Maths"
xlWorkSheet.Cells(1, 4) = "science"
xlWorkSheet.Cells(1, 5) = "Total"

xlWorkSheet.Range("$A1:$E1").Font.ColorIndex = Excel.Constants.xlColor1
xlWorkSheet.Range("$A1:$E1").Font.Bold = True

' Outputting the data
For Each dr As DataRow In dsData.Tables(0).Rows
xlWorkSheet.Cells(i, 1) = dr(0)
xlWorkSheet.Cells(i, 2) = dr(1)
xlWorkSheet.Cells(i, 3) = dr(2)
xlWorkSheet.Cells(i, 4) = dr(3)

' Building the formula for calculating the sum
xlWorkSheet.Cells(i, 5).Formula = "=SUM($C{0}:$D{0})".Replace("{0}", i.ToString())

' Going to the next row
i = i + 1
Next

' Auto fit the columns
xlWorkSheet.Columns.AutoFit()

' Generating the graph
Dim chart As Excel.Chart
chart = xlWorkBook.Charts.Add()

With chart
.ChartType = Excel.XlChartType.xlColumnClustered
.SetSourceData(xlWorkSheet.Range("A1:E11"), 2)

.HasTitle = True
.ChartTitle.Characters.Text = "Students' marks"

.Axes(1, Excel.XlAxisGroup.xlPrimary).HasTitle = True
.Axes(1, Excel.XlAxisGroup.xlPrimary).AxisTitle.Characters.Text = "Students"
.Axes(2, Excel.XlAxisGroup.xlPrimary).HasTitle = True
.Axes(2, Excel.XlAxisGroup.xlPrimary).AxisTitle.Characters.Text = "Marks"
End With
'Catch ex As Exception
' Throw ex
'End Try

the error is [IndexOutOfRangeException: Cannot find table 0.]

Please help me
AnswerRe: Error Pin
AlexeiXX329-Nov-08 6:42
AlexeiXX329-Nov-08 6:42 
AnswerRe: Error Pin
Christian Graus29-Nov-08 13:44
protectorChristian Graus29-Nov-08 13:44 
GeneralRe: Error Pin
Nishant Singh29-Nov-08 21:00
Nishant Singh29-Nov-08 21:00 
QuestionWeb.config confusion Pin
sajjadlashari29-Nov-08 1:05
sajjadlashari29-Nov-08 1:05 
AnswerRe: Web.config confusion Pin
Guffa29-Nov-08 7:55
Guffa29-Nov-08 7:55 
Questionwebconfig error for web hosting server applications Pin
pavanip29-Nov-08 0:06
pavanip29-Nov-08 0:06 
AnswerRe: webconfig error for web hosting server applications Pin
Brij29-Nov-08 0:51
mentorBrij29-Nov-08 0:51 
GeneralRe: webconfig error for web hosting server applications Pin
pavanip29-Nov-08 0:56
pavanip29-Nov-08 0:56 
GeneralRe: webconfig error for web hosting server applications Pin
pavanip29-Nov-08 0:57
pavanip29-Nov-08 0:57 
AnswerRe: webconfig error for web hosting server applications Pin
Brij29-Nov-08 2:16
mentorBrij29-Nov-08 2:16 
GeneralRe: webconfig error for web hosting server applications Pin
pavanip29-Nov-08 3:51
pavanip29-Nov-08 3:51 
GeneralRe: webconfig error for web hosting server applications Pin
Brij30-Nov-08 0:16
mentorBrij30-Nov-08 0:16 
GeneralRe: webconfig error for web hosting server applications Pin
pavanip30-Nov-08 20:51
pavanip30-Nov-08 20:51 
QuestionExport to excel Pin
shanthi jothi28-Nov-08 23:46
shanthi jothi28-Nov-08 23:46 
AnswerRe: Export to excel Pin
Nishant Singh29-Nov-08 21:16
Nishant Singh29-Nov-08 21:16 
QuestionProblem Regarding TreeView Pin
ais0728-Nov-08 23:24
ais0728-Nov-08 23:24 
AnswerRe: Problem Regarding TreeView Pin
Brij28-Nov-08 23:47
mentorBrij28-Nov-08 23:47 

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.