![]() |
Database »
SQL Reporting Services »
General
Intermediate
License: The Code Project Open License (CPOL)
Implementing an Ugly Tab Structure in Reporting ServicesBy akjoshiImplementing a tab control like structure in SQL Server 2005 reporting services report using tables and text boxes |
C# (C#2.0), .NET (.NET2.0), ASP.NET, SQL-Server (SQL2005), WebForms, Dev, Design
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
In this article, I will show a way to implement a tab structure in a SSRS report; as reporting services doesn't provide a lot of controls to design our reports so we need to use the existing controls to achieve our targets. To create a tab control in a report, I will use simple textbox and table control and visibility property of table control.
I recently came across a post in ASP.NET forums asking about creating a report containing a tab control (How to create Excel like tab layout?). I faced a similar situation a few months back when our client strictly wanted to display only one table at a time in a report. I spent a lot of time to find out a way to achieve this, but had no luck and finally I came up with this approach. I must admit that I was not at all happy implementing such (ugly) tab structure, but the client was ok with this, so I did.
So the requirement is that we have three tables which need to be displayed in a report and every table must be associated with a tab and at any given time, only one table will be visible in the report. User can select any of the given tabs and the corresponding table will become visible and the other will be hidden.
Following are the problems in implementing a tab structure in reports:
Due to the limitations of report designer, we can't fulfill all the requirements so we will implement a tab structure with the following behavior:
We will have three tabs as required, but each tab will have a +/- sign, clicking on which will show/hide the tab data. This +/- sign is due to the use of Visibility can be toggled by another report item property of table control.
At the start, only one table will be visible and the user can click on any other tab (+/- sign). Clicking on tab (+/-) will show/hide the corresponding table. So if all three tabs are in expanded state (i.e. in - state), then all three tables will be visible and if all three tabs are in collapsed state (i.e. in + state), then all three tables will be hidden, tables can be in mixed state too based on tab states.
Let's start with the implementation:
That's it, preview the report and the outcome will be something like this:
A sample report is attached with the article for reference.
Although this tab structure was good enough for display, it has a few issues while exporting.
| You must Sign In to use this message board. | |||||||||||||||
|
|||||||||||||||
|
|||||||||||||||
|
|||||||||||||||
|
|||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 24 Jun 2008 Editor: Deeksha Shenoy |
Copyright 2008 by akjoshi Everything else Copyright © CodeProject, 1999-2010 Web22 | Advertise on the Code Project |