Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3228614
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:42:49+00:00 2026-05-17T16:42:49+00:00

The Problem I am using dynamic matrix groups as in Dynamic Grouping from Chris

  • 0

The Problem

I am using dynamic matrix groups as in Dynamic Grouping from Chris Hays’s Reporting Services Sleazy Hacks Weblog (which has some great stuff and is worth checking out, by the way). I have my row and column groups bound to two multi-value parameters and everything is working great, except for one thing. Even though I am suppressing unused groups from displaying, they are still taking up space.

Here’s what the report looks like now when I choose only one row group and one column group:

What the matrix looks like now, with extra space
Notice how even though the undesired groups have property hidden True (as set by an expression) they still take up space. Here’s what I’d like it to look like (I cut the blank areas out of the picture by hand):

How I'd like the matrix to look

The Question

Does anyone have any ideas how to make the blank areas shrink when the corresponding matrix groups are hidden?

Just For the Curious (Not part of the question)

For reference, here is what the matrix looks like in Layout mode:

Layout view of the matrix

And if anyone else wants to do dynamic matrix groups like this, here’s the code section that does the heavy lifting:

Public Function ValueIsInMultiParameter(MultiParameter As Parameter, Value As String) As Boolean
   Dim i as Long
   For i = 0 to MultiParameter.Count - 1
      If MultiParameter.Value(i) = Value Then Return True
   Next
   Return False
End Function

Public Function DynamicFieldValue(CurrentFields As Fields, MultiParameter As Parameter, Index As Long) As Object
   If ParameterCount(MultiParameter) - 1 < Index Then Return ""
   Return CurrentFields(MultiParameter.Value(Index)).Value
End Function

Public Function DynamicFieldFormattedValue(CurrentFields As Fields, MultiParameter As Parameter, Index As Long) As Object
   If ParameterCount(MultiParameter) - 1 < Index Then Return ""
   Return CustomFormat(CurrentFields(MultiParameter.Value(Index)).Value, MultiParameter.Value(Index))
End Function

Public Function DynamicGrouping(MultiParameter As Parameter, Index As Long) As Object
   If ParameterCount(MultiParameter) - 1 < Index Then Return "None"
   Return MultiParameter.Value(Index)
End Function

Public Function DynamicGroupingLabel(CurrentFields As Fields, MultiParameter As Parameter, Index As Long) As String
   If Index = 0 Then Return "Grand Total"
   If ParameterCount(MultiParameter) - 1 < Index Then Return ""
   Return CustomFormat(CurrentFields(MultiParameter.Value(Index - 1)).Value, MultiParameter.Value(Index - 1)) & " Total"
End Function

Public Function CustomFormat(Value As Object, ValueType As String) As String
   Select Case ValueType
      Case "DayOf"
         Return Format(Value, "M/d/yyyy")
      Case "WeekOf"
         Return Format(Value, "M/d/yyyy")
      Case "WeekDayPart"
         Return WeekdayName(Value)
      Case "MonthOf"
         Return Format(Value, "MMM yyyy")
      Case "MonthDayPart"
         Return "Day " & Value
      Case "MonthWeekPart"
         Return "Week " & Value
      Case "YearOf"
          Return Format(Value, "yyyy")
      Case "YearDayPart"
          Return "Day " & Value
      Case "YearWeekPart"
          Return "Week " & Value
      Case "YearMonthPart"
          Return MonthName(Value)
      Case "YearPart"
         Return Value
      Case Else
         Return Value
   End Select
End Function

Public Function ParameterCount(MultiParameter As Parameter) As Long
   If MultiParameter.Count = 0 OrElse MultiParameter.Value(0) = "1" Then Return 0
   Return MultiParameter.Count
End Function

In the parameters, I put a hard-coded list of selectable grouping options, for example the RowGroups parameter has available values:

Label   Value
-----   -------
Year    YearOf
Month   MonthOf
Week    WeekOf
Day     DayOf

Where the Value is the name of the SQL column as returned by the DataSet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:42:50+00:00Added an answer on May 17, 2026 at 4:42 pm

    I haven’t found any way around this, but by conditionally setting the colour of the lower-grouped item to be the same as that of the higher-grouped item where there is no lower group selected, you could give the impression of one extra-wide higher-grouped item, instead of a normal-sized item next to a blank.

    Incidentally, the linked blog doesn’t appear to have been updated since 2006.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem using nested partials with dynamic form builder code (from the
I'm using dynamic multilevel hashes from which I read data but also writes data.
I'm currently wrestling with an Oracle SQL DATE conversion problem using iBATIS from Java.
I have a program that solves the weighted interval scheduling problem using dynamic programming
Guys, I am using dynamic programming approach to solve a problem. Here is a
i have a problem i want to add Colomn ( Dynamic using C #)
I have a problem using the Java search function in Eclipse on a particular
I'm having a problem using the java.text.MessageFormat object. I'm trying to create SQL insert
I have the following problem using subversion: I'm currently working on the trunk of
I have the following problem using template instantiation [*]. file foo.h class Foo {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.