0

I have a matix in my report (VS2005) i would like the matrix to display a default of 12 rows even if no data is available. i have not figured out how to do this so i create a group of rectangles below the grid and each row of these rectangles has is visibility changed based on the row count in the matrix.

the problem with this is that these rectangles stil exist when invisible and therefore create a second page of the report that is blank because the matrix has pushed them down.

so my question is how do i remove these rectangles that are invisible or how do i tell the matrix to have a minimum row count of 12.

4

1 回答 1

1

您可以通过对具有所需维度的表使用左外连接来添加填充符。

在此示例中,并非所有月份都有销售额,但月份表包含所有月份。给定的表

month
------------
month_id -- 1-12
month_name -- Jan - Dec

Sales
------------
month_id  --not every month has sale
product
amount

select
    month_name
    ,product
    ,sum(isnull(amount,0))
from
    month
    left outer join sales
        on sales.month_id = month.month_id
group by
    month_name
    ,product
于 2009-03-24T21:39:20.867 回答