How to remove blank row in Jasper reports - jasper-reports

This question is in continuation : How to hide textField in report generated in specified format?
depending on some conditions when all rows are blank how to remove those ?
in my case one column hiding because (print non repeated rows), and two columns are hidden becase of given condition (pdf.exclude) so now row is blank.
I want to remove this blank row. Can you suggest ?

I hope you must be using Textfield, and navigate to properties then select Textfiled tab and check blnk when null checkbox, If you want to remove the line itself from common tab tick remove line when blank.
that's about it

Related

How to add multiple lines in tab strip of sap UI5?

I am trying to add new or second line in tab-strip.
Once the space is exhausted in first line ,I want another line to display tabs.
Can I get a sample code?
Note : Tabs are generated dynamically on click of button.
The sap.m.IconTabBar only supports a single row of IconTabBarFilters and uses horizontal scroll when there is not room to display them all in one line.
In order to achieve your goal you need to define several IconTabBars and determine the number of IconTabBarFilters you want in each row. Once a IconTabBar is "full", add the next IconTabFilter to the next row's IconTabBar (and make it visible).

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

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.

Crystal Reports: Displaying a record if another record is null, and vice versa

I am building a subreport and have two tables from which I am using one field each containing a phone number.
Original Number {TABLE1.ORG}
Temporary Number {TABLE2.TEM}
What I want:
If {TABLE2.TEM} is not null, then hide {TABLE1.ORG}, else show {TABLE1.ORG}
I tried to use the above as a formula but it doesn't work too Since these both fields are from two different tables if place them next to each other (without any formulas or suppression) in the design mode:
{TABLE1.ORG} {TABLE2.TEM}
...I see them on different lines in preview mode:
+971 4 321321321
+971 4 123123123
Maybe because the formula reads records and evaluate from the same line, I guess this is the reason why above is not working correctly.
It's not obvious why the two fields are appearing on different lines in preview mode, but it's unlikely to be because they are from different tables - it's more likely to be because there isn't enough room in the layout for them both to display in one line, and so they are growing to a size that canb be displayed.
To conditionally suppress {TABLE1.ORG} based on whether the other field is not null:
right-click on {TABLE1.ORG} and select Format Field...
in the Common tab within the Format Editor dialog, click on the conditional suppress formula button x-2 and enter the formula not IsNull ({TABLE2.TEM}) in the Format Formula Editor.
click Save and close to exit from the Format Formula Editor, then click OK to exit the Format Editor dialog.
If you now preview the report, you should find that {TABLE1.ORG} is suppressed where {TABLE2.TEM} is not null.
Note that if you make display of both fields conditional on whether the other is null, then both will be suppressed where neither is null.

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.

How to handle variable width FieldObjects in Crystal Reports

I have a Crystal Report which is viewed via a CrystalReportViewer control on an .aspx page (using VS2008).
The report has two data-driven FieldObjects (which can contain a variable number of chars) which I would like to display on the same line beside each other.
Problem is when the text in the first FieldObject is too long it overlaps the text in the second FieldObject.
I have tried setting the 'CanGrow=True' and 'MaxNumberOfLines=1' on the first FieldObject to 'push' the second FieldObject further to the right, but this didn't work.
How do I get the second FieldObject to always display immediately after the first FieldObject regardless of the length of the text in the first?
Cheers in advance of any knowledge you can drop.
you can add a text object to the report. And while editing the text of the text object, drag the field you want to show from the object explorer into the text box. Then hit space, then drag the second field in to the same text box. Your two fields will always be one space a part. You could, of course, add more spaces or any other text you want.
Or you can create a function which returns field1 + " " + field2 and add the function to the report.