Respondida Can I change the Table header on the run tine in SSRS

  • martes, 07 de agosto de 2012 11:38
     
     

    Hi All,

    I have created a table in SSRS which fetch the data from a table and the header of this column are getting changed every week.

    So I have created a table with fix column (W1, W2, W3...W8. ) and fetch the data in SSRS perfectly.  But I have to change the column header with real value.

    Here is the sample table.

Todas las respuestas

  • martes, 07 de agosto de 2012 13:50
     
     Respuesta propuesta

    Instead of using a tablix, use a matrix. In the matrix control, the rows and footers are from the dataset and are dynamic.

    Check this for more:

    Adding a Matrix (Reporting Services)

  • jueves, 09 de agosto de 2012 13:01
     
     

    Instead of using a tablix, use a matrix. In the matrix control, the rows and footers are from the dataset and are dynamic.

    Check this for more:

    Adding a Matrix (Reporting Services)

    Thanks Irusul.

    I have tried it but didn't succeed. When I tried this only column is fetch the record in SSRS. Remaining col left blank.

    I have attached the matrix graph for reff.

    2SQL side - I'm creating a physical table on run time with User, manager, Type and W1 to W8 cols. And Inserted data to this table from some views using the sql pivit. and with cursor I'm Altering the table header base on some recordset. All above senario are written in a dataset.

    The table header will change every run. So How would I acheive this? Pls help...

  • jueves, 09 de agosto de 2012 14:19
     
     

    I see you columns are still static.

    What you should use is something like:

    I don't know how your dataset is, but you should add the Period column to the Matrix Columns. In my case for columns I have the name column from dataset, whcih can have several possible values: Jan, Feb, March, ... I don't write them explicitly.

    In you example you are doing it wrong since you write the average for each Period (W1, W2, ...). You basically need to add the Period Name (ex: W_Name) on the Matrix Columns. The Average will be the intersection of values from Rows and Columns, by adding [Avg(W1)]

     
  • jueves, 09 de agosto de 2012 14:36
     
     Respondida

    Hi ,

    First change your dataset to take column names in rows i.e.Take what ever column names you want in a column.Then it will simple for your to populate in the Matrix report.Like below image :This will make the column name dynamic.

    I had put the first name in the column field.Now see the below output :

    hope this will solve your problem. :)

    Regards

    Samay


    samay


  • jueves, 09 de agosto de 2012 14:40
     
     

    Output of my dataset look like :

    Bold character header will get changed in every run. So pls help me how could I do?

    User Manger PeriodType 7th July 15-Jul 21-Jul 29-Jul 5-Aug
    ABC Z Weekly 15% 31% 15% 31% 15%
    BCD Z Weekly 20% 21% 20% 21% 51%
    XYZ N Weekly 22% 42% 22% 42% 24%
    Gfx N Weekly 24% 15% 24% 15% 34%
  • jueves, 09 de agosto de 2012 15:05
     
     

    Attached images are displayed :)

  • viernes, 10 de agosto de 2012 6:34
     
     
    Thanks. Now I got it.
  • lunes, 13 de agosto de 2012 7:15
     
     

    Samay,

    I need one more help. Now I need a calculated field based on last two columns. Can u pls guide me on this?

    Thanks

    Shams

    • Marcado como respuesta Mohd Shams lunes, 13 de agosto de 2012 11:56
    • Desmarcado como respuesta Mohd Shams lunes, 13 de agosto de 2012 11:56
    • Marcado como respuesta Mohd Shams lunes, 13 de agosto de 2012 11:57
    • Desmarcado como respuesta Mohd Shams lunes, 13 de agosto de 2012 11:57
    •  
  • lunes, 13 de agosto de 2012 11:57
     
     Respondida

    Samay,

    I need one more help. Now I need a calculated field based on last two columns. Can u pls guide me on this?

    Thanks

    Shams


    I done it in SQL side.... Thakns
    • Marcado como respuesta Mohd Shams lunes, 13 de agosto de 2012 11:57
    •  
  • miércoles, 29 de agosto de 2012 12:23
     
     

    Hi,

    instead of doing it on SQL side it will much easiar and faster to do it on Reporting side.Use simple expressions to define new calculated columns.


    *Regards* *Samay Shrivastava* *Please mark it as Answered if it answered your question or mark it as Helpful if it helped you solve your problem.*