none
ssrs 2008- changing chart type dynamically

    Question

  • Hi,

    I have a requirement where i need to change the chart type at run time. I know this can be done by having overlapping charts and making there visibility either true or false depending on some parameter. I was looking form some other method to get this problem solved as this solution will increase a lot of rework in my case.

    Note: I am using SSRS 2008

    Can anyone help?


    • Edited by staycool Tuesday, February 19, 2013 6:57 PM
    Tuesday, February 19, 2013 6:56 PM

Answers

  • Hi Staycool,
    Yes, this can be done by using the parameter to set the visibility of the charts. I have tested it on local environment, everything works fine. The steps below are for your reference.

    1. Create a parameter “Type” and add the available values for it.
      Label          Value
      column        column
      line             line
      shape         shape
      bar             bar
    2. Create four charts.
    3. Use the expression below to set the visibility of column chart.
      =iif(instr(join(parameters!Type.Value,""),"column"),false,true)
    4. Use the expression below to set the visibility of line chart.
      =iif(instr(join(parameters!Type.Value,""),"line"),false,true)
    5. Use the expression below to set the visibility of shape chart.
      =iif(instr(join(parameters!Type.Value,""),"shape"),false,true)
    6. Use the expression below to set the visibility of bar chart.
      =iif(instr(join(parameters!Type.Value,""),"bar"),false,true)

    The report looks like below.

    If you have any questions, please feel free to ask.

    Regards,


    Charlie Liao
    TechNet Community Support

    Monday, February 25, 2013 10:11 AM
    Moderator

All replies

  • I am afraid you'll have to do this rework. No dynamic option is available in SSRS 2008 release.

    Thanks
    Salman
    http://muhammadsalmanx.wordpress.com

    Saturday, February 23, 2013 11:57 AM
  • Hi Staycool,
    Yes, this can be done by using the parameter to set the visibility of the charts. I have tested it on local environment, everything works fine. The steps below are for your reference.

    1. Create a parameter “Type” and add the available values for it.
      Label          Value
      column        column
      line             line
      shape         shape
      bar             bar
    2. Create four charts.
    3. Use the expression below to set the visibility of column chart.
      =iif(instr(join(parameters!Type.Value,""),"column"),false,true)
    4. Use the expression below to set the visibility of line chart.
      =iif(instr(join(parameters!Type.Value,""),"line"),false,true)
    5. Use the expression below to set the visibility of shape chart.
      =iif(instr(join(parameters!Type.Value,""),"shape"),false,true)
    6. Use the expression below to set the visibility of bar chart.
      =iif(instr(join(parameters!Type.Value,""),"bar"),false,true)

    The report looks like below.

    If you have any questions, please feel free to ask.

    Regards,


    Charlie Liao
    TechNet Community Support

    Monday, February 25, 2013 10:11 AM
    Moderator
  • Hi Charlie Leo/Salman

    Thanks for your replies. 

    But i have another question, if there is any other way to achieve this in new versions( SSRS 2008 R2 or SSRS 2012) ?


    • Edited by staycool Thursday, February 28, 2013 5:33 PM
    Thursday, February 28, 2013 5:27 PM
  • Hi Staycool,

    As far as I know, there is no other approch to work around this issue.

    Regards,


    Charlie Liao
    TechNet Community Support

    Friday, March 01, 2013 1:18 AM
    Moderator
  • Hi, from my point of view changing the chart type at run-time is a more useful feature to include in SSRS. PerformancePoint Services for SharePoint allow to create a chart with an editable type with a right-click. So I don't understand the reason because SSRS doesn't have a such feature.

    Creating more charts to hide/show by selecting a parameter is a rough workaround. In this way, it is necessary to forecast a fixed number of charts. Moreover, having many charts where only one is visible could make heavy the rendering process of the report.

    Bye

    Monday, September 16, 2013 5:17 PM
  • Hi i was done as like you said, but unfortunately i am getting an error could you pls help me out by explaining step by step procedure because i am unable to attach the print screen of error..... 

    the error msg is Overload resolution failed because no public 'Join' can be called with these arguments and source array cannot convert from 'String' to 'String()' ...... like this i am getting....

    Thanks in advance,


    Tuesday, October 29, 2013 7:03 AM
  • Warning    1    [rsRuntimeErrorInExpression] The Hyperlink expression for the textrun ‘Textbox12.Paragraphs[0].TextRuns[0]’ contains an error: Overload resolution failed because no Public 'Join' can be called with these arguments:      'Public Shared Function Join(SourceArray As String(), [Delimiter As String =  ]) As String':          Argument matching parameter 'SourceArray' cannot convert from 'String' to 'String()'.      'Public Shared Function Join(SourceArray As System.Object(), [Delimiter As String =  ]) As String':          Argument matching parameter 'SourceArray' cannot convert from 'String' to 'Object()'.    C:\Users\acacia\Documents\Visual Studio 2010\Projects\Vanamali\Vanamali\Testing.rdl    0    0    
    Tuesday, October 29, 2013 7:25 AM