none
labels pointing to pie slices with lines (or how 2 set chart properties in code behind)

    Question

  • I want to be able to create lines outside of my pie chart with labels and have those lines drawn to connect to the pie chart.  I saw that this can be done in code behind in the following thread:

    MSDN thread on lines to pie slices

    But my problem is I never declared an instance of my chart when I am using my code behind.  My code that makes the reports visible is basically (but not completely) the following:

            ReportDataSet.Tables.Add(ReportDataTable)
            ReportViewer.Visible = True
            Dim ReportDataSource As ReportDataSource = New ReportDataSource("ReportDataSource", ReportDataSet.Tables(0))
            ReportViewer.LocalReport.ReportPath = ReportToDisplay.RDLCFileName
            ReportViewer.LocalReport.DataSources.Clear()
            ReportViewer.LocalReport.DataSources.Add(ReportDataSource)
            ReportDataSource.Name = ReportToDisplay.DataSetName
            ReportViewer.DataBind()
            ReportViewer.LocalReport.Refresh()
            ReportViewer.ShowReportBody = True
            ReportViewer.Width = RVWidth
            ReportViewer.Height = RVHeight

    So how do I set chart properties for my report given the above code?  As long as I can set my chart properties with the above code, I should be able to get this to work given the above thread and the link to the Label-Outside-of-Pie and Line-Color properties (or whatever) info on Microsoft's info page

    Thursday, May 01, 2014 9:04 PM

Answers

  • Hello,

    Based on your description, you want to design a pie chart with outside lables and pie line inside a .rdlc report. If so, you can add the Chart report item into the report after open a client report definition (.rdlc) file in graphical design mode. And then Set the PieLabelStyle property and PieLineColor property. Please refer to the following screen shot:

    The link your post above it about the Chart Web server control. As pre my undersntand, you cannot reference a Web server control inside .rdlc file.
    If you have any question about using Chart Web server control, you can post a question on Chart Controls for .NET Framework forum.

    Regards,
    Fanny Liu

    If you have any feedback on our support, please click here. 


    Fanny Liu
    TechNet Community Support

    • Marked as answer by jiwalkersm Friday, May 02, 2014 2:08 PM
    Friday, May 02, 2014 7:01 AM

All replies

  • Hello,

    Based on your description, you want to design a pie chart with outside lables and pie line inside a .rdlc report. If so, you can add the Chart report item into the report after open a client report definition (.rdlc) file in graphical design mode. And then Set the PieLabelStyle property and PieLineColor property. Please refer to the following screen shot:

    The link your post above it about the Chart Web server control. As pre my undersntand, you cannot reference a Web server control inside .rdlc file.
    If you have any question about using Chart Web server control, you can post a question on Chart Controls for .NET Framework forum.

    Regards,
    Fanny Liu

    If you have any feedback on our support, please click here. 


    Fanny Liu
    TechNet Community Support

    • Marked as answer by jiwalkersm Friday, May 02, 2014 2:08 PM
    Friday, May 02, 2014 7:01 AM
  • Thanks Fanny Liu, worked for me!

    Although, I am still curious as to how I would do this in code behind.

    • Edited by jiwalkersm Friday, May 02, 2014 2:10 PM
    Friday, May 02, 2014 2:09 PM