QML GridLayout fill doesn't work with span - qml

(QtQuick 2.12 on Windows)
I'm having two related problems with GridLayout objects, both revolving around the use of Layout.fillWidth and Layout.fillHeight to get constant sized cells that their contents can anchor themselves to. I believe they also apply to RowLayout and ColumnLayout.
First, some of my children use Layout.columnSpan or Layout.rowSpan. But when I do this, even though the extra columns or rows are "occupied", the fillWidth or fillHeight doesn't seem to apply to the extra columns or rows. If this is W.A.D, I can't imagine why anyone would D. it this way--it looks like a bug to me. My "solution" is to create dummy items that force the other columns or rows to be filled. But this isn't without its problems. For instance, if I have a GridLayout with five columns, and I want to attach a child that is five columns wide (say as a title in the top row), and some of the columns are otherwise unoccupied, I can create a dummy Item with its Layout properties set to occupy those columns. But if I can't find a row in which there isn't something already spanning those columns, then the item clashes with one of the real items I want to display. This "works", but it produces an error message in the log, e.g., QGridLayoutEngine::addItem: Cell (0, 4) already taken.
BTW, I've found that I only need to insert enough dummy single-cell items to define all the grid boundaries. In the above example, I'd need a dummy in columns 1 and 3, because that's enough to define boundaries 0-1, 1-2, 2-3, and 3-4:
0 1 2 3 4
+---------------------------------------+
| colSpan = 5 |
+-------+-------+-------+-------+-------+
| dummy | | dummy |
+-------+ +-------+
Second, I specify a spacing on the GridLayout, but sometimes I want a double-wide gap, so I treat that as just another row or column that has nothing in it, and that should therefore have a zero height or width. But when I do that, I don't get the extra spacing--it acts as if the row or column just doesn't exist. Again, W.A.D.? But why? My "solution" is to place a dummy Item into the empty row with its Layout.fillWidth set, but obviously not Layout.fillHeight (or the opposite for an empty column).
These are pretty ugly hacks, they junk up the source code, and they're error-prone. Does anyone have any better ideas on how to do either of these things? Does anyone think they could be called bugs?

Related

Expression chart colors depending on the dimension for no selected values

I was planning to do a Straight Table chart like this:
The four dimensions should always appear and have exactly the same colors (the only variation is the expression values).
What I have now is the dimensions and the values as I want except for the colors. The initial data is organized in a table like:
Project Status
1 Completed
2 On Track
3 On Track
4 Deviating
So the #RA variation is the percentage of each status value from the total. However, it can happen that in some cases one status value is 0. And I get this:
The condition for the colors is set in the color background expression, like this:
I also have to say that as some fields of the dimension have no values they disapear, so they are forced to appear using the Show All Values in the dimension tab.
Any one knows how to make the colors always fixed for its dimension even when the value is null?
Thanks for the attention

Custom UICollectionViewLayout With Equal Inter-Item Spacing

I'm having a difficult time figuring out how to designing what feels like it should be a fairly straightforward layout for my collection view. The heights of each cell are equal. The widths vary. The inter-item spacing should always be equal. The distance between rows should also always be equal. As more items are added, the width of the collection view will increase "intelligently." Let me give an example.
When I insert a new item, I will calculate the movement of items from rows (maybe the first item of row 1 moves up to row 0, maybe the first item of row 2 moves up to row 1. I then move it and the collection view grows wider.
I feel like this should be reasonably straightforward but I'm struggling.
Does anyone have some sample code that could help?
Have you tried this using UICollectionViewFlowLayout?
http://skeuo.com/uicollectionview-custom-layout-tutorial
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionViewFlowLayout_class/

How to keep Reporting services table in the same page

Is it possible to keep table column within the same page? It always go to the new page when table width is larger than page.
I design a report with TableA that have dynamic columns. The dynamic columns are in short format. For example: BS, BN, OT...
In order to understand column meaning, I have to create another table, TableB, below the table to explain. I want to display it horizontally. For example: BS: Basic Salary| BN: Bonus| OT: Over Time| ...
But when TableB has many columns, It go to new page and leave a lot of blank space in previous page. I want to keep columns in the same page, if possible.
I want TableB to display like this:
|X:xx| X:xx | X:xx| X:xx| (Edge of right page)
|X:xx| X:xx|
You're using a horizontal table, a great tutorial is described here
You probably have most of the horizontal table figured out, just this part is important to your issue.
Step 4
Right-click on the column header and select "Edit Group". Enter this
for the group expression: =RowNumber(Nothing). This will cause the
matrix to give you one column per row of data. Since horizontal tables
can end up rather wide, you probably want your table wrap around to
the next "line" after a specific number of columns.
Just simply count the number of rows that fit your page exactly and define this number in your column group expression as described in the tutorial.
Use Column Visibility to hide column instead of Cell Visibility. This should eliminate the blank space.
If the report is still too big, set the report interactive size to 0in,0in. This will keep everything in one page.

Union of multiple columns as one column

Could you please advise what would be the best way to create a union column for 12 separate columns (located in 12 different Excel sheets within a workbook) with or without VBA?
There are good manuals how to do it for two columns without VBA (using MATCH function) however I am not sure how to approach the case with multiple columns.
I think can be achieved with multiple consolidation ranges for a PivotTable. Would need labels for the columns and more than one column per sheet (could clone the existing ones). Should sort and remove duplicates from the list automatically (if cloned).
EDIT:
I'll assume your IDs are all numeric (otherwise, sorting would be very tricky if not impossible without VBA). You could modify the following array formula to meet your needs (select an area with enough rows to hold the full stack of IDs, enter the formula, then commit the formula with ctrl+shift+enter):
=SMALL(IFERROR(CHOOSE(COLUMN(INDIRECT("C1:C12",FALSE)),Sheet1!A1:A73,Sheet2!A1:A70,Sheet3!A1:A79,Sheet4!A1:A58,Sheet5!A1:A51,Sheet6!A1:A94,Sheet7!A1:A50,Sheet8!A1:A89,Sheet9!A1:A75,Sheet10!A1:A89,Sheet11!A1:A70,Sheet12!A1:A94),FALSE),ROW(INDIRECT("1:"&COUNT(Sheet1!A1:A73,Sheet2!A1:A70,Sheet3!A1:A79,Sheet4!A1:A58,Sheet5!A1:A51,Sheet6!A1:A94,Sheet7!A1:A50,Sheet8!A1:A89,Sheet9!A1:A75,Sheet10!A1:A89,Sheet11!A1:A70,Sheet12!A1:A94))))
I'll use a smaller version (2 columns) to explain how it works:
=SMALL(IFERROR(CHOOSE(COLUMN(A1:B1),A1:A73,C1:C70),FALSE),ROW(1:143))
First, COLUMN(A1:B1) returns a horizontal array of integers between 1 and 2. Passing this to the CHOOSE function with the two single-column ranges creates a single 73 x 2 array from both A1:A73 and C1:C70 (instead of creating a jagged array, the last three values of the second column will be filled in with #NA).
Wrap the result with IFERROR to convert the three #NA values to FALSE (otherwise, SMALL will return an error).
Next, ROW(1:143) returns a vertical array of integers between 1 and 143. Passing the 73 x 2 array and the array of integers between 1 and 143 to SMALL will return a single 143 x 1 array (vertical) of the sorted values (the three FALSE values are ignored).
Note on INDIRECT: Using INDIRECT in this way makes the formula stable even if rows/columns are deleted; however, it also makes the formula volatile, which will cause it to be recalculated every time there is a change in the workbook, which could slow things down considerably. Another option is INDEX (e.g., ROW(A1:INDEX(A:A,COUNT(...))), which can be affected by row/column deletions, but isn't volatile.
if you don't mind a bit of manual effort, this works for numeric and non numeric IDs:
Stack columns on top of each other manually using Ctrl-C + Ctrl-V
Go to Data tab --> Filter --> Advanced Filter --> tick unique records only --> choose your copy to location
This simple two step process would then give you unique union of two columns. Obviously the higher the number of columns, the more the utility of a VBA approach.

SSRS - Producing a report that is not dynamic in size

I want to build a report that is completely static in size and shape. I'm attempting to mimic a hand-entered report that someone in my organization has been building from a word doc for years.
The critical piece appears to be fixing the number of rows that are produced in the various Table grids that fill the page. I would like them to always contain a set number of rows, whether data is present or not. It would seem that if I can just fix the size my tables, then all the other elements will not be forced to move because of stretching repeater sections.
All my grids are backed by stored procedures, so I'm open to SQL tricks as well.
Sorry i did miss-read the question.
If you know how many rows you need to return (say 20) maybe you could pad some bogus info into your records returned from the stored procedure. You might be able to count the records your query has returned before you send them back, and if you have less than 20 add some bogus ones to the record set, put something like 'NonDisp' or something in them.
Then in the report put an iif statement into the cells that checks for this bogus info, if it is found change the cell to display nothing, otherwise show the valid values
Not a direct answer, but perhaps a workaround you might consider: perhaps you can insert a page break after the table grids that have dynamic sizes, so that all elements that follow it have a fixed position (relative to the top of the page).
Add a parent group to tablix with =Ceiling((RowNumber(Nothing)) / 10000) expression. (10000 or whatever is required no. of rows)
In page break properties of group, check box for insert break between groups, leave the bottom boxes un-checked.
Optionally, we may chose to set hidden property true for text boxes added because of new parent group.
In tablix properties, check box for "Keep together on one page".