How to create a form with repeated rows in a grid with Orbeon? - web-services

Is it possible to have repeating data in a grid with lots of fields in a table-like format, i.e. with several columns on each row, and a totals row that calculates the sum? If not, are there any other solution?

Yes, this is possible. And I think you'll find the information you need on how to do this in this blog post: Spreadsheet-like forms. I could copy part of the post here, but think you're better of reading the whole thing.

Related

Google Sheets Array formula for counting the number of values in each column

I'm trying to create an array formula to auto-populate the total count of values for each column as columns are added.
I've tried doing this using a combination of count and indirect, as well as tried my hand at query, but I can't seem to get it to show unique value counts for each column.
This is my first time attempting to use query, and at first it seemed possible from reading through the documentation on the query language, but I haven't been able to figure it out.
Here's the shared document: https://docs.google.com/spreadsheets/d/15VwsL7uTsORLqBDrnT3VdwAWlXLh-JgoJVbz7wkoMAo/edit?usp=sharing
I know I can do this by writing a custom function in apps script, but I'd like to use the built-in functions if I can for performance reasons (there is going to be a lot of data), and I want quick refresh rates.
try:
=ARRAYFORMULA(IF(B5:5="",,TRANSPOSE(MMULT(TRANSPOSE(N(B6:99<>"")), SIGN(ROW(B6:99))))))
In B3 try
=ArrayFormula(IF(LEN(B5:5), COUNTIF(IF(B6:21<>"", COLUMN(B6:21)), COLUMN(B6:21)),))

How to add an array to a column of CSV file using Python?

I have stored a set of four numbers in an array which I want to add to a CSV file under the 'Score' column. Could anyone please help me with this.
You can't do that. One solution would be to place Score at the end. The only quick 'solution' I think is to 'model' your data like this:
game_id, score_1 {,..., score_n}
So you don't have to care about scores' array size, since all the next values after game_id will be scores.
(Note that this is a quick fix example for your problem. I dont know your data model and probably you will have to modify things, but you've my approach)
Also when your data model becomes harder, it's not good idea to work with files. Consider storing your data into a database like SQLite or whatever.

Looking for a spreadsheet (or table) view for django

Pardon the dumb question, but where can I find a view for Django to display "tables" in a spreadsheet-like format (i.e. one record per row, one field per column).
(The fact that I have not been able to find one after some searching tells me that maybe my noob-level understanding of Django views is way off-base.)
Here I'm intending the term "table" fairly generically; basically, think of a table as an "list of lists", with the additional constraint that all the internal lists have the same length.
(It would be great if this table had spreadsheet features, such as the possibility of sorting the rows by clicking on the column headers, or of cutting and pasting arbitrary rectangular subsets of the cells, but I realize that this may be hoping for too much.)
An other way to do it is to use tabular inlines but a list view is what you are looking for.

Table cell stretching

I have two columns in my table with equal width (50%, 50%).
I am showing search results URL in them. For big urls the columns are stretching and destroying the layout.
Any suggestion to the problem?
SEE How to wrap long lines without spaces in HTML?
These may help too:
Best word wrap algorithm?
Word-wrap in an HTML table
You can set text-overflow:ellipsis; described here and/or use jQuery ellipsis plugin.

QTreeView - Sort and Filter a model

I am trying to create a QTreeView which displays some sorted information. To do this I use a QSortFilterProxyModel between the view and my model.
The problem is that I want to limit the number of rows to the first n rows (after sorting). The filter function from the model receives the original sourceRow so I cannot use it.
I've tried chaining two QSortFilterProxyModel: the first for the sorting and the second for the filtering. But it seems that the second proxymodel(filtering) doesn't receive the rows sorted....
Is there another way to do it?
Has anyone use this technique(chaining of 2 proxy models) and it works?
thank you
EDIT:
I've tried with the rowCount and it doesn't work.
I've also tried to chain 2 proxy models but the problem is that the view calls the sort function for the model it receives. So if the first proxy sorts and the second filters the sort will be called on the filter model and the data won't be sorted.
EDIT2: I've looked into the qt source code and the filtering is done before sorting, so in the filterAcceptsRow() I don't know any sorting order.
Just out of curiousity, have you tried overriding the rowCount method and just return 25 (or whatever n is in your case)? It might be as simple as that... well, if you'll always have at least n items.
Otherwise, you could try chaining the models. I don't know why it wouldn't work, but I've never tried something like it myself.
After trying a number of overcomplicated ways to solve this I've done a small hack for my problem: after I insert/remove a row I call setRowHidden to hide the first n rows.
This is not the most elegant solution and is particular for my needs, but I am unable to find a better alternative.
I like to mention that on gtk, because the filter and the sort proxy models are separated, this can be done fairly easy.
I'm still hoping someone can provide a better solution to this.