This is a migrated thread and some comments may be shown as answers.

reporting telerik multiple chart programmability

0 Answers 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
oscar andre
Top achievements
Rank 1
oscar andre asked on 26 Jan 2011, 08:21 PM
hi guys, i generated a report with a lot of charts inside, the problem is that i need only two chats per page
This is my code:

        txtArea = New Telerik.Reporting.TextBox
        txtMeta = New Telerik.Reporting.TextBox
        progchart = New Telerik.Reporting.Chart


        detail.Height = New Telerik.Reporting.Drawing.Unit(0.60019993782043457, Telerik.Reporting.Drawing.UnitType.Cm)
        detail.Items.AddRange(New Telerik.Reporting.ReportItemBase() {txtArea, txtMeta, progchart})
        detail.Name = "detail"
        detail.PageBreak = Telerik.Reporting.PageBreak.None

        'Area

        If op Then
            txtArea.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(0.3, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))), New Telerik.Reporting.Drawing.Unit(yPos - 1, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))))
            txtArea.Name = "txtGrupo" & row("AREA")
            txtArea.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(25.0, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))), New Telerik.Reporting.Drawing.Unit(0.5, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))))
            'textBox1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
            txtArea.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center
            txtArea.Style.Font.Bold = True
            txtArea.StyleName = "Data"
            txtArea.Value = row("AREA")
        End If

        'Meta

        txtMeta.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(0.3, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))), New Telerik.Reporting.Drawing.Unit(yPos - 0.5, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))))
        txtMeta.Name = "txtGrafico" & row("META") & " (" & row("Unidad") & ")"
        txtMeta.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(25.0, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))), New Telerik.Reporting.Drawing.Unit(0.5, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))))
        'textBox1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
        txtMeta.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center
        txtMeta.StyleName = "Data"
        txtMeta.Value = row("META") & " (" & row("Unidad") & ")"


        ' Grafico

        progchart.BitmapResolution = 96.0F
        progchart.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf
        progchart.Name = "progchart"
        progchart.PlotArea.EmptySeriesMessage.Visible = True

        progchart.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(0.3, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))), New Telerik.Reporting.Drawing.Unit(yPos, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))))
        progchart.PlotArea.EmptySeriesMessage.Appearance.Visible = True
        progchart.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(27.0, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))), New Telerik.Reporting.Drawing.Unit(6, (DirectCast((Telerik.Reporting.Drawing.UnitType.Cm), Telerik.Reporting.Drawing.UnitType))))
        progchart.SeriesPalette = "Web"
        progchart.ChartTitle.Visible = False
        progchart.PlotArea.DataTable.Visible = True
        progchart.PlotArea.XAxis.AutoScale = False

        Dim titulos As List(Of String) = New List(Of String)

        Dim Serie1 As New Telerik.Reporting.Charting.ChartSeries
        Serie1.Type = Charting.ChartSeriesType.Bar
        Serie1.Appearance.ShowLabels = False
        Serie1.Name = "Target"

        Dim Serie2 As New Telerik.Reporting.Charting.ChartSeries
        Serie2.Type = Charting.ChartSeriesType.Bar
        Serie2.Appearance.ShowLabels = False
        Serie2.Name = "Actual"


        Dim serieItem As Telerik.Reporting.Charting.ChartSeriesItem

        For i = 1 To 12

            serieItem = New Telerik.Reporting.Charting.ChartSeriesItem
            If IsDBNull(row("VAL_PRY" + RTrim(i))) = False Then
                serieItem.YValue = row("VAL_PRY" + RTrim(i))
            End If
            Serie1.AddItem(serieItem)

            serieItem = New Telerik.Reporting.Charting.ChartSeriesItem
            If IsDBNull(row("VAL_EJE" + RTrim(i))) = False Then
                serieItem.YValue = row("VAL_EJE" + RTrim(i))
            End If
            Serie2.AddItem(serieItem)

            titulos.Add(obtenMes(i))


        Next

        progchart.Series.Add(Serie1)
        progchart.Series.Add(Serie2)
    
        progchart.PlotArea.XAxis.AddRange(1, titulos.Count, 1)

        For i = 0 To titulos.Count - 1
            progchart.PlotArea.XAxis(i).TextBlock.Text = titulos(i)
        Next

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
oscar andre
Top achievements
Rank 1
Share this question
or