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).
Related
I'm currently building a dashboard with flexdashboard and want to present one tab on my dashboard as showing the raw data organised into a data table using the datatable function in R.
When the dashboard generates, the rows have a huge height due to some large character entries in that string. E.g. certain ids in the format "xxxxxx-xxxx-xxxx-xxxxxx". It doesn't present them like this however, they are normally in the row presented as:
xxxxxx-
xxxx-
xxxx-
xxxxxx
creating the huge height.
A similar thing happens with date formats in the YYYY-MM-DD HH:MM:SS format
however the issue doesn't occur when using very long character strings without any "-" in it.
e.g. the column width will adjust properly for "xxxxxxxxxxxxxxxxxxxxxxx"
I had a look through stackoverflow and couldn't find anything similar, questions would mostly be around autoWidth not being set to true. And as mentioned column width adjusts automatically for certain types of character strings just not ones with "-" in it.
datatable(data1,
rownames=T,
filter ="top",
options=list(pageLength=100,
autoWidth=T,
scrollX=T))
You can disable the wrapping by using the class nowrap
DT::datatable(
class = "display nowrap",
extensions = c('Buttons','Scroller'),
...…
I am trying to modify the font color of a specific word in my values. What kind of expression could I write that would target this word and style the font to be red? I've heard of modifying the placeholder to accept HTML but I'm not sure this will help.
The value is made up from a case in the dataset that pulls from two tables that have gender so: "(consumer gender) | (caretaker gender)"
Possible values would be: Male | Male, Male | Female, Missing | Male, Missing | Female, Missing | Missing ….etc
What I'm trying to do is just target the "Missing" values and change the font color to red. Any way to do this? I've tried modifying the font color expression but only can figure out ways to modify the whole string as opposed to just that one word.
You can do this but it's a bit of a pain..
I used a quick dataset to demo the results built from the following SQL
DECLARE #t TABLE (textData varchar(20))
INSERT INTO #t VALUES
('Male | Male'), ('Male | Female'), ('Missing | Male'), ('Missing | Female'), ('Missing | Missing')
SELECT * FROM #t
The column we will use is just called textData
Start with an empty cell.
In the empty cell, double click to get a cursor, right-click inside the cell and choose "Create Placeholder"
Right-click the placeholder and set it's expression to somethign like...
=TRIM(LEFT(Fields!textData.Value, InStr(Fields!textData.Value, "|") -1))
This will get the text from the left side from the pipe symbol. Click OK to get back to designer. click just after the new placeholder and type the pipe symbol (with spaces if required).
Next right click after the pipe symbol and add another placeholder. This time we will use an expression to get the right side of the pipe symbol.
=TRIM(MID(Fields!textData.Value, InStr(Fields!textData.Value, "|")+1 ))
Now we've got the data displaying, select the first placeholder and set its color property to
=IIF(TRIM(LEFT(Fields!textData.Value, InStr(Fields!textData.Value, "|") -1)) = "Missing", "Red", Nothing)
repeat for the second placeholder this time using this expression.
=IIF(TRIM(MID(Fields!textData.Value, InStr(Fields!textData.Value, "|")+1 )) = "Missing", "Red", Nothing)
IN my simple design, the left column shows the original unaltered data from the dataset, the right column contains out two placeholders with colors.
The final output looks like this.
I am using below code to create a dropdownlist in Excel with "Yes,No" vallues displayed, but initially it is showing blank
worksheet.Range("I4:I5").Validation.Add(ValidationType.List, ValidationAlertStyle.Information, ValidationOperator.Default, "Yes,No", Nothing)
Initially I want default to set to "No", and the excel cell should be appear with arrow initially- which is not happening
Please help me out, how to do this using spreadsheet gear in VB.Net
THanks
Ramesh
Adding validation to a cell does not automatically populate that cell with a given value, nor does it select the cell (which would make the "arrow" appear, which I think is a reference to the dropdown handle?).
To make these additional things happen, you'll need to explicitly set the cell value via the IRange.Value property and select the desired cell via the IRange.Select() method. Example:
' Get reference to range affected.
Dim range = worksheet.Range("I4:I5")
' Apply validation.
range.Validation.Add(ValidationType.List, ValidationAlertStyle.Information,
ValidationOperator.Default, "Yes,No", Nothing)
' Set initial values of cells to "No".
range.Value = "No"
' Select the first cell in the affected range, I4. Calling select
' directly on "range" would select both I4 and I5.
range(0, 0).Select()
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.
How do I give row color and alternate row color for a Table in RDLC report? When I googled I found most of the result says something like = iif(RowNumber(Nothing) mod 2, "Red", "White") OK! But where should I place this stuff? Any help will be appreciated.
Very easy! :-)
In your report designer surface, you need to select the data row that contains your data - something like this:
When you look at the Properties box for that data row, you will see a property call BackgroundColor - open the dropdown, and you'll see all the usual colors - but also a menu item at the bottom called Expression...:
When you select that item, a dialog box will open that allows you to insert an expression to determine the background color for that row - that's where you need to put that expression that you have - and that's all there is!
If you don't want to add a RowNumber field to your dataset, just use the built in function RowNumber(ScopeName as String). I commonly use the name of the DataSet as parameter:
= IIF(RowNumber("CarsWithNoMakeDataSet") Mod 2 = 0, "LightGrey", "Transparent")
You can find this function at the Expression dialog, Category "Common Functions", Subcategory "Miscellaneous"
As the ScopeName parameter it is possible to use the name of a Group or Data Region. Please find more here.
Hope it helps,
The expression definition to alternate the row color is:
=iif(Fields!RowNumber.Value Mod 2 = 0,"LightGrey","White")
This sample assumes you have a field RowNumber in your dataset.
You can use group data region instead of dataset name.
Eg: = IIF(RowNumber("MonthOfYearId") Mod 2 = 0, "LightSteelBlue", "No Color")
Note that using dynamic expression can affect the time required to export a report. For a report with 5K of rows, the time increase may reach 2-3 minutes.
This is the expression I had to remove from one of my reports to make the export time acceptable:
=iif(RowNumber(Nothing) Mod 2, "White", "#e6eefc")