I know there's a bug with conditional visibility and page breaks with SQL 2005, but I wonder if anyone has come up with a work around.
I have a table that has a conditional visibility expression, and I need a page break at the end of the table.
If I set the PageBreakAtEnd property to true. It is ignored no matter what. Remove the visibility condition and it works.
If I place the table inside a rectangle with the conditional visibility on the table, and the page break on the table. Same result. The page break property is ignored.
If I set the rectangle with the PageBreakAtEnd property and the table with the visibility condition, then I still get a page break even when the table isn't shown.
Any other ideas on what to try? I'm almost at the point where I need a separate report rather than conditional visibility :(
Edit: #Josh: That has the same problems. If the second table has conditional visibility it doesn't work. If it doesn't have the visibility expression, then I get the page break all the time.
#Erick: I really wanted that to be the answer but unfortunately it doesn't work. When the visibility expression evaluates to hidden, there's a big gap where the rectangles would be (which I can live with), and when it evaluates to visible, the page breaks still don't work.
Place two rectangles, one inside the other.
Place your table inside the inner rectangle and set it to always be visible.
Set the inner rectangle's Page Break to Insert After Rectangle.
Set the outer rectangle's visibility to use your conditional expression.
The page break and the conditional visibility are now separated, and the inner rectangle's page break won't be processed if it is not visible, but it will if it is visible.
Edit: When I tried this, it did not appear to work in the Preview tab in Visual Studio, but it did work in the Print Preview and when I exported the report to PDF.
Hi This is Bala samsnai,
Me too came accross the same type of error.
I soveled this with out using Rectangle.
Instead of giving the expression to the complete(whole table)
select the one row in that tabe,give the visibilty expression. like that repeat it for all the rows (like Header, Detailed, Footer) and give the visibilty expression.
By that we can get work both the Visibilty and Pagging both at a time
Bala samsani
Use a rectangle, which has the conditional visibility set, and an empty table inside of that rectangle which has the "insert page break before" setting enabled.
Add a second (empty) table immediately after the first. Page break after that.
I tried Bala Samsnai solution and it works. Will explain more later. Erik B's solution of uisng two rectangles kind of worked when I hit a snag that I cannot embed a table in the Detail row of another table. So that was a bummer.
I followed Bala's solution with my report, which contains only one table and two groups within the table. Instead of adopting and applying an expression to control the Visibility of Groups, I just left that as Visible and applied the Visibility condition expression to each row's Hidden property. Right click on the Row Handle on the far left and you will properties window popup on the right or left (usually as a tab next to Solution explorer). In the Visibility grouping, you will see a property called "Hidden" which will have a default value of FALSE. click on the value and in the dropdown, first option is an expression. Viola and you can setup you condition when the row is hidden. It worked like a charm for me.
Hope this helps others. In my case, I had to not show the details section when some of the values where 0.
I struggled with this problem for quite a few hours until I discovered that the my layout was to wide to fit on print (A4). I had used the extra width for commenting the different field in text boxes with Hidden=false, and as a result twice as many pages as neccessary were generated to display whitespace.
So, you might want to check page width as well.
One thing I noticed is the differences between reports even though I have used the same report as a "template" across different times in SSRS2005. What I mean is, if you open the report you're having problems with in a programmer's editor (say UltraEdit) and look at the RDL file, you may pick up slight variations in page width and height. I noticed this and adjusted the report I was having problems with to the correct width of the paper expected and the report printed perfectly in both PDF and at the printer, and at print preview. Just a thought.
Related
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
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 !
I'm using a data view to display a list (Sharepoint 2010) that has several columns including one that has a Name column. I've provided the user with a text filter on the page to send values to filter the Name column in this list. The problem I'm facing is that the filter only works for exact matches and not partial matches.
I tried to overcome this problem by using Sharepoint Designer to:
create a parameter that uses the textbox control value.
Filtering the Name column with this parameter and setting the comparison to "Contains"
Unfortunately if the default value of the Parameter is blank, the list does not display any data. If the default value of the parameter is set to part of a name in the list, the list displays names that contain that string. However, when changing the value in the text box and searching, the list does not return results. Please let me know if you guys know how to fix this. Any help is much appreciated and let me know if you need any additional information. Thanks!
Managed to find a solution to my problem. I used a custom javascript solution designed by jvossers (http://instantlistfilter.codeplex.com) that involves the list being filtered instantly much like Google's search!
The only downside of this solution is that it only filters the items currently displayed on the screen. Therefore, if you have a data view web part which limits the amount of items displayed on the page, this solution won't help you. In order to facilitate this solution, display all the row items on the page (by increasing the item limit per page to a larger number than your total list rows) and then add this code into a content editor web part on the same page. Worked brilliantly for me. '
By the way if you are using jQuery 1.3.x or higher, you should modify the script a little as described in the disscussion here: http://instantlistfilter.codeplex.com/Thread/View.aspx?ThreadId=49123
I have a semi-dynamically created window ( and use PowerBuilder 10.5 ). Now there are a couple of columns which can have different colours and I want to see those colours when selecting a row. However I don't know how to deselect these columns and have the first couple of columns remain selected.
The highlight function in our application just does a dw.selectrow( x, true ).
Regards,
Marinus
I don't think you'll get what you want using selectrow. If you don't need multiple selections you could change the background of the current row with an expression in the datawindow. If you want some columns to stay normal you could do that with a rectangle behind the ones you want to highlight instead of changing the row color. If you need multiple rows highlighted you will have to simulate multi-select by adding a dummy column and using that to control the background, and of course you need to handle the selecting and deselecting in the clicked event. If you've got code that deals with selected rows you'll have to change them to use the new scheme, for example by checking the value in your dummy column.
If you want to use SelectRow(), maybe use of SetRowFocusIndicator() would help. IIRC (it's been pretty close to decade*s* since I've used it), it disables the row colouring in favour of the new method.
The other way that comes to mind is setting an expression for background colour that uses GetRow() and CurrentRow(). This wouldn't be my first choice, as it doesn't let users with vision impairment choose their colours through standard Windows colour selection to something they can deal with, but if you're dead set on colour indications on selective columns, this would be the way to go.
Good luck,
Terry.
I want to build a report that is completely static in size and shape. I'm attempting to mimic a hand-entered report that someone in my organization has been building from a word doc for years.
The critical piece appears to be fixing the number of rows that are produced in the various Table grids that fill the page. I would like them to always contain a set number of rows, whether data is present or not. It would seem that if I can just fix the size my tables, then all the other elements will not be forced to move because of stretching repeater sections.
All my grids are backed by stored procedures, so I'm open to SQL tricks as well.
Sorry i did miss-read the question.
If you know how many rows you need to return (say 20) maybe you could pad some bogus info into your records returned from the stored procedure. You might be able to count the records your query has returned before you send them back, and if you have less than 20 add some bogus ones to the record set, put something like 'NonDisp' or something in them.
Then in the report put an iif statement into the cells that checks for this bogus info, if it is found change the cell to display nothing, otherwise show the valid values
Not a direct answer, but perhaps a workaround you might consider: perhaps you can insert a page break after the table grids that have dynamic sizes, so that all elements that follow it have a fixed position (relative to the top of the page).
Add a parent group to tablix with =Ceiling((RowNumber(Nothing)) / 10000) expression. (10000 or whatever is required no. of rows)
In page break properties of group, check box for insert break between groups, leave the bottom boxes un-checked.
Optionally, we may chose to set hidden property true for text boxes added because of new parent group.
In tablix properties, check box for "Keep together on one page".