How to Implement Tree View in SSRS

  • Any idea how to implement tree view in SSRS 2005

    If we use DrillDown from one Column group to another it comes like

    Column1|Column2|Column3

    Country

    -State

    -City

    but we need like

    Country

    -State

    -City

  • Are you using a table or a matrix?

    Nigel West
    UK

  • i m using matrix and its a row group not a column group

  • Hi Ravi,

    Its a better idea of having three Groups in your table. You can take only Group Header( Group Footer is not required in your case)

    First Group for Country

    Second Group for State and

    Third Group for City.

    Now Drag and drop the Fields from dataset into corresponding groups.

    Keep in mind that drag and drop the fields in First column itself.

    Not give Left Padding 20pt for Secong Group Column and 40pt for third Group Column

    See the attachment Test.PNG for help.

  • Hi Hari ,

    Thanks for reply

    acutally i want to implement tree view in martix

    Regards,

    Ravi

  • You could use the same principles as described above, but in a matrix.

    The key is to ensure that you only have one row group, and that row group must be based on all three of your columns (Country, State, City) to ensure you get a break at the right place. Then use the suggestions above for padding.

    Regards,

    Nigel West
    UK

  • how we can put all the 3 fields in single row group

    can u please give and example or steps to do that

    thanks in advance

  • Hi

    Create your group by adding the first field (probably country), then right click on the group and click on edit group. This bring a dialogue box to the screen which allows you to add fields into the group specification (see attached image).

    However, I'm thinking this might still be a little tricky to do exactly what you want, you are probably going to need to do some expressions using PREVIOUS function to know what you have to actually print in that space.

    For example, the expression you have in that row group probably should be something like:

    =IIF(Fields!Country.Value = PREVIOUS(Fields!Country.Value) AND Fields!State.Value = PREVIOUS(Fields!State.Value), SPACE(10)+Fields!City.Value, IIF(Fields!Country.Value = PREVIOUS(Fields!Country.Value), SPACE(5)+Fields!State.Value, Fields!Country.Value)))

    Nigel West
    UK

  • Thanks for the reply,

    Will that allow me to Toggle from one group to other

    i wana drill down from 1 group to other and display that as Tree view

  • Sorry, missed that bit of the requirements, the answer is No because it is just one group, so it won't recognise any difference between Country, State, City.

    To summarise:

    You need this in a matrix

    You need three groups (Country, State, City)

    You want to toggle/drill down between the groups

    You DONT want these fields in different columns

    If this is correct then I'm afraid you're not going to be able to do it, I think your best option is to remove the last item as a requirement and have the three fields printed in separate columns.

    Sorry about that,

    Nigel West
    UK

  • Thanks Nigel West

    if i remove the last requirement thn its very simple just use drill down feature of SSRS which i have already done, but i cant remove that last requirement

    any idea if we use custom code or some component thn is it possible to achieve ??

    Regards,

    Ravi

  • Yeah,

    I agree with nigel

  • There "MIGHT" be some way around this, I'll put some thought into it and let you know by the end of today if I come up with anything. I'm at my paid job now so I'm going to have to do something for them!!

    Will log on later on tonight if I come up with any ideas.

    The only thing I can think of is to set up the matrix using normal three row groups, but to adjust the width of group 2 & 3 to as small as possible, and print everything in group 1, but I'm not sure at the moment that this will work.

    Will get in touch later.

    Nigel West
    UK

  • nigel.c.west (7/15/2008)


    There "MIGHT" be some way around this, I'll put some thought into it and let you know by the end of today if I come up with anything. I'm at my paid job now so I'm going to have to do something for them!!

    Will log on later on tonight if I come up with any ideas.

    The only thing I can think of is to set up the matrix using normal three row groups, but to adjust the width of group 2 & 3 to as small as possible, and print everything in group 1, but I'm not sure at the moment that this will work.

    Will get in touch later.

    Thanks Nigel for your time and efforts

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply