SSRS - Producing a report that is not dynamic in size - sql

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".

Related

Is there a way to use variables in vba to identify MS-Access report fields?

I am not a programmer, but have been tasked with doing this anyway! We are working on a research project that involves testing properties of different samples. I am trying to create a form that will generate a custom report based on what the user chooses. So, I have multiple text boxes and check boxes to allow the user to define the query parameters (e.g. composition of the sample must contain at least 5% component A) and choose what data they are interested in seeing in said report (e.g. show pH, color, but not melting point). I have successfully created code to generate the query, then generate a report based on that query, but the report defaults to column widths that are generally too big (for example, the pH column width is 3 inches, it only needs to be about 1). I would like to be able to fix this, but have not been able to figure out how. At the same time, some of these fields contain numbers that are averages of multiple test results, so I would like to limit the number of digits shown, and display them as % where appropriate. I started with just fixing the column width issue:
I have tried to make a collection of the fields that are included, then loop through the collection and set column widths, but cannot figure out how to identify a field with a variable:
If I know the field name I can do this:
Reports("ReportName")!FieldID.Width = 200
But if I have a collection of names, FieldNames, or a string VariableName, none of these work, giving me an error that FieldNames or VariableName is not a valid field in the report:
Reports("ReportName")!FieldNames(1).Width = 200
Reports("ReportName")![FieldNames(1)].Width = 200
Reports("ReportName")![VariableName].Width = 200
Is there a way to reference a field name with a variable?
Alternatively, I thought there might be a way to loop through all fields and set widths - this would involve looking up a column width for each field, which I thought to do by adding a key to a collection of column widths. But I cannot find a way to do that, something like:
For each Field in Reports("Report")
Field.Width = ColumnWidthCollection(Field)
Next
This hangs up on the Field.Width line, with "invalid procedure call or argument", which brings me back to how to reference a field name with a variable.
Any help would be greatly appreciated!
Try with:
Reports("ReportName")(VariableName).Width = 200

How can I incorporate entitlements with over 50,000 data points in SSRS Report?

In my SSRS report I am attempting to incorporate entitlements. If a user puts a specific person ID in the parameter, I'd like to be able to compare it against the up to 50,000 ids they are entitled to use and to put up an error message if not.
The available values feature only allows me to use a dropdown, which is incovenient for so many ids. What are my options?
A drop down would be very inconvenient for that many choices. Is it possible to break them down by a category or something like that? You could then create cascading parameters to make the list easier to deal with.
Otherwise it would have to be a free text field. Depending on the complexity of the report contents you could handle it a couple of ways.
If it is a very simple report with just a tablix you can set the no data row value to your error message.
If it is more complex you can display the error message using two rectangles. The first one would simply contain a text box with the error message in it. Then put the actual report comments in the second box. Control the visibility of these rectangles based on an expression that checks the number of rows returned by the dataset or some other indication that the input was invalid. You may even need to create a second dataset to check for input validity if there isn't a reliable way to use your normal query.

Best way to handle multi-valued fields as a view/grid

In several notes applications, instead of handling related data as separate documents, if the size of the data is small (less than the 32k limit), I'll make several multi valued fields and display it in what I call a "List Panel". It's a table where each column displays one multi-value field. Since fielda(1) goes with fieldb(1) that goes with fieldc(1) there is a concept of rows. (I did a similar thing in my auditing routine discussed here )
It is always assumed that each field has exactly the same number of elements.
All the multi-value fields are then stored on the single document. This avoids several coding conventions that made my eyes bleed like having date changed, who changed it, new value fields for each field we wanted to audit. Another thing that this kept to a minimum was having to provide multiple fields for the same thing that locked you into a limit. Taxrate1, Taxrate2, Taxrate3, etc...
In my "Listpanel" the first column is a vertical checkbox. (One for each element in my lists) This is so I can select one item to bring up and edit, or select multiple values to delete "rows" or apply some kind of mass change to them.
What would be the best way to handle this under xPages to get this functionality? I tried making a table but am having the devil of a time to get the checkboxes to line up with their corresponding data items.
Views and dojo-grids seem to assume we're using a document for each row.....
This TableWalker may provide what you want http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Tutorial-Introduction-to-XPages-Exercise-23
It was created when XPages was all very new, so it's SSJS rather than Java. But if you're comfortable wiith Java, converting it probably won't be a challenge.
You could use a repeat control to display the values and build a table using the table row tags in the repeat. You would want to calculate the id of the checkbox to be able to take an action on that selected row. The repeat var would be just one of your multi-value fields and you use the index of the repeat to get the value for that row from the other multi-value fields.

Automatic Chart Pagination with Report Parameters

Based on several report parameters in SQL Server 2005 reporting services, I would like to automatically generate one or several chart(s) for each row in the return result and paginate or space them out. How do I go about that?
If the number of charts will vary for each row, but the variations are known (e.g. it's either just chart 1, or chart 1 and 3, or charts 1 2 and 3) then it's simple enough using a table.
In the default detail row add any normal fields you need. Now insert a new detail row for each chart you might need. Lastly set the visibility of each chart row based on your rules, noting that the rule will hide the row if your expression evaluates to true. Make sure you select the row using the area to the left of the left-most cell, if you got it right you'll see that it's a row in the properties grid.
To get the layout you want you can merge cells for the charts to go in, or use a single cell and put a Rectangle in it, then in the Rectangle lay out your other controls.
Any rows that are hidden will be collapsed, so you wont get big empty sections like you can if you simply toggle the visibility of the charts themselves.
What you can do is place a List control on the page, set List grouping by record unique key (ID, or several fields if composite), and place a charts on the List. Next, set items visibility expressions to control it with report parameters.

Conditional Visibility and Page Breaks with SQL Server 2005 Reporting Services

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.