Answered Font

  • Thursday, April 12, 2012 7:00 AM
     
     
    Please suggest how to get desired font in the result set from the input Query given on existing Dataset

All Replies

  • Thursday, April 12, 2012 8:16 AM
     
     

    Hi Prasanth,

    Could you please explain in detail


    Alert

  • Thursday, April 12, 2012 8:36 AM
     
     

    Hi

    Here we are two scenarios

    1. If source query is TSQL

    • Use the row/column/report areas font expressions to change the font of the reports depends on the condition

    2. If source query is MDX

    • Use the CELL_PROPERTIES for dynamic properties or we can also use the SSRS expressions as above

    I think, it will help you


    Prav

  • Thursday, April 12, 2012 9:33 AM
     
     

    Hi Gauri and Prav,thanks for your kind response.

    I will explain the scenarion what i need exactly with an example.

    1.Think that One database with Name DB1 exists

    2.Table1 exists in that DB1 database.

    3.I had written one TSQL query to display 3 columns from Table1.

    4.Among the columns basically we have one of the column as Status with values O-Open,C-Closed,E-error.

    5.So depending on the values i need to change the font of the entire row in the generated report .Something like if status value is 'E' make the entire row red and bold,if the value is 'C' make the entire row as Italic and Blue,similar with other font for 'O' too.

    Thank you,

    Prasanth.


    Prasanth Reddy

  • Thursday, April 12, 2012 10:03 AM
     
     

    Hi Gauri and Prav,thanks for your kind response.

    I will explain the scenarion what i need exactly with an example.

    1.Think that One database with Name DB1 exists

    2.Table1 exists in that DB1 database.

    3.I had written one TSQL query to display 3 columns from Table1.

    4.Among the columns basically we have one of the column as Status with values O-Open,C-Closed,E-error.

    5.So depending on the values i need to change the font of the entire row in the generated report .Something like if status value is 'E' make the entire row red and bold,if the value is 'C' make the entire row as Italic and Blue,similar with other font for 'O' too.

    Thank you,

    Prasanth.


    Prasanth Reddy



    Prasanth Reddy

  • Thursday, April 12, 2012 11:03 AM
     
     

    Hi Parasanth,

    In order to do this you could use the switch function as an expression for the font colour of the row and then also on the font weight. For example:

    =Switch(Fields!Status.Value = "O", "GREEN", Fields!Status.Value = "C", "BLACK", Fields!Status.Value = "E", "RED")

    
    
    
    
    
  • Thursday, April 12, 2012 2:51 PM
     
     
    Hi , The result is appreciated but i need to change font of entire row of corresponding value not alone the value which satisfy the condition.

    Prasanth Reddy

  • Thursday, April 12, 2012 3:05 PM
     
     

    Hello Prasanth,

     Put the expression something like this:

    =IIf((Fields!orders.Value) = 20.00,"Red",(IIf(Fields!orders.Value =22.00,"Tomato",IIf((Fields!orders.Value) =25.00,"Green","Blue"))))

     Edit this expression as per your requirement:

    If you are working on SSRS 2008, the best option is Placeholder properties

    http://sqlserverpedia.com/blog/sql-server-bloggers/using-different-formats-within-a-single-textbox-in-ssrs/


    Please Mark as Answer if my post solved your problem or Vote As Helpful if this helps. Blogs: www.sqlserver2005forum.blogspot.com


  • Friday, April 13, 2012 4:40 AM
    Moderator
     
     Answered

    Hi avs_msdn

    You can use the expression avs_msdn provided to control detail row font dynamically:

    1.Click the tablix handle of the detail row to have the row selected

    2.In the Properties pane for the selected row,set the expression =Switch(Fields!Status.Value = "O", "GREEN", Fields!Status.Value = "C", "BLACK", Fields!Status.Value = "E", "RED") for BackgroundColor property

    Lola


    Please remember to mark the replies as answers if they help.

  • Thursday, April 19, 2012 12:48 PM
     
     Proposed Answer

    Hi Prasanth Reddy Bachu

    You just have to add the expression on each test box of the row as follows

    1. Select the first text box from detail section of your table or tablix

    2. go to property window and then expand the Font there you will find the

    And now in the expression text box you can write your condition as

    =iif( Fields!NominalHeight.Value="0","Arial","MS Scan Sarif")


    Alert

    • Proposed As Answer by GauriAShitre Thursday, April 19, 2012 12:48 PM
    •