Hello..
I have a charts created by code, i need to export that to Excel and Print,
#Region " _RI_ "
Private Function Generar_Item_RI( _
ByVal RepInt As Winsoftware.RepresentateInterno, _
ByVal Fecha As String, _
ByVal TipoFecha As Winsoftware.Histograma.TipoFecha _
) As Telerik.Reporting.Charting.ChartSeriesItem
Dim Porcentaje_SS As Decimal = 0
Dim Porcentaje_OT As Decimal = 0
Dim Porcentaje_Total As Decimal = 0
Dim sItem As Telerik.Reporting.Charting.ChartSeriesItem
sItem = New Telerik.Reporting.Charting.ChartSeriesItem
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Session("ListaDias")
'DATOS DE SOLICITUD DE SERVICIO
_DataTable = Winsoftware.Histograma.HgRiSerieObtener_SS(RepInt.RV, Fecha)
'Winsoftware.Histograma.Alternativa_ss(_DataTable, ListaDias)
If TipoFecha = Winsoftware.Histograma.TipoFecha.Anterior Then
ListaDias = Winsoftware.Histograma.valor_serie_dias_anteriores_ss(_DataTable, ListaDias)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Actual Then
ListaDias = Winsoftware.Histograma.valor_serie_dia_actual_ss(_DataTable, ListaDias)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Despues Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
ListaDias = Winsoftware.Histograma.valor_serie_dias_despues_ss(_DataTable, ListaDias)
End If
'DATOS DE ORDENES DE TRABAJO
_DataTable = Winsoftware.Histograma.HgRiSerieObtener_OT(RepInt.RV, Fecha)
If TipoFecha = Winsoftware.Histograma.TipoFecha.Anterior Then
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dias_anteriores_ot(_DataTable)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Actual Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dia_actual_ot(_DataTable)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Despues Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dias_despues_ot(_DataTable)
End If
For m As Integer = 0 To ListaDias.Count - 1
If Format(ListaDias(m).Fecha, "dd/MM/yyyy") = Fecha Then
Porcentaje_SS = ListaDias(m).Porcetaje
Porcentaje_Total = Porcentaje_SS + Porcentaje_OT
sItem.Label.TextBlock.Text = Format(Porcentaje_Total, "0.00").ToString & "%"
sItem.YValue = Porcentaje_Total
sItem.ActiveRegion.Url = "javascript:ShowPopUpDialog('DetalleRI.aspx?Fecha=" & Fecha & "&RespintID=" & RepInt.RV & "');" ' MOSTRAR DETALLE
If sItem.YValue > 100 Then
sItem.Appearance.FillStyle.MainColor = Color.Red
ElseIf (sItem.YValue >= 80) And (sItem.YValue <= 100) Then
sItem.Appearance.FillStyle.MainColor = Color.Yellow
End If
m = ListaDias.Count + 1
End If
Next
Return sItem
End Function
Private Function GenerarSeries_RI(ByVal RepInt As Winsoftware.RepresentateInterno, ByVal RadChart As Telerik.Reporting.Chart, ByVal FechaInicio As DateTime, ByVal FechaFin As DateTime) As Telerik.Reporting.Charting.ChartSeries
Dim chartSeries As New Telerik.Reporting.Charting.ChartSeries()
Dim Serie As New Winsoftware.Series
Dim Fecha As String
chartSeries.Name = "RESPONSABLE"
chartSeries.Type = Telerik.Reporting.Charting.ChartSeriesType.Bar
Dim Diff As Integer = DateDiff(DateInterval.Day, FechaInicio, FechaFin)
Dim sItem As Telerik.Reporting.Charting.ChartSeriesItem
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Session("ListaDias")
For i As Integer = 0 To ListaDias.Count - 1
Serie = ListaDias(i)
Fecha = Format(Serie.Fecha, "dd/MM/yyyy")
''RadChart.PlotArea.XAxis.AddItem(Format(Fecha, "yyyy/MM/dd"))
RadChart.PlotArea.XAxis.AddItem(Fecha)
sItem = Generar_Item_RI(RepInt, Fecha, Winsoftware.Histograma.Definit_tipo_Fecha(Serie.Fecha))
chartSeries.AddItem(sItem)
Next
Return chartSeries
End Function
Private Sub GenerarGafica_RI(ByVal RepInt As Winsoftware.RepresentateInterno, ByVal FechaInicio As DateTime, ByVal FechaFin As DateTime, Optional ByVal index As Integer = 0)
Dim radChart As New Telerik.Reporting.Chart
'Dim radChart As New RadChart
radChart.ChartTitle.TextBlock.Text = RepInt.NomRV
Dim ControlID As String = "RadChart_RI_" & index
radChart.PlotArea.YAxis.AutoScale = False
radChart.PlotArea.YAxis.AddRange(0, 200, 10)
'Color de fondo
'verda
Dim zone As New Telerik.Reporting.Charting.ChartMarkedZone
zone.ValueStartY = 99
zone.ValueEndY = 101
zone.Appearance.FillStyle.MainColor = Color.Black
radChart.PlotArea.MarkedZones.Add(zone)
'GERENA LOS RANGOS PARA EL EJE Y (LOS PORCENTAJES)
For j As Integer = 0 To 20
radChart.PlotArea.YAxis(j).TextBlock.Text = CStr((j * 10)) & "%"
Next
'FORMATO PARA EL EJE X
radChart.PlotArea.XAxis.Clear()
radChart.PlotArea.XAxis.AutoScale = False
radChart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300
radChart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.Black
' CREA LAS SERIES
Dim chartSeries As New Telerik.Reporting.Charting.ChartSeries()
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Winsoftware.Series.ListaDias(FechaInicio, FechaFin)
Session("ListaDias") = ListaDias
chartSeries = GenerarSeries_RI(RepInt, radChart, FechaInicio, FechaFin)
' LIMPIA LAS SERIES QUE HALLA EN LA GRÁFICA
radChart.Series.Clear()
' AGREGA LAS SERIES A LA GRÁFICA
radChart.Series.Add(chartSeries)
'radChart.Width = 1010
'radChart.Height = 600
'radChart.Skin = "Mac"
radChart.Name = ControlID
'radChart.Save("C:\tmp\20080604-ojmc.jpg")
'ReportViewer1.dat()
'ReportBookControl1.Reports.Add(radChart)
'Controls.Add(radChart)
'Me.Page.Controls.Add(radChart)
'Dim rep As Telerik.ReportViewer.WebForms.ReportInfo
'ReportBookControl1.Reports.Add(rep)
'ReportViewer1.DataBind()
End Sub
#End Region
I have a charts created by code, i need to export that to Excel and Print,
I opt for to have my Charts inside of a ReportViewer but i dunno how to make that!
Please Help!
This is my code:
#Region "_OFICIO_ "
Private Function Generar_Item_OF( _
ByVal Oficio As Winsoftware.Oficios, _
ByVal Fecha As DateTime, _
ByVal TipoFecha As Winsoftware.Histograma.TipoFecha _
) As Telerik.Reporting.Charting.ChartSeriesItem
Dim Porcentaje_SS As Decimal = 0
Dim Porcentaje_OT As Decimal = 0
Dim Porcentaje_Total As Decimal = 0
Dim pOF As Decimal = 0, pRI As Decimal = 0
Dim sItem As Telerik.Reporting.Charting.ChartSeriesItem
sItem = New Telerik.Reporting.Charting.ChartSeriesItem
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Session("ListaDias")
_DataTable = Winsoftware.Histograma.HgOfSerieObtener_SS(Oficio.IOF, Fecha)
''DATOS DE SOLICITUD DE SERVICIO
If TipoFecha = Winsoftware.Histograma.TipoFecha.Anterior Then
ListaDias = Winsoftware.Histograma.valor_serie_dias_anteriores_ss(_DataTable, ListaDias)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Actual Then
ListaDias = Winsoftware.Histograma.valor_serie_dia_actual_ss(_DataTable, ListaDias)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Despues Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
ListaDias = Winsoftware.Histograma.valor_serie_dias_despues_ss(_DataTable, ListaDias)
End If
''DATOS DE ORDENES DE TRABAJO
_DataTable = Winsoftware.Histograma.HgOfSerieObtener_OT(Oficio.IOF, Fecha)
If TipoFecha = Winsoftware.Histograma.TipoFecha.Anterior Then
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dias_anteriores_ot(_DataTable)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Actual Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dia_actual_ot(_DataTable)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Despues Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dias_despues_ot(_DataTable)
End If
For m As Integer = 0 To ListaDias.Count - 1
If Format(ListaDias(m).Fecha, "dd/MM/yyyy") = Format(Fecha, "dd/MM/yyyy") Then
Porcentaje_SS = ListaDias(m).Porcetaje
Porcentaje_Total = Porcentaje_SS + Porcentaje_OT
'sItem.Label.TextBlock.Text = Format(ListaDias(m).Porcetaje, "0.00").ToString & "%"
sItem.Label.TextBlock.Text = Format(Porcentaje_Total, "0.00").ToString & "%"
'sItem.YValue = ListaDias(m).Porcetaje
sItem.YValue = Porcentaje_Total
sItem.ActiveRegion.Url = "javascript:ShowPopUpDialog('DetalleOF.aspx?Fecha=" & Fecha & "&OficioID=" & Oficio.IOF & "');" ' MOSTRAR DETALLE
If sItem.YValue > 100 Then
sItem.Appearance.FillStyle.MainColor = Color.Red
ElseIf (sItem.YValue >= 80) And (sItem.YValue <= 100) Then
sItem.Appearance.FillStyle.MainColor = Color.Yellow
End If
End If
Next
Return sItem
End Function
Private Function GenerarSeries_OF(ByVal Oficio As Winsoftware.Oficios, ByVal RadChart As Telerik.Reporting.Chart, ByVal FechaInicio As DateTime, ByVal FechaFin As DateTime) As Telerik.Reporting.Charting.ChartSeries
Dim chartSeries As New Telerik.Reporting.Charting.ChartSeries()
chartSeries.Name = "OFICIO"
chartSeries.Type = Telerik.Reporting.Charting.ChartSeriesType.Bar
Dim Diff As Integer = DateDiff(DateInterval.Day, FechaInicio, FechaFin)
Dim Fecha As String = String.Empty
Dim sItem As Telerik.Reporting.Charting.ChartSeriesItem
Fecha = FechaInicio.ToShortDateString ' Fecha para serie
RadChart.PlotArea.XAxis.AddItem(Format(FechaInicio, "yyyy/MM/dd")) 'Crea la serie
sItem = Generar_Item_OF(Oficio, Fecha, Winsoftware.Histograma.Definit_tipo_Fecha(Fecha)) ' Valor para la serie
chartSeries.AddItem(sItem) ' Agrega la serie al grafico
For i As Integer = 1 To Diff
Fecha = DateAdd(DateInterval.Day, i, FechaInicio).ToShortDateString
RadChart.PlotArea.XAxis.AddItem(Format(DateAdd(DateInterval.Day, i, FechaInicio), "yyyy/MM/dd"))
sItem = Generar_Item_OF(Oficio, Fecha, Winsoftware.Histograma.Definit_tipo_Fecha(Fecha))
chartSeries.AddItem(sItem)
Next
Return chartSeries
End Function
Private Sub GenerarGafica_OF(ByVal Oficio As Winsoftware.Oficios, ByVal FechaInicio As DateTime, ByVal FechaFin As DateTime, Optional ByVal index As Integer = 0)
Dim radChart As New Telerik.Reporting.Chart()
radChart.ChartTitle.TextBlock.Text = Oficio.NomOF
Dim ControlID As String = "RadChart_OF_" & index
radChart.Name = ControlID
radChart.PlotArea.YAxis.AutoScale = False
radChart.PlotArea.YAxis.AddRange(0, 200, 10)
'Color de fondo
'verda
Dim zone As New Telerik.Reporting.Charting.ChartMarkedZone
zone.ValueStartY = 99
zone.ValueEndY = 101
zone.Appearance.FillStyle.MainColor = Color.Black
radChart.PlotArea.MarkedZones.Add(zone)
'GERENA LOS RANGOS PARA EL EJE Y (LOS PORCENTAJES)
For j As Integer = 0 To 20
radChart.PlotArea.YAxis(j).TextBlock.Text = CStr((j * 10)) & "%"
Next
'FORMATO PARA EL EJE X
radChart.PlotArea.XAxis.Clear()
radChart.PlotArea.XAxis.AutoScale = False
radChart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300
radChart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.Black
' CREA LAS SERIES
Dim chartSeries As New Telerik.Reporting.Charting.ChartSeries()
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Winsoftware.Series.ListaDias(FechaInicio, FechaFin)
Session("ListaDias") = ListaDias
chartSeries = GenerarSeries_OF(Oficio, radChart, FechaInicio, FechaFin)
' LIMPIA LAS SERIES QUE HALLA EN LA GRÁFICA
radChart.Series.Clear()
' AGREGA LAS SERIES A LA GRÁFICA
radChart.Series.Add(chartSeries)
'radChart.Width = 1010
'radChart.Height = 600
'radChart.Skin = "Mac"
'' add the RadChart to the page.
'Me.Page.Controls.Add(radChart)
End Sub
#End Region
Please Help!
This is my code:
#Region "_OFICIO_ "
Private Function Generar_Item_OF( _
ByVal Oficio As Winsoftware.Oficios, _
ByVal Fecha As DateTime, _
ByVal TipoFecha As Winsoftware.Histograma.TipoFecha _
) As Telerik.Reporting.Charting.ChartSeriesItem
Dim Porcentaje_SS As Decimal = 0
Dim Porcentaje_OT As Decimal = 0
Dim Porcentaje_Total As Decimal = 0
Dim pOF As Decimal = 0, pRI As Decimal = 0
Dim sItem As Telerik.Reporting.Charting.ChartSeriesItem
sItem = New Telerik.Reporting.Charting.ChartSeriesItem
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Session("ListaDias")
_DataTable = Winsoftware.Histograma.HgOfSerieObtener_SS(Oficio.IOF, Fecha)
''DATOS DE SOLICITUD DE SERVICIO
If TipoFecha = Winsoftware.Histograma.TipoFecha.Anterior Then
ListaDias = Winsoftware.Histograma.valor_serie_dias_anteriores_ss(_DataTable, ListaDias)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Actual Then
ListaDias = Winsoftware.Histograma.valor_serie_dia_actual_ss(_DataTable, ListaDias)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Despues Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
ListaDias = Winsoftware.Histograma.valor_serie_dias_despues_ss(_DataTable, ListaDias)
End If
''DATOS DE ORDENES DE TRABAJO
_DataTable = Winsoftware.Histograma.HgOfSerieObtener_OT(Oficio.IOF, Fecha)
If TipoFecha = Winsoftware.Histograma.TipoFecha.Anterior Then
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dias_anteriores_ot(_DataTable)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Actual Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dia_actual_ot(_DataTable)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Despues Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dias_despues_ot(_DataTable)
End If
For m As Integer = 0 To ListaDias.Count - 1
If Format(ListaDias(m).Fecha, "dd/MM/yyyy") = Format(Fecha, "dd/MM/yyyy") Then
Porcentaje_SS = ListaDias(m).Porcetaje
Porcentaje_Total = Porcentaje_SS + Porcentaje_OT
'sItem.Label.TextBlock.Text = Format(ListaDias(m).Porcetaje, "0.00").ToString & "%"
sItem.Label.TextBlock.Text = Format(Porcentaje_Total, "0.00").ToString & "%"
'sItem.YValue = ListaDias(m).Porcetaje
sItem.YValue = Porcentaje_Total
sItem.ActiveRegion.Url = "javascript:ShowPopUpDialog('DetalleOF.aspx?Fecha=" & Fecha & "&OficioID=" & Oficio.IOF & "');" ' MOSTRAR DETALLE
If sItem.YValue > 100 Then
sItem.Appearance.FillStyle.MainColor = Color.Red
ElseIf (sItem.YValue >= 80) And (sItem.YValue <= 100) Then
sItem.Appearance.FillStyle.MainColor = Color.Yellow
End If
End If
Next
Return sItem
End Function
Private Function GenerarSeries_OF(ByVal Oficio As Winsoftware.Oficios, ByVal RadChart As Telerik.Reporting.Chart, ByVal FechaInicio As DateTime, ByVal FechaFin As DateTime) As Telerik.Reporting.Charting.ChartSeries
Dim chartSeries As New Telerik.Reporting.Charting.ChartSeries()
chartSeries.Name = "OFICIO"
chartSeries.Type = Telerik.Reporting.Charting.ChartSeriesType.Bar
Dim Diff As Integer = DateDiff(DateInterval.Day, FechaInicio, FechaFin)
Dim Fecha As String = String.Empty
Dim sItem As Telerik.Reporting.Charting.ChartSeriesItem
Fecha = FechaInicio.ToShortDateString ' Fecha para serie
RadChart.PlotArea.XAxis.AddItem(Format(FechaInicio, "yyyy/MM/dd")) 'Crea la serie
sItem = Generar_Item_OF(Oficio, Fecha, Winsoftware.Histograma.Definit_tipo_Fecha(Fecha)) ' Valor para la serie
chartSeries.AddItem(sItem) ' Agrega la serie al grafico
For i As Integer = 1 To Diff
Fecha = DateAdd(DateInterval.Day, i, FechaInicio).ToShortDateString
RadChart.PlotArea.XAxis.AddItem(Format(DateAdd(DateInterval.Day, i, FechaInicio), "yyyy/MM/dd"))
sItem = Generar_Item_OF(Oficio, Fecha, Winsoftware.Histograma.Definit_tipo_Fecha(Fecha))
chartSeries.AddItem(sItem)
Next
Return chartSeries
End Function
Private Sub GenerarGafica_OF(ByVal Oficio As Winsoftware.Oficios, ByVal FechaInicio As DateTime, ByVal FechaFin As DateTime, Optional ByVal index As Integer = 0)
Dim radChart As New Telerik.Reporting.Chart()
radChart.ChartTitle.TextBlock.Text = Oficio.NomOF
Dim ControlID As String = "RadChart_OF_" & index
radChart.Name = ControlID
radChart.PlotArea.YAxis.AutoScale = False
radChart.PlotArea.YAxis.AddRange(0, 200, 10)
'Color de fondo
'verda
Dim zone As New Telerik.Reporting.Charting.ChartMarkedZone
zone.ValueStartY = 99
zone.ValueEndY = 101
zone.Appearance.FillStyle.MainColor = Color.Black
radChart.PlotArea.MarkedZones.Add(zone)
'GERENA LOS RANGOS PARA EL EJE Y (LOS PORCENTAJES)
For j As Integer = 0 To 20
radChart.PlotArea.YAxis(j).TextBlock.Text = CStr((j * 10)) & "%"
Next
'FORMATO PARA EL EJE X
radChart.PlotArea.XAxis.Clear()
radChart.PlotArea.XAxis.AutoScale = False
radChart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300
radChart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.Black
' CREA LAS SERIES
Dim chartSeries As New Telerik.Reporting.Charting.ChartSeries()
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Winsoftware.Series.ListaDias(FechaInicio, FechaFin)
Session("ListaDias") = ListaDias
chartSeries = GenerarSeries_OF(Oficio, radChart, FechaInicio, FechaFin)
' LIMPIA LAS SERIES QUE HALLA EN LA GRÁFICA
radChart.Series.Clear()
' AGREGA LAS SERIES A LA GRÁFICA
radChart.Series.Add(chartSeries)
'radChart.Width = 1010
'radChart.Height = 600
'radChart.Skin = "Mac"
'' add the RadChart to the page.
'Me.Page.Controls.Add(radChart)
End Sub
#End Region
#Region " _RI_ "
Private Function Generar_Item_RI( _
ByVal RepInt As Winsoftware.RepresentateInterno, _
ByVal Fecha As String, _
ByVal TipoFecha As Winsoftware.Histograma.TipoFecha _
) As Telerik.Reporting.Charting.ChartSeriesItem
Dim Porcentaje_SS As Decimal = 0
Dim Porcentaje_OT As Decimal = 0
Dim Porcentaje_Total As Decimal = 0
Dim sItem As Telerik.Reporting.Charting.ChartSeriesItem
sItem = New Telerik.Reporting.Charting.ChartSeriesItem
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Session("ListaDias")
'DATOS DE SOLICITUD DE SERVICIO
_DataTable = Winsoftware.Histograma.HgRiSerieObtener_SS(RepInt.RV, Fecha)
'Winsoftware.Histograma.Alternativa_ss(_DataTable, ListaDias)
If TipoFecha = Winsoftware.Histograma.TipoFecha.Anterior Then
ListaDias = Winsoftware.Histograma.valor_serie_dias_anteriores_ss(_DataTable, ListaDias)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Actual Then
ListaDias = Winsoftware.Histograma.valor_serie_dia_actual_ss(_DataTable, ListaDias)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Despues Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
ListaDias = Winsoftware.Histograma.valor_serie_dias_despues_ss(_DataTable, ListaDias)
End If
'DATOS DE ORDENES DE TRABAJO
_DataTable = Winsoftware.Histograma.HgRiSerieObtener_OT(RepInt.RV, Fecha)
If TipoFecha = Winsoftware.Histograma.TipoFecha.Anterior Then
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dias_anteriores_ot(_DataTable)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Actual Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dia_actual_ot(_DataTable)
ElseIf TipoFecha = Winsoftware.Histograma.TipoFecha.Despues Then
sItem.Appearance.FillStyle.MainColor = Color.DarkBlue
Porcentaje_OT = Winsoftware.Histograma.valor_serie_dias_despues_ot(_DataTable)
End If
For m As Integer = 0 To ListaDias.Count - 1
If Format(ListaDias(m).Fecha, "dd/MM/yyyy") = Fecha Then
Porcentaje_SS = ListaDias(m).Porcetaje
Porcentaje_Total = Porcentaje_SS + Porcentaje_OT
sItem.Label.TextBlock.Text = Format(Porcentaje_Total, "0.00").ToString & "%"
sItem.YValue = Porcentaje_Total
sItem.ActiveRegion.Url = "javascript:ShowPopUpDialog('DetalleRI.aspx?Fecha=" & Fecha & "&RespintID=" & RepInt.RV & "');" ' MOSTRAR DETALLE
If sItem.YValue > 100 Then
sItem.Appearance.FillStyle.MainColor = Color.Red
ElseIf (sItem.YValue >= 80) And (sItem.YValue <= 100) Then
sItem.Appearance.FillStyle.MainColor = Color.Yellow
End If
m = ListaDias.Count + 1
End If
Next
Return sItem
End Function
Private Function GenerarSeries_RI(ByVal RepInt As Winsoftware.RepresentateInterno, ByVal RadChart As Telerik.Reporting.Chart, ByVal FechaInicio As DateTime, ByVal FechaFin As DateTime) As Telerik.Reporting.Charting.ChartSeries
Dim chartSeries As New Telerik.Reporting.Charting.ChartSeries()
Dim Serie As New Winsoftware.Series
Dim Fecha As String
chartSeries.Name = "RESPONSABLE"
chartSeries.Type = Telerik.Reporting.Charting.ChartSeriesType.Bar
Dim Diff As Integer = DateDiff(DateInterval.Day, FechaInicio, FechaFin)
Dim sItem As Telerik.Reporting.Charting.ChartSeriesItem
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Session("ListaDias")
For i As Integer = 0 To ListaDias.Count - 1
Serie = ListaDias(i)
Fecha = Format(Serie.Fecha, "dd/MM/yyyy")
''RadChart.PlotArea.XAxis.AddItem(Format(Fecha, "yyyy/MM/dd"))
RadChart.PlotArea.XAxis.AddItem(Fecha)
sItem = Generar_Item_RI(RepInt, Fecha, Winsoftware.Histograma.Definit_tipo_Fecha(Serie.Fecha))
chartSeries.AddItem(sItem)
Next
Return chartSeries
End Function
Private Sub GenerarGafica_RI(ByVal RepInt As Winsoftware.RepresentateInterno, ByVal FechaInicio As DateTime, ByVal FechaFin As DateTime, Optional ByVal index As Integer = 0)
Dim radChart As New Telerik.Reporting.Chart
'Dim radChart As New RadChart
radChart.ChartTitle.TextBlock.Text = RepInt.NomRV
Dim ControlID As String = "RadChart_RI_" & index
radChart.PlotArea.YAxis.AutoScale = False
radChart.PlotArea.YAxis.AddRange(0, 200, 10)
'Color de fondo
'verda
Dim zone As New Telerik.Reporting.Charting.ChartMarkedZone
zone.ValueStartY = 99
zone.ValueEndY = 101
zone.Appearance.FillStyle.MainColor = Color.Black
radChart.PlotArea.MarkedZones.Add(zone)
'GERENA LOS RANGOS PARA EL EJE Y (LOS PORCENTAJES)
For j As Integer = 0 To 20
radChart.PlotArea.YAxis(j).TextBlock.Text = CStr((j * 10)) & "%"
Next
'FORMATO PARA EL EJE X
radChart.PlotArea.XAxis.Clear()
radChart.PlotArea.XAxis.AutoScale = False
radChart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300
radChart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.Black
' CREA LAS SERIES
Dim chartSeries As New Telerik.Reporting.Charting.ChartSeries()
Dim ListaDias As List(Of Winsoftware.Series)
ListaDias = Winsoftware.Series.ListaDias(FechaInicio, FechaFin)
Session("ListaDias") = ListaDias
chartSeries = GenerarSeries_RI(RepInt, radChart, FechaInicio, FechaFin)
' LIMPIA LAS SERIES QUE HALLA EN LA GRÁFICA
radChart.Series.Clear()
' AGREGA LAS SERIES A LA GRÁFICA
radChart.Series.Add(chartSeries)
'radChart.Width = 1010
'radChart.Height = 600
'radChart.Skin = "Mac"
radChart.Name = ControlID
'radChart.Save("C:\tmp\20080604-ojmc.jpg")
'ReportViewer1.dat()
'ReportBookControl1.Reports.Add(radChart)
'Controls.Add(radChart)
'Me.Page.Controls.Add(radChart)
'Dim rep As Telerik.ReportViewer.WebForms.ReportInfo
'ReportBookControl1.Reports.Add(rep)
'ReportViewer1.DataBind()
End Sub
#End Region