How to remove empty space after last row when using Can Grow option on text fields in Crystal Report? - crystal-reports

I have a report displaying rows with text fields with variable length (I use the Can Grow option). I use a Box for the details. My problem is that when the last text field cannot fit into to the box on the bottom of the page, a empty space is left, and the new row begins on next page. Unchecking the option Keep Object Together on the fields, didn't solve the problem and if it did I don't want the content of the text field to break across pages.
My question is: Is it possible to auto-re-size box height depending on rows content, so I can avoid empty spaces at the bottom on every page (doesn't look very nice).
Thanks in advance.

There are three things I can think of that might help.
As you said, you can limit the maximum size of a "can grow" field. To the right of the can grow checkbox (in CR designer) there is a "Maximum number of lines" value that defaults to 0 (no limit). You can set that to however many lines you like.
The details section itself has a setting for "keep together" too -- right-click the details section label and go to the section expert. If you uncheck it there the details section will start on the bottom of the page and continue on the next one.
Look at the page footer section, it is printed at the bottom of each page, and if it is large, it takes away from the available space for the data. Group footers, if you have any, could give you the same problem.

Related

Display 4 pages of a sub-report in Crystal Reports

I would like to display only 4 pages on my Crystal report, however, I am getting an extra empty page. I cannot pin the reason to what sounds like a trivial issue.
My report has the following:
- No fields in the main report - This is not avoidable.
- One sub-report.
- In order to have the sub-report header repeat I followed this method described here. (I just do not understand what the formula means and whether this is the reason for the extra page but I am getting a header as I require).
I am suppressing the pages in both the report and sub-report as follows: in the suppress I am using
if pagenumber>4 then true;
I tried to put in all my sections
Not(onLastRecord)
I am simply lost. All I need to do is print 4 pages only regardless how long the report/sub-report is. I also need the sub-report to have a repeating header. Thanks.
Try to reduce the size:
-If possible supress group and report footers
-Right Click on each section you can and select "Fit Section"
-Change the color of some sections so you can see if any responsible for the extra page
-Maybe the paper is set to letter ? : Go Design - Page Setup, set A4 or you can also try no printer to see if something changes ( this last one will change the format of your fields so backup before)
If you have any footer sections that are not being used, try suppressing them. This will remove empty white space that is added at the end of the report. Another option is to adjust the size of your top and bottom margins, providing there are no design conflicts in doing so.
If you have any white space at the bottom of the sections that appear at the end of the report you could also reduce the height of that section to remove the white space.

How to remove white space between details sections which contain subreports in Crystal Reports

In my main report preview and exported PDF file of it as well I have a unused white space between details sections (the section with the grid starts from next page) as shown in the following image. Off course I want that white space to be removed.
I tried with unchecking the "Can Grow" and "Keep Together" in the sections which contains grid subreport (as well as in the subreport itself), but unfortunately I have no result. In case when I have for example 3 rows in the grid section, the section starts right under the chart section above, but in case when it must go to the next page, it makes that white space.
And to mention this, in both subereports in theirs sections, I have suppressed all the unnecessary sections, basically I am showing only the ones with the data.
Thanks.
I solved this. I checked "Can Grow", and deselect the Keep Object together in the subreport.
And now the grid works fine! Starts at the end on the graph, and continues on to the next page. Here is what I done:

Detail band longer than necessary in iReport

I have a detail band with text fields and a table. In the designer view I have fit all the band, but when I see the preview the lowest text field is higher than the first text field in the next band (i.e. I have empty space between band 1 and band 2).
The empty space is due by the table, in fact if I remove it I have no empty space. Below the designer view and preview.
The question is: how I can avoid the empty space between the bands? Thanks.
EDIT2: Now that the report is shown, it's clear. Make the table bigger in the report layout. Stretch it all the way to the bottom. When you don't, JR is careful to include as much space below it as you have left there.
EDIT: I think the key issue is that the band height should be "20" to match the height of the elements in it.
Old answer containing trivia that might or might not matter:
Some of your "text fields" are textFields. This is good. Some of your "text fields" are staticText. This is bad. Convert the static text to real text fields. You can right-click them and automatically transform them.
stretchType is bad. Turn that off. (Actually, it's good and useful... but it's not what you want.)
isStretchWithOverflow is good. Turn it on. Your text says that it's already on, but your code shows that it is not.
isPrintWhenDetailOverflows is bad. Turn it off. Your text makes no mention of it, but your code shows that it is on. (It's probably irrelevant... but you should turn it off to be clear that it's not what you think it is.)

How to control formatting and objects in empty filler space when "Keep Group Together" is used?

I have a report where I am using colored boxes to delineate columns. To accomplish this, I've run the boxes from the Group Header all the way down to the Report Footer. Crystal seems to enjoy making the boxes "bleed" up and down the page so that they seem to print wherever they want in the Header and Footer.
I got the idea to use other solid white boxes to control this and it works, except when Crystal adds more filler space when "Keep Group Together" is used. For example, when the next group won't fit so is moved to the next page. This space doesn't belong to any actual Report Section. Unfortunately, if I uncheck "Keep Group Together", I get other formatting problems so that's not an option. Any ideas of how I can get this formatting under control?
The solution seems to be to not span the colored columns into the Report Footer section. For some reason, they're fine when spanning groups and details, but as soon as it hits the RF it explodes.
Instead, I just created new colored column boxes and lined them up in the RF separately. It's behaving itself now.
Try marking your whiteout box Extend to Bottom of Section when Printing.
I'm guessing here: your column boxes are marked Extend to Bottom of Section when Printing, and they're getting extended, but your whiteout box is not.

Hide row (and remove whitespace placeholder) of tablix in Reporting Services 2008

I have a row in a tablex that I want to hide based on a condition. I can do this with the visibility property and also using CanShrink as well is an option.
I've tried both of these and the best I can do is hide the row (make it invisible), but it keeps the whitespace it takes up - I need to remove the whitespace too so if it is not shown that it doesn't take up paper/viewing space.
I have also made the height of the row very small and put cangrow=true so that that if i populate the field with data based on an expression it will grow to the right size but this is not ideal because there is still 0.03125in of space for the row that is always shown (minimim height) and if it grows it grows to fit the text but not neccessarily the set size I want.
I thought I had done this before in an older version of RS but I can't seem to get it to work correctly in this version (2008).
Any ideas?
Try to set the Hidden property of the Static Row Group under the Details Group, in this case the whole row will disappear instead of the content of the textboxes.
If you are using Report Builder, you need to switch to Advanced Mode (make sure that the Properties and the Grouping windows are displayed, go to the upper right side of the Grouping window and press the black triangle):
Click on the second "Static" item under the "(Details)" group and you can set the Hidden property on the Properties window.
Link to MSDN sample
A simpler way to get to this option for hiding a row is to right-click on the row header and select "Row Visibility". From there you will get a dialog where to can enter an expression.
I was able to make the rows go away by setting the following 2 properties
textbox.CanShrink
row.Hidden
I played w/ row.HideIfNoRows and it seems to have no effect in accomplishing the desired outcome described by op.
Click on textbox, these one is in the properties of the textbox
(if there are multiple columns, I assume you will have to make this setting for each cell/textbox, in my case, I only had 1 column)
CanShrink=false
For the next property, you have to go into ADVANCED MODE by clicking the down arrow at the right side of the Row Groups/Column Groups pane.
Click on the Row containing the line you would like to hide.
The Hidden property can be found in properties pane...
This is an alternate way to set Hidden, as opposed to right clicking the Row Header in the actual Tablix.
Hidden= <expression describing when you want the row hidden hidden>
One other note - If you right click the Row Header and choose 'Row Visibility' you get a dialgue. the Row Property dialog has a caption "Show or Hide Based on an expression".
The actual behaviour is It will HIDE the row if the expression evaluates to TRUE.
IMHO - this is misleading, at best ambiguous.
Once you understand the property you are actually setting is called HIDDEN, then this makes sense. Until then, I certainly assumed I was setting a property called Visisble... FWIW....
On the empty row you want to hide, go to the text box properties and go to expressions -> visibility, then show or hide based on an expression and use
=iif(first(Fields!.Value = ""),true,false)
Setting row visibility logic is important, but I've learned that sometimes a blank row will still appear, even though its contents are hidden. To solve this, I had to do the following non-intuitive steps, but I did in fact succeed in completely suppressing unwanted white space.
In the cell in the tablix region, use the Insert > Rectangle menu option.
In the rectangle, use the Insert > Textbox menu option. Resize as needed.
In the textbox, right-click and enter a placeholder.
Set the value of the placeholder expression to whatever you need.