תשובה Display of Bar Chart along with String values

  • יום חמישי 21 יוני 2012 06:34
     
     

    Hi,

    Currently i have a table where in for each row i have a Bar chart along with percentage as shown in the image below.

    But along with the chart we need to display a string value ('AAAAAA','BBBBBBB','CCCC') to the right-hand-side of the percentage values just where the bar ends.

    I have tried several ways to accomplish this with various work arounds but in vain.

    I would appreciate if any one could help me out in resolving this issue.

    Thank You


    Venkat Chennai

כל התגובות

  • יום חמישי 21 יוני 2012 06:43
     
     

    Add a rectangle inside the cell. Then on the rectangle add a bar chart and a textbox.

    Check this image.

  • יום חמישי 21 יוני 2012 08:12
     
     

    Hi irusul,

    Actually i am exactly doing what you have suggested above .

    But the issue is the textbox value need to appear exactly to the right of the bar.

    If you see in the above image the starting position of values 'BBBBB' & 'CCCCC' depends on the value in the Data Bar (in the above case)

    it is 50.00% for BBBB and 75.00% for CCCC. So the starting position differs. And this is what is the expected behavior.

    With text box i have tried but it is not working . Because the text box position is fixed.

    Thanks for you prompt reply.


    Venkat Chennai

  • יום חמישי 21 יוני 2012 10:01
    מנחה דיון
     
      קוד כלול

    Hi there

    You could achieve this by using a kind of trickJ. Please show data label of your series and then put some expression which will show your series group as label.

    =iif(Fields!Fiscal_Year.Value=2012,Fields!BudgetCode.Value,nothing)

    I am putting screenshot for your help.

    for more details I have given full answer here

    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/bac6af52-608a-491e-a802-be2f8028916e/

    I hope this will help

    Many thanks

    Syed Qazafi Anjum

    if you have any query please let me know

    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.



  • יום חמישי 28 יוני 2012 04:05
    מנחה דיון
     
     תשובה

    Hi Venkat,

    From your description, I am afraid this requirement cannot be achieved in current release of Reporting Services. When we add a Data Bar control to the report, the length of the data bar control is fixed. Take your screenshot for example, for the data bar whose label is 75.00% in the third row, there is 25% white space on the right part of the data bar control. A textbox cannot occupy this space because it belongs to the data bar control.

    Beyond irusul’s suggestion above, you can specify the label instead of using the default label which is the value field. To do this, you can refer to the steps below:

    1. Click the data bar series.
    2. From the Series Properties pane, expand “CustomAttributes” and set “BarLabelStyle” to “Outside”.
    3. Expand the “Label” item and set the “Label” to the field that output the text you want to show.

    In this way, we can display the text as expected, but the original percent labels will disappear. Personally, I recommend that you go with irusul’s method.  

    Regards,
    Mike Yin

  • יום חמישי 28 יוני 2012 04:15
    מנחה דיון
     
     

    Hi Mike

    Thanks for your posting. What do you think if we show the label data and try to do the expression as I have suggested above would that not meet the requirement, I think it might please correct me if I am wrong. But I have done lot of time inside my environment to display string values like I have done in the example above. Please do reply

    If you have any questions please do ask.

    Many thanks

    Syed Qazafi Anjum

    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.

  • יום חמישי 28 יוני 2012 06:29
    מנחה דיון
     
     

    Hi Syed,

    Thanks for your posting.

    Actually, the second suggestion in my post above is similiar with what you suggested. But it seems not make sense for a Data Bar, since the orignal label (such as percent format numeric value) will disappear and there is no common value axis for visual inspection. This approach will work fine with a chart that has common value axis. So, I didn't recommend this method. Do you agree?

    I appreciate the time you have put into this issue.

    Thanks,
    Mike Yin

  • יום חמישי 28 יוני 2012 08:45
    מנחה דיון
     
     תשובה

    Hi Mike

    Thanks for your posting and I really appreciate your help. This is what I was trying to demonstrate. I am not sure whether I have understood the problem but please have a look on the screenshot

    I will look forward for your response

    Many thanks

    Syed Qazafi Anjum

  • יום חמישי 28 יוני 2012 09:43
    מנחה דיון
     
     תשובה קוד כלול

    Hi Syed,

    Thanks for your posting.

    You are providing a better workaround. Yes, we can add both the original percent value and the text value in the label. The one thing that is not perfect is that some of the labels may be outside the bar while the others are insde the bar. This cannot be avoided since the label is always included in the data bar control and the data bar control won't adjust it's size to maintain the label position setting.

    @Venkat, is Syed's suggestion above acceptable for you? If it is, you can set the label data expression like:

    =FormatPercent(Fields!SalesAmount.Value/sum(Fields!SalesAmount.Value,"Tablix1"),2) & Fields!SalesTerritoryGroup.Value

    Thanks,
    Mike Yin

  • יום חמישי 28 יוני 2012 09:48
    מנחה דיון
     
     

    Thanks Mike for your response, I really appreciate that.

    Best Regards

    Syed