SQL Server Reporting Services 2005 Column Wrap on a Subreport - reportingservices-2005

Does anyone know how to set a height and width on a subreport so that it forces the subreport to wrap into several columns?
The delimma: I have to show a legend in a limited amount of space in a page header above a tabular report, and I'd like to limit the height of the legend so that it wraps into multiple columns, as needed. For example, the subreport might be pulling from a dataset containing 8 items: 1-red, 2-blue, 3-purple, 4-green, 5-yellow, 6-orange, 7-brown, 8-black. I'd like for the subreport to be formatted into 3 columns/3 rows, showing the first 3 in the first column, the next 3 in the 2nd column, and the last 2 in the last column.
Currently, the subreport is setup to have 3 columns, and the size of the subreport area inside of the master report is set to the exact same size as the subreport, itself. However, when I run either of the two, I'm getting only 1 column, and the height of the subreport is expanding to fit everything into 1 column.
Does anyone know of a work-around for this?

I would structure my query so that there are 4 columns, handling the logic for what colors are in your legend in SQL. That way you can guarantee that you always have at least 4 columns. If you have less than 4 just pass in null or empty values. Then the 4 column table for your subreport would be pretty straight forward.
The only other option I could think is to use a single text box and build your string with carriage returns after every 4th color...but that could be rather messy as well and you would have less control with the formatting (since you're using 2005).
HTH
PS. If you need some help structuring your query I'll be happy to help with that if post some code.

Related

BIRT Report Designer - Table to Produce Rows in Multi Columns

I have a table, which is listing the name of benefits and it is only 1 column (just name of the benefit).
I'm wondering if there is any native function of BIRT Report Designer to produce rows not only vertically but also populate horizontally to 3-4 columns.
Something like below:
Benefits List
Benefit-1 Benefit-3 Benefit-5
Benefit-2 Benefit-4 Benefit-6
Thanks in advance for any advice.
Ok, I found a solution!
Under the following link there is a Eclipse Community Page Link recommendation about an additional computed column. Even though I don't have any computed column, the recommendation gave me an inspiration. Instead of creating an additional column, I used the rownum that is used generally to bind dataset parameter. For the table row, I created "visibility" condition that checks if the rownum + 1 is divided by 3. Depending on what is the result, it will be hidden or viewed:
Main Grid
It includes a grid with 2 rows and 3 columns. 1 row is merged to view the header. In each column of second row, the same table is placed with the same dataset.
Image Showing Main Structure
Select Table Row
Image Indicating Row Selection
Set the Visibility
Image Showing Details of Visibility Condition
The syntax basically means: "Do not show the row if the division result is not 1".
For the second column, you will need to compare with 2: (row.__rownum + 1) % 3 != 2 and the third column with 0: (row.__rownum + 1) % 3 != 0
Hope it'll be helpful for someone.
An more straightforward approach ist to use a List item instead of a Table item.
In the detail area of the List, create a Grid item of fixed width and height.
Put the content (e.g.) text into the grid's cells.
Important: Set the "display" property of the grid to "inline" instead of the default "block".
This way BIRT will put the grids from left to right until the line is full.
Then it will fill the next line (think of "display: inline" like adding words to a paragraph).

Indicators in a matrix

I'm trying to add some indicators into a matrix to show an increase or decrease from the previous year
This is my design view
And this is how it's viewed in the report
I would obviously like my up and down arrows to appear in the currently empty columns. Also I'm wondering if there is a way of deleting the first empty column after 2014/15 as there is no year to compare it to.
SSRS supports a function called Previous, which will be useful in your scenario. Assuming that the name of your column group is "Fiscal", the difference of two years can be calculated as
=Count(Fields!IDNUMBER.Value) - Previous(Count(Fields!IDNUMBER.Value), "Fiscal")
Because you can't know the range of the numbers in advance, I suggest to use a "numeric" expression like
=Sign(Count(Fields!IDNUMBER.Value) - Previous(Count(Fields!IDNUMBER.Value), "Fiscal"))
for the indicator, so the ranges can be defined by single values -1, 0 and 1:
To hide the first indicator column, right-click the column header in design view and click Column Visibility..., then in the cnfiguration dialog specify to hide based on an expression like
=IsNothing(Previous(Fields!Fiscal.Value, "Fiscal"))
Here's a screenshot of my design view:

Stop SSRS From Hiding Columns

How do I stop SSRS from hiding a column when previewing if the column has nothing more than empty rows? I have set all columns to be fully visible, yet the report preview does not show the empty columns. I know that this is a default feature within Visual Studio that hides all empty columns by default, so how do I change it so it can show all columns no matter what. Where can I change those settings?
If you mean the preview in the query designer of the dataset:
This is only possible when writing your own MDX since the generated code always generates a SELECT NON EMPTY for the measure axis. So removing the NON EMPTY part will always show your column/measure.
If you mean the ssrs report preview:
Columns only hide when using a table matrix with a column group. In this case make sure your dataset always returns each column group at least once, regardless of your chosen filters. E.g. if using MDX this could mean removing a NON EMPTY from your row axis or using the right-click option "include empty cells".
Clarification for comment plus possible workaround:
This "hiding columns" things is no feature. If the column isn't in the result of the dataset, SSRS can't know that this value even exists, so there is no solution if using a column group except for redesigning your query.
You could work around this by not using a column group and instead of using static "hard-coded" columns which, for example, sum the values depending on your group. See the following example screenshot i made: example

How do I repeat a rectangle as a header on every page in SSRS

I have the following RDL setup: a single rectangle that contains 3 elements (an image, and 2 textboxes). Underneath the rectangle, I have multple tablixes, lets say 3 for now, but this number will increase or decrease dynamically as I am constructing the RDL markup with XML within my .net app. Each tablix will have it's own unique dataset (data and columns differs between the tablixes).
In order to render each tablix on a new page, I went ahead and added a PageBreak:End on each tablix, except the last one. Now, I need the rectangle to be repeated on each page, but how do I do this? I thought that maybe the RepeatWith property could be used, but this only allows a single selected data region. So, the rectangle rendered on page 1 and page 3 (not on page 2).
Any help would be greatly appreciated thanks
You could place the rectangle in the report header to repeat on each page:
https://blogs.msdn.microsoft.com/selvar/2010/12/27/report-headers-and-footers-with-microsoft-sql-server-reporting-services/

How do I change the orientation of a table in a BIRT report

I need to change the orientation of a table in a BIRT report so that the table header is vertical instead of horizontal.
Is this possible? I don't want to use a Crosstab.
It seems this thread is still being pointed at so I posted an example of a horizontal table layout using a crosstab. I know it won't help the original author but others following this thread now may find this helpful.
To create the horizontal grouping, first create your query like normal, then create a Data Cube. In this data cube, drag each field that you want into a group. Then drag a new crosstab on the report and drag each field into the top right column group area. It will create a new header row for each field. Don't put anything in the left side (Rows) and don't put anything in the measure field (bottom-right). This will create labels on the left... and the data will extend out to the right.
The report design example can be downloaded from: http://developer.actuate.com/community/forum/index.php?/files/file/1079-horizontal-table-using-crosstab/
Virgil
If you want dataset records to be reported across the page, this would have to be done via a crosstab.
If you want dataset records to be reported down the page, this can't be done automatically as far as I know. However, it can be done by inserting a new detail line in your report table object for each database field to be reported, then moving column headings from the heading row into the first column's detail rows and moving record values into the second column's detail rows.
So, for example, a report with 6 columns in it would become a two column report with six detail rows.
Not in box (up to 3.7). You have to use 3'd party libs like that one.

Resources