|
-
Apr 1st, 2003, 11:22 AM
#1
Thread Starter
Addicted Member
teeChart: Catastrophic failure
i don't want to display the tChart.
all i need to do is create an image file using tChart.
when i run the application a get this error:
"System.Runtime.InteropServices.COMException: Catastrophic failure"
this web application is on a server and the tCharts are formated using the aspx.vb code behind pages.
Dim MyTable As New Data.DataTable("MyTable")
Dim ColValue As New Data.DataColumn("Value", Type.GetType("System.Int32"))
Dim ColDateTime As New Data.DataColumn("DateTime", Type.GetType("System.DateTime"))
MyTable.Columns.Add(ColValue)
MyTable.Columns.Add(ColDateTime)
Dim myChartRow As DataRow
Dim myChartAddRow As DataRow
For Each myChartRow In dstChartInfo.Tables("ChartInfo").Rows
myChartAddRow = MyTable.NewRow()
myChartAddRow("Value") = myChartRow("Value")
myChartAddRow("DateTime") = myChartRow("DateTime")
MyTable.Rows.Add(myChartAddRow)
Next
Dim FirstView As New Data.DataView(MyTable)
Dim tChart1 As New TChart()
tChart1.AddSeries(ESeriesClass.scLine)
With tChart1.Series(0)
.YValues.ValueSource = "Value"
.XValues.ValueSource = "DateTime"
.XValues.DateTime = True
.DataSource = FirstView
.CheckDataSource()
.VerticalAxis = EVerticalAxis.aLeftAxis
.Color = Convert.ToUInt32(System.Drawing.Color.Blue)
End With
With tChart1.Axis.Bottom
.Labels.DateTimeFormat = "dd/MM/yyyy HH:mm:ss"
.Labels.Multiline = True
.MinorTickLength = 2
.MinorTicks.Visible = True
.MinorTickCount = 4
.TickLength = 8
.Ticks.Visible = True
End With
With tChart1.Axis.Left
.GridPen.Color = Convert.ToUInt32(System.Drawing.Color.LightGray)
.GridCentered = True
.MinorTickLength = 2
.MinorTicks.Visible = True
.TickLength = 8
.Ticks.Visible = True
End With
With tChart1.Axis.Right
.GridPen.Color = Convert.ToUInt32(System.Drawing.Color.White)
.MinorTickLength = 2
.MinorTicks.Visible = True
.TickLength = 8
.Ticks.Visible = True
End With
With tChart1.Header
.Visible = False
End With
With tChart1
.Panel.Color = Convert.ToUInt32(System.Drawing.Color.White)
.Legend.Visible = False
.Aspect.View3D = False
.Panel.BevelOuter = EPanelBevel.bvNone
End With
'File.Delete(Server.MapPath((Session("username")) & ".jpeg"))
If IsItView = 1 Then
With tChart1.Export.asJPEG
.Height = 250
.Width = 570
End With
Else
With tChart1.Export.asJPEG
.Height = 448
.Width = 1012
End With
End If
With tChart1.Export
.asJPEG.CompressionQuality = 90
.asJPEG.GrayScale = False
.asJPEG.SaveToFile(Server.MapPath((Session("username")) & ".jpeg"))
End With
please help me.
thanks,
tom
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|