I have a crystal report with several columns.i need to hide a column and remove the blank space based on a condition.currently what i have done is.i have dragged and dropped the fields inside TextObject and tick the "Suppress Embedded Blank Field Lines" and "Can Grow".it'll hide the detail field and also remove the blank space but the issue is header is still visible.
condition to hide a column is if the field data is null or empty
Try creating a formula for your conditionally displaying column heading. Something like:
SomeFieldLabel:
If DistinctCount({#SomeField}) > 0 Then "The Column Label"
or
If Not IsNull({#SomeField}) And {#SomeField} <> "" Then "The Column Label"
Then create a text object with {#SomeFieldLabel} and all your other labels, and select Suppress Embedded Blank Field Lines.
You may need to experiment to find the right condition – one which evaluates to True whenever the field is present in your detail records, and False the rest of the time.
Related
I am using the XRRichText.visible=off if there is no data, but still it throwing some spaces in report. I do not want those spaces if there is no data.
Just want to display none & no spaces . How can I do this?
The upper spaces are just XRRichText.
Set the property ProcessNullValues for the labels with the issue as ‘Suppress and Shrink’.
The purpose of this property value is: If a control receives a null value, it is not printed (without adding blank space in its place).
The property has two more values:
Leave – A control is always printed.
Suppress - If a control receives a null value, a blank space is printed instead.
As shown in the images below sometimes the rows are truncated/split beteween two pages of my report.
Is there any property I can set on DevExpress XtraReport to avoid it?
Details:
The DetailBand contains 3 fields and is inside a subreport (it's a 2 columns/subreport).
The subreport is printed inside a GroupHeader in the MainReport.
The truncated text reads (in 3 columns):
343
HONORÁRIOS - FREE LANCERS
R$ 2.126,42
Happened I found the issue.
My databands all have the flag KeepTogether set to true but labels also have that flag (default false).
I flipped the flag to true in all labels in the report and it worked
How can I get text rendered in the cells? I have tried the following :
[1] $(gridId).jqxGrid('getcellvaluebyid', rowID, columnFields[j])
[2] $(gridId).jqxGrid('getcelltextbyid', rowID, columnFields[j])
However, I only get the actual values of the cells like flags and status codes instead of the actual flag names and status names rendered on the specific cell (using cells renderer).
Please help.
Have you tried by creating an Array variable and caching the cellsrenderer result using that Array. After that you can access the rendered cell content using your Array and your array keys.
Before running my report, I give the user options to choose which Columns they would like to see.
I then hide columns by reading and setting boolean parameter for "Column Visibility"
I am able to hide static columns using an expression for "Column Visibility" (Fig 2) as follows:
= iif(Parameters!MinorVisibility.Value = "true", false,true)
When I try to hide my Group Columns, "Column Visibility" is disabled as seen in Fig 1. I tried manually setting each cell's visibility property but then I am left with a blank column as seen in Fig 3.
I think your solution is to remove this column and re-add it as regular column inside group (to the left of your Date column).
I am dynamically adding columns to a crystal reports data source as explained here Dynamic_Reports.
Here i need remove columns whenever i am not filling values to depends upon columns. These columns are i need to remove from a crystal reports at run time.
Why i need like this means,I have 20 columns and going fill 1st ,2nd ,19th and 20th columns Only.Rest of them having blank space.blank space[columns] are need to remove.
Include a formula checking null value for the particular column and if null dont insert. These you can check after filling in the database.
EDIT:
example:
If !IsNull({Product.Color}) Or InStr({Product.Color}, " ") != 0 Then
totext({Table.Column})
You can drag the required column for which you suspect it will be blank in to the ( ) of IsNull or InStr