What is the easiest way to make a "Banded" Report in RDLC?
Asked Answered
K

1

5

Okay, I may have been googling for the wrong search terms but I can't find how to make a MS-Access style banded report with RDLC (that is the crippled report designer in Visual Studio 2010, not BIDS) And by banded I mean, a report with group headers and sub group headers-- not alternating bands of color.

I have a toolbox with a List, Tablix and Matrix, which sort of all behave the same- I keep getting things that look like MS-Access CrossTabs. I can get this:

Country Population    Date
---------------------------
Spain 1 million     1982
Spain 1.1 million   1983
China 1 billion     1982
China 1.2 billion   1983

I can also get countries on rows, years on columns and pop in the center, like cross tab, but I don't want a cross tab. Also, I don't want row headers, which really is just the same as above, except identical cells are merged.

But I can't get this:

---------------
Spain 
---------------
Population     Date
1 million     1982
1.1 million     1983
---------------
China
---------------
Population    Date
1 billion     1982
1.2 billion   1983

Is it even possible with RDLC?

More Info Reporting Services is a server product that Microsoft publishes that comes with a client call Business Intelligence Development something something or BIDS for short. The former consumes RDL and the later produces RDL (RDL is a XML based reporting language). I don't have either of those.

I have ReportViewer, which is an ASP.NET control that can read RDLC (a crippled subset of RDL) and I have Visual Studio 2010 which has a crippled version of BIDS. The toolbox in Visual Studio 2010 has a list, a Tablix and a Matrix, which all appear to be the same control with different default starting properties. It is effortlessly easy to create what in MS-Access are called Crosstabs, but trial and error to produce a banded report that groups tends to produce anything but.

Kip answered 17/11, 2012 at 1:4 Comment(4)
I've answered a very similar question before, maybe it'll help you.Sumbawa
That one assumes that the user knows how to "Make a list that groups on the date field" or in my case, "Make a list that groups on the Country field" So far, all I get for my thrashing are "detail members can only contain static inner members" or groupings that repeat vertically (a column of Spain, a column of China) and other inexplicable oddities.Kip
Can you give more information? Are you doing RDLC in conjunction with ASP.NET, what does your current RDLC file look like? I've never even heard of RDLC until just now, but it appears to be one of the most undocumented features I've had the opportunity of searching for information about. I suppose post processing the report into the format you want with a script isn't acceptable either?Hate
I have a legacy report from the last developer that uses nested tablix's but I have no idea how to recreate what he did with the GUI. So my starting point is a blank page. Already for databinding and parameter access I have to manipulate the XML directly, so I suppose a solution that calls for writing XML can't be any worse than the designer.Kip
E
7

As long as I've understood everything, what you are asking is achievable in RDLC format, i performed the following steps to get your desired output:

  1. Firstly I created sample data to play with using the data example you provided above.

    CREATE TABLE [dbo].[SampleTable](
        [Country] [nchar](10) NULL,
        [Population] [nchar](20) NULL,
        [Date] [nchar](10) NULL
    ) ON [PRIMARY]
    
    GO
    
    INSERT INTO [SampleTable]([Country],[Population],[Date])
    SELECT 'Spain', '1 million', '1982'
    UNION ALL SELECT 'Spain', '1.1 million',   '1983'
    UNION ALL SELECT 'China', '1 billion',     '1982'
    UNION ALL SELECT 'China', '1.2 billion',   '1983'
    
    GO
    
  2. Next i created a new WindowsFormsApplication and added a new item "Report" (not Report Wizard)

  3. From the Toolbox i added a new Table followed the wizard to connect to the sample data previously created

  4. Added Population and Data to the table and deleted the extra column so your left with something looking like this:

    Details Only - Population and Data

  5. Add a Group, by Right Clicking on (Details) under Row Group, Add Group > Parent Group...

    Dialogue Box - Tablix Group: Group by: Country, Tick "Add group header"

  6. Now Delete the newly created column, making sure you select to delete the column only not the group

  7. Delete the column header row and add the Country field in the blank Row (click on the table icon that appears when hovering over the field), can also Merge the cells by right clicking as well

  8. Add a new Row between the two rows, by Right Clicking (Details) under Row Groups, Add Total > Before

  9. In the new row add the row headers, Should be left with something like this:

    Final Solution - Layout

    Final Solution - Groups

  10. Switched over to the Form.cs [Design], Added a ReportViewer from the ToolBox, Choose the newly created report

  11. Preview of the Final Solution was as follows

    Final Solution - Preview

Next steps would be to update the formatting of the report

Evenfall answered 19/11, 2012 at 14:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.