How Can I do not display the XRRichText ,if there is no data? - asp.net

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.

Related

How to increase row height in vaadin grid accordingly to data in the cell

I am consuming data from the list and some list may contain multiple line data, so how that can be reflected in the vaadin grid at runtime.
This is the code
public Grid GridBasic() {
grid.removeAllColumns();
grid.addColumn(TopicConsumedDetails::getPartitionNumber).setHeader("PARTITION ");
grid.addColumn(TopicConsumedDetails::getOffset).setHeader("OFFSET");
grid.addColumn(TopicConsumedDetails::getMessage).setHeader("MESSAGE");
grid.setItems(details);
grid.addThemeVariants(GridVariant.LUMO_WRAP_CELL_CONTENT);
grid.getColumns().forEach( col -> col.setAutoWidth(true));
return grid;
}
This just displays all the data in a single line and it requires scrolling left to right.
Vaadin Version :23.3.1
Use the built-in "wrap cell content" variant: https://vaadin.com/docs/latest/components/grid/#wrap-cell-content
grid.addThemeVariants(GridVariant.LUMO_WRAP_CELL_CONTENT);
As per the previous answer, I think that using this is the correct approach:
grid.addThemeVariants(GridVariant.LUMO_WRAP_CELL_CONTENT);
However, you are overriding this setting by calling
grid.getColumns().forEach( col -> col.setAutoWidth(true));
According to the documentation, this automatically sets the column width based on the contents, leading to the right scroll problem.
If you remove this call, you should get the proper wrapping behavior. I was able to reproduce the problem and then see a result like this once I removed the auto width setting:
Alternatively, if you have sensible line breaks in the content you want to wrap, you can do that--but it won't happen automatically, as mentioned by #Rolf in a comment above. That is because the line breaks in the text are basically just whitespace and aren't respected as such by the HTML. So in order to do that, one option is to add an "Html" component column. You can then replace your text's line breaks with <br/> tags, which you could do with a regular expression. It would look like this:
String myColumnText = colText.replaceAll(....); //Some regex to match on your particular line breaks
grid.addComponentColumn(item -> new Html("<p>" + myColumnText +"</p>");
The <p> tags (or some wrapper tags) are required as the Html component requires a wrapper tag.
Note that (1) using this approach means that you won't get the automatic wrapping behavior any more so the line breaks in your source need to be sensible and (2) you have to be certain you trust the incoming content or it is otherwise sanitized, as this kind of rendering-text-as-html opens up some security holes with untrusted content.

Can't get toupper to work

I want to transform the contents of a factor column in a dataframe from lowercase to upper case. The function toupper(dataframe$columnname) prints the contents in uppercase, but nothing actually seems to happen to the contents. When I check using levels(dataframe$columnname) or just visually inspecting the dataframe, the contents are still in lowercase. What I am doing wrong?
To change your data.taframe's content you must alter the columns values
dataframe$columnname <- toupper(dataframe$columnname)
Although, if you want to play with characters, do it like
dataframe$columnname <- toupper(as.character(dataframe$columnname))

Multiple Wrapping on Single Space with MigraDoc

I have a table with a cell which contains a textframe which contains a table. In some of the cells inside the inside table, I have added a paragraph. Inside the paragraph I have placed text, via the addtext method, like "WordA WordB". The cell's size will cause a line break between "WordA" and "WordB".
The problem is that I am expecting:
WordA
WordB
What I am getting is:
WordA
WordB
Is there a setting somewhere to get what I expect or is this a bug in the renderer?
I think it's a bug - a bug that typically shows when words are longer than the column width allows.
For typical scenarios (short words in wide columns) this problem will not show up. With long words in narrow columns you sometimes get this bug. Hyphens or soft hyphens in long words will allow MigraDoc to break the words correctly.
It was a bug in the paragraph rederer (ParagraphRenderer.cs). There were actually 2 bugs I found. The first is if the current line doesn't fit and the next "Text" is a blank (" "). The second is if the current line is a blank (" ") and the next line doesn't fit.
The first bug was easy to fix, I changed the HandleNonFittingLine subroutine to keep advancing until it this.currentLeaf is not a blank (" ").
The second bug was harder to figure out and fix. I had to get the Format function to find the next leaf and pass the Current property, of the Next Leaf, to the FormatElement (if the next leaf exists). I then had to modify the FormatElement function to optionally take a second parameter. Then I modified the FormatElement function by returning FormatResult.Ignore if the current leaf is a blank (" ") and the next leaf doesn't fit on the current line with the blank (" ").

Update float data type field with blank spaces in sql

A blank space will be treated as 0 if using float:
for eg:
declare #f float
set #f = ''
print #f
I tried using blank spaces in the columns using update statement, the output will be 0.
But i want to save blank space and retrieve blackspace for field value.
How to possible this.
I am using to update table value from xml file,i am getting balnk value from xml file,but i save this,it will be saved like zero,but i wnat to save this as blank
I need to allow blank space for an decimal parameter how can we do that ?
In order to store a blank like you require in a float column, you need to make it nullable and save null value into this column.
Empty string ('') can only be saved into varchar, text and similar text columns.

Crystal Reports Hiding Columns

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.

Resources