How to group a text row in multiple data rows in Microsoft Report Builder - sql

Basically I'd like to from this :
What I have
To this :
What I Want
Case in Orange are data that I pick up with an sql request while "This e-learning phase..." is just a plain text.
Does anybody knows how to do that ?

You could add a Parent Row Group and Group by the Information field.
Unfortunately, this would place the Information on the Left side of the table. Fortunately, there is a Layout Direction property for the table that can be switched from LTR to RTL so that the table is created from Right to Left instead of the default Left to Right.
This way the grouped information field on the right would only have one cell while there may be multiple Activities.

I'm not sure you'll be able to do this exactly how you want. This is because you cannot add rowgroup columns after non-grouped columns.
The only way you could get close is to not show the text if it's not the first row in the dataset (or rowgroup if the report is grouped somewhere)
You could use something like this in the Value expression.
=IIF(
ROWNUMBER("myDataSet_Namehere") =1,
"This e-learning phase must be completed before the start of the classroom part indicated below.",
Nothing
)
You could use a similar check to then set the vertical alignment property.
It looks like this...
The other option would be to move the test to the top of the table on it's own row in above the column headers, it would probably look neater..
Or you can wait for somebody else to come up with a better solution :)

Related

Crystal Reports crosstable formatting

My colleague and I have taken over a vb.net project that uses Crystal Reports (I have CR9 on my PC).
The user has given the following feedback to us on how he would like the reports changed.
1) At the moment, it is wasting space by showing empty columns. How is it possible to not show the columns where all values are "-"? (I've tried using Crosstab Expert, however there are some reports where the columns have second sub-columns with titles in, so with these ones it shows them as it treats the columns as not empty)
2) The crosstabs at the moment are displaying from left to right, and are adding next to each other. My user wants the tables to go underneath each other, so that the report goes downwards, rather than sideways. How is this possible?
If anybody knows a fix to either of these issues that would be great, thanks.
In regards to the empty columns, you can choose a custom style in the Crosstab Expert and select Suppress Empty Columns
If the dashes don't count as empty, you might need to change the crosstab to evaluate a formula which replaces the dashes as zeroes or blanks.
I'm not aware of a good way to make a crosstab separate vertically as you specified. But you could swap the rows with the columns. It appears to me you have way more columns than you do rows, which should fit better on the page.
I suppose you are using the database field directly in the cross tab which is the reason you are getting -. Possible approach would be to write a condition and use that in cross tab. something like below
Create a formula #Formula1
if {Database.field}<>"-"
then {Database.field} //You can end the condition here if you wish
else "" // If you write else then check option supress empty rows or columns as per requirement
Now create a cross tab using Formula1 and display
Coming to your second problem , If you not wish to spread cross tab horizontally then you can pivote cross tab by Right click on cross tab or go to cross tab expert and give the fields that spread in rows part and that are static in column part.
Hope this helps

Breaking the SSRS report depending on the Multi Value Parameter

I am working on a SSRS report with a Multi Value Parameter which contains list of names. I have written an expression for the title that works like "Result for SELECTED NAME". It also have an option of (Select All) which displays all the results with title as "Result for MULTIPLE NAME". It is working fine up to this part.
Now I have to modify the report like, If i select multiple values, the report should break into pages with each selected name on different page with title for that individual parameter value(name) as "Result for SELECTED NAME".
Please help me. Thank you.
You can place the entirety of your current report (excluding headers/footers) into a List object. I assume youa re returning the selected values from the parameter (like Manager Name) as part of your DataSet. Assuming this is the case
Create a new list
Insert the contents of your report into the rectangle of this List
Right click the List Row Header and Select Row Group -> Group Properties
Set the Group to Group on
=Fields!ManagerName.Value
This approach will take a simple table like this
And break it into a list like this
Then you can just set the Tablix Properties of the List to Add a Page Break After to checked
Hopefully this is helpful. If you have further questions on this then please let me know
I worked on it and found a way to make it happen. I first created the row group for Names. Then applied the page break for each instance option. Then deleted that group column (Only deleted column but not group). Then added that group in a static column on the top, and wrote an expressions to show that group itself as a title using concatenation.
But here I faced another problem, when there is no data for the selected name, the title row isn't displayed in the preview as it also a column in the table.

MS Access: Conditional formatting - highlight duplicates

Is there an expression that I can use in MS Access ,to highlight Duplicate entries in Reports?
I tried something like Expression is : Count(*)>1 but it doesn't work.
Br,
I suspect that the original query will need to be bulked up with a sub-query that has an ID column and count of ID. The outermost query will then need to also return the ID count.
Within the report you'd then need add another field that would show the linked ID count if it was > 1.
Access reporting (and forms) allows conditional formatting to be used in a similar way to excel.
See Ribbon: Report Design Tools>Formt>ControlFormatting...
It will let you change the format of a control depending on the value it, or another control, contains.
It's a very nice feature and will also let you add bar charts to you list forms to graphically represent the values sorted in a control.
However, the data set will need to have a column that indicates whether the current row has duplicate records. The snippet from you current query that you provided (that I repeat below) will not do this:
...OR (((Object.Key) In (SELECT [Key] FROM [Object] As Tmp GROUP BY [Key] HAVING Count(*)>1 )));
Without seeing the whole query I can't really help much, but you will need to remove the use of IN and make the SELECT statement a subquery of the main SQL Statement. The main query resultset will need to be LEFT JOINED to the sub query using the Key field. Because of the LEFT JOIN you can use "isnull(Key)" in the SELECT clause and isnull(Key) will be true for non-duplicate rows.
You can then refer to thiscolumn in your conditional formatting
I hope this makes some sense.
You
For a quick and dirty way to highlight duplicate data:
Select the object you want to highlight if it's duplicated, and make
the background white (or whatever the colour of your background is).
Create a copy of the object that you want highlighted if it's
a duplicate.
Format the copy so it has a highlight, and/or add extra text
(eg: DUPLICATE)
Put the copy behind the original (so it can't be seen).
On the original object, select "Hide duplicates" in properties.
Ensure "Hide duplicates" is NOT selected on the copy.
So when the duplicate appears, Access will hide it, but then the object you've created that was originally hidden beneath now becomes visible - effectively highlighting the field.
(Unfortunately it will only highlight the field itself, not the entire section.)

How to keep Reporting services table in the same page

Is it possible to keep table column within the same page? It always go to the new page when table width is larger than page.
I design a report with TableA that have dynamic columns. The dynamic columns are in short format. For example: BS, BN, OT...
In order to understand column meaning, I have to create another table, TableB, below the table to explain. I want to display it horizontally. For example: BS: Basic Salary| BN: Bonus| OT: Over Time| ...
But when TableB has many columns, It go to new page and leave a lot of blank space in previous page. I want to keep columns in the same page, if possible.
I want TableB to display like this:
|X:xx| X:xx | X:xx| X:xx| (Edge of right page)
|X:xx| X:xx|
You're using a horizontal table, a great tutorial is described here
You probably have most of the horizontal table figured out, just this part is important to your issue.
Step 4
Right-click on the column header and select "Edit Group". Enter this
for the group expression: =RowNumber(Nothing). This will cause the
matrix to give you one column per row of data. Since horizontal tables
can end up rather wide, you probably want your table wrap around to
the next "line" after a specific number of columns.
Just simply count the number of rows that fit your page exactly and define this number in your column group expression as described in the tutorial.
Use Column Visibility to hide column instead of Cell Visibility. This should eliminate the blank space.
If the report is still too big, set the report interactive size to 0in,0in. This will keep everything in one page.

How to make rows invisible while printing reports?

I am using an .rldc file to define the layout of the reports from my program. The problem is, it is to be used for incremental printing. That means the paper will be used over and over as newer rows need to be printed. I'm attempting to approach it this way:
List all corresponding data on the report view.
Make the older rows invisible and only show the latest row.
Print.
That way, the last row is already properly placed. The problem is, I don't know how to implement this. Can anyone help me out?
You could create an IIF(condition,true,false) statement in your report definition on the row visibility variable.
The best way i guess is to define in your data source something of a rank column.
example :
select col1,col2,col3,RANK() OVER (ORDER BY col3 DESC) AS 'rank' from table1
Then in your table or matrix, you click on the row or/and column that you want to make the borders and text white based on a expression.
Go to the properties and dropdown on bordercolor
choose expression and type in (based on my example query)
=IIf(rank.value <> max(rank.value),White,Black)
That will not remove the rows only make the borders white ( unvisible)
The same you can do with Font Color property.
I think this is your best shot at this issue.
Other solution I could think of is to just hide unneccesary rows (which also replaces the visible row)
Then to move the table down by using a expression with a formula like nr of rows hidden before the actual row * height of 1 row, only I m not sure if this is applicable without programming an RDL extension..
Good Luck !