vaadin grid inline number format - grid

I am using
NumberFormat format = DecimalFormat.getNumberInstance(Locale.GERMAN);
format.setGroupingUsed(true);
NumberRenderer numPointCommaRenderer = new NumberRenderer(format);
pnGrid.getColumn("amount").setRenderer(numPointCommaRenderer);
in order to display in a vaadin grid the number "1.234,56" but when i enter in the inline mode the number is changing with the default locale "1,234.56".
I don't want to change the default locale (English) also i don't to alter the locale of the grid.
only to alter the inline edit of the number to "1,234.56".
Any suggestions
Elias

Related

Is there a way to update the css selector within the shiny screenshotButton as there's choices selected in pickerInput?

I'm using shiny library(shinyscreenshot). I have a datatable within a tabBox and would like the user to be able to download a screenshot of the datatable with a specific div id that changes based on the pickerInput. I've noticed, after I select choices in the pickerInput, the new datatable rendered has a different div id. The different div's for the datatables are as follows: #DataTables_Table_0, #DataTables_Table_1, #DataTables_Table_2, #DataTables_Table_3, etc.
Is there a way I can still use "screenshotButton()" and be able to update the selector to be whatever selector matches the string?
I ran into this issue when I used the following code and nothing downloaded after the first download:
screenshotButton(filename = "TEST.png",label = "Download",download = TRUE, scale =3, selector = "#DataTables_Table_0")
I thought about using an attribute selector similar to:
[attribute~="value"]
where my code would look something like this to capture a specific string match within the selector but no luck.
screenshotButton(filename = "TEST.png",label = "Download",download = TRUE, scale =3, [id~="DataTables_Table_"])
Also, I used the id = "#table" which produces a valid download but I would like to stick with the #DataTables_Table id as this would allow for a png which shows the datatable in the most compact, cropped format without any extra filters or tabs showing within the screenshot.
Thank you in advance.
You were very close! you can use the *= operator to aim for attribute that begins with selector:
selector = "[id*='DataTables_Table_']"

How can I show the data with comma(,) in drop down box on window?

I have written the program to show all the data on window but stuck in the case for showi a single record with comma(,) in drop down box. Let me share codes what i tried.
DEFINE TEMP-TABLE tt_seq_report
FIELD npai_output_expression AS CHARACTER FORMAT "X(50)".
/* Followings are written inside the drop down box using progress app builder */
/* ON VALUE CHANGED OF coCombo-4 Part Type(Label Name) */
DO:
DEFINE VARIABLE cPartTyp AS CHARACTER NO-UNDO.
CREATE tt_seq_report.
ASSIGN
tt_seq_report.npai_attribute_expression = "22+++,56-".
coCombo-4:ADD-LAST(tt_seq_report.npai_attribute_expression).
END.
When I run the window and select the drop down box then i can see the value upto before comma(,) i.e 22+++ but it should show the full value like 22+++,56-. May I get any help regarding this?
You can set the combo-box'es DELIMITER property to any other character. Comma is just a default.
"Delimiter character can have any ASCII value from 1 to 127. The default delimiter is a comma."

how to split and change the font style of a crystal report element?

we are having a report generated using crystal report While generating we have a request to have a checkbox with a list of items.
The checkbox is only available in the Wingdings font.
Since we are using Arial font for the list items we can not change the font of the formula field through which we are showing the list.
Eg:
[] task1
[x] task2
we need to split each list item and replace the square brackets with checkbox form the wingdings font.
how can we create a formula for this in crystal report?
I found a way
Create a formula with this code:
stringvar MYARRAY:= Replace ({Notes1},"[]" , '< font face = "wingdings" >'&chr(254)&'< /font>');
stringVar MYARRAY1 := ' '+Replace (MYARRAY,"|" ,' < br> );
MYARRAY1;
Drag and drop this field on the report > right-click the field > Format Field > Paragraph tab > Under "Text Interpretation" select "HTML Text".
Without using HTML or RTF Text interpretation, Crystal Reports can't display two fonts in one formula field, but it is possible with a Text Object.
Create two formulas, one with the checkmark and one with the item-text.
Drag & drop the formula-fields into an empty text object.
Now you can format the two formula fields independently of each other but inside the same field.

How i can show default values of each column in ERD that generated by powerdesiner

I want to show default value of each column in my ERD.How I can do that ?
I don't see something about it in content tab in symbol format windows. Only in preview tab in table properties, I can see default values for columns in generated SQL. the Power designer version is 16.6.
You can modify the attributes displayed for columns under Tools > Display Preferences > Table > Advanced > Columns > List columns:
Use Select > (Select Attributes) Default Value to add the default value.
This list of attributes does not provide long text attribute, like Description. For these, you might be able to work a solution using calculated attributes.

showing numbers in qtablewidgetitem with comma and while using the sortingenabled of qtablewidget

I want to show large numbers separated by comma e.g. 123,000 not as 123000 but doing this i have to make it into a string on which the sorting is not working as desired.
Yes you have to convert it to a string. Use locale in order to display numbers based on user settings.
this->locale()->toString(value);
It's a bit easier if you move to a QTableView and QStandardItemModel, rather than a QTableWidget - don't know if this is suitable for you.
Then you can specify a SortRole which is distinct from the DisplayRole. Like this (hope the Python is readable - I use PySide)
tableView = QtGui.QTableView(self)
tableView.setSortingEnabled(True)
model = QtGui.QStandardItemModel(3,2,self)
model.setSortRole(QtCore.Qt.UserRole)
for r in range(3):
for c in range(2):
item = QtGui.QStandardItem(["1,000","200","100"][r])
item.setData(QtCore.Qt.UserRole,[1000,200,100][r])
model.setItem(r,c,item)
tableView.setModel(model)
Try commenting out the setSortRole line to see the two behaviours.

Resources