Click here to Skip to main content
16,017,986 members
Please Sign up or sign in to vote.
1.67/5 (3 votes)
See more:
Hi i am using export function to export the charts to pdf. it works fine and good.I have options to change the type of the chart at runtime using dropdownlist.when the chart type is changed and when i try to export it the default type while pageload is exported. i Want to export the changed chart type .Is there any solution for this.

i am using asp.net,c# with itextsharp.dll to export. At pageload the default chart type is pie. i change the type of the chart using dropdown list.

C#
 protected void ddlChType_SelectedIndexChanged(object sender, EventArgs e)
    {
if (IsPostBack)
       {
           if (ddlChType.SelectedIndex == 1)
           {
               saleChart.Series[0].ChartType = SeriesChartType.Pie;
           }
           //if (ddlChType.SelectedItem.Text.ToLower() == "pie")
           //{
           //    saleChart.Series[0].ChartType = SeriesChartType.Pie;
           //}
           else if (ddlChType.SelectedIndex ==5)
           {
               saleChart.Series[0].ChartType = SeriesChartType.Funnel;
           }
           else if (ddlChType.SelectedIndex ==3)
           {
               saleChart.Series[0].ChartType = SeriesChartType.Bar;
           }
           else if (ddlChType.SelectedIndex ==2)
           {
               saleChart.Series[0].ChartType = SeriesChartType.Column;
           }
           else if (ddlChType.SelectedIndex ==4)
           {
               saleChart.Series[0].ChartType = SeriesChartType.Line;
           }
           else
           {
               saleChart.Series[0].ChartType = SeriesChartType.Pie;
           }
       }
   }


when the type is changed and exported ,the default view is exported as pie.but i need to export the chart as changed type.
Posted
Updated 26-Oct-12 2:45am
v2
Comments
joshrduncan2012 23-Oct-12 9:19am    
Any attempts made on this so far? What language are you using? What IDE? What code have you produced so far? Any issues that you are running into that is preventing you from accomplishing this task? Please use Improve Question and supply this information so we can better assist you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900