What widget(s) can be used for liquid and fixed columns with column span in Flutter? - flutter

I need to do the following:
Apple | 2 kg | button 1 | button 2 |
Orange | 1 kg | info |
Orange | 2 kg | info |
Pear | ? |
...
First column with names must be liquid, and other three column must be fixed size. I planned to use table, but as I found out colspan in tables is not supported currently. Could anyone say what widget(s) I should use for such a task?

Related

Flutter: Responsive Web - Multiple Listviews in a Column

I am working on a flutter web application and need to place multiple list views in a column.
I am trying to use responsive-framework. But it doesn't seem to work with my project. I tried Wrap widget. I doesn't work either.
What I want to do is moving around the list views based on the screen size.
Just one Column two Columns for wider screen
| 1 | | 1 | | 5 |
| 2 | | 2 | | 6 |
| 3 | => | 3 |
| 4 | | 4 |
| 5 |
| 6 |
This order of the list views should be exactly what I illustrated above.
Below is not what I need.
| 1 | | 2 |
| 3 | | 4 |
| 5 | | 6 |
| 7 |
Any tips??
Try GridView. There's a lot to it depending on your requirements for the Container Size. But GridView.builder with SliverGridDelegateWithMaxCrossAxisExtent (there are other variants).
You'll need to change the axis direction to horizontal in your case.

How to set height of all textboxes be equal size in an report? - Crystal Reports

I'm working on an existing report created using Crystal Reports.
In this report, a new column was added, but, the value of the column/row surpasses the default design of the report.
NOTE: The following example is in the "Details section" of the report
and is equivalent of the rows of a table.
Example:
____________________________
| Name | Worker type | // (Worker type) is the new column
|___________|________________|
| Item 1 | Text 1 | // Row 1
| Item 2 | Text 2 |
|___________| Text 3 |
| Item 3 | Text 4 |
| Item 4 |________________|
|___________| Text 2 | // Row 2 - might be bigger "height" than "Name" column.
| Item 5 | Text 1 |
| Item 6 | Text 2 |
|___________|________________|
The desired rendered result is:
____________________________
| Name | Worker type | // (Worker type) is the new column
|___________|________________|
| Item 1 | Text 1 | // Row 1
| Item 2 | Text 2 Text 3 |
|___________|________________|
| Item 3 | Text 4 | // Row 2
| Item 4 | |
|───────────|────────────────|
| Item 5 | Text 2 | // Row 3 - all rows / columns has appropiate design size.
| Item 5 | Text 1 |
| Item 6 | Text 2 |
|___________|________________|
I had tried:
Removing box objects: the original report uses them for set a black border on the "details section" - resulting in the example above.
By removing the box objects, I set the border of the data fields - or textboxes - directly. This leads to border lines didn't increase/expand to the next row.
Example of the modification made - described in the point # 2 - not consistent design:
____________________________
| Name | Worker type | // (Worker type) is the new column
|___________|________________|
| Item 1 | Text 1 | // Row 1
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Item 2 | Text 2 | // Row 2
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Text 3 | Text 3 | // Row 3
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Item 4 | |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Item 5 | Text 1 |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Item 6 | Text 2 |
|___________|________________|
Use the "Can Grow" option for each datafield - no results adjusting the size of the other columns to be the same as the "Worker type" new column.
Search on internet and here, in Stack Overflow: no results so far.
I don't know how to proceed for set the same size for all datafields/textboxes in the report.
Is there a way to set all files to have equal size in Crystal Reports?
After search deeper in both Google and in Stack Overflow (and honestly, after a weekend break), I found the solution:
In this answer says:
Do not use borders of text box to make cell borders, instead use lines
to create borders one horizontal line above the text boxes and one
below the text boxes. both lines having width long as the detail
section. and for vertical borders use vertical lines. that starts from
top of group header section and ends at bottom of detail section. now
when the height of cell increases when the content is large then all
the rows will be set accordingly.
This this in mind, I have to use the "Line Object" and draw the lines that divides the rows, then, by selecting the lines drawn and press "Format Multiple Objects", I marked/checked these two options on the Line - Format Editor window:
Extend to Bottom of section when Printing
Repeat on Horizontal Pages
I think the first one is the one who makes the "magic" - i.e, extending the line, but, just to be sure, the second option should be marked too.
After these changes, I did get the desired result:
____________________________
| Name | Worker type | // (Worker type) is the new column
|___________|________________|
| Item 1 | Text 1 | // Row 1
| Item 2 | Text 2 Text 3 |
|___________|________________|
| Item 3 | Text 4 | // Row 2
| Item 4 | |
|───────────|────────────────|
| Item 5 | Text 2 | // Row 3 - now all rows / columns has appropiate design size.
| Item 5 | Text 1 |
| Item 6 | Text 2 |
|___________|________________|

Cross tab with a list of values instead of summation

I want a Cross tab that lists field values and counts them instead of just giving a count for the summation. I know I could make this with groups but I cant list the values vertically that way. From my research I believe I have to use a Display String Formula.
SQL Field Data
-------------------------------------------------
| Play # | Formation |Back Set | R/P | PLAY |
-------------------------------------------------
| 1 | TREY | FG | R | TRUCK |
-------------------------------------------------
| 2 | T | FG | R | RHINO |
-------------------------------------------------
| 3 | D | FG | P | 5 STEP |
-------------------------------------------------
| 4 | D | FG | P | 5 STEP |
-------------------------------------------------
| 5 | K JET | NG | R | DOG |
-------------------------------------------------
Desired report structure:
-----------------------------------------------------------
| Backet & Formation | Run | Pass |
-----------------------------------------------------------
| NG K JET | BULLA 1 | |
| | HELL 3 | |
-----------------------------------------------------------
| FG D | | 5 STEP 2 |
-----------------------------------------------------------
| NG K JET | DOG | |
-----------------------------------------------------------
| FG T | RHINO | |
-----------------------------------------------------------
Don't see why a Crosstab is necessary for this - especially if the entire body of the report is just that table.
Group your records by Bracket and Formation - If that's not
something natively configured in your table, make a new Formula field
and group on that.
Drop the 3 relevant fields into whichever section you need to display. (It might be a Footer, based on whether or not you want repeats
Write a formula to determine whether or not Run or Pass are displayed, and place it in their suppression field. (Good luck getting a Crosstab to do that for you! It tends to prefer 0s over blanks.)
If there's more to the report than just this table, you can cheat the system by placing your "table" into a subreport. And of course you can stretch Line objects across the sections and it will stretch to form the table outlines

Splitting Values Between 2 Employees Possible Group By

We an incentive scheme that scored to staff via 'Points'. I have written an SP so that we can dynamically change these values day to day however I am struggling in my own head to figure the best way to split the values between two different agents.
The Setup
The source table simply looks like below:
Department | Policy |Opening Advisor | Closing Advisor | Agg Pts | Aff Pts | Rnl Pts |
Sales A | LYJX01PC01 | Sally | Sally | 0 | 3 | 0 |
Sales A | MUMP01TW01 | Sally | John | 0 | 0 | 3 |
This table is two separate tables, the first being the Opening Table and then the second being the Closing Table. These are joined by using the 'Branch' which is a column I've not put on here and then 'Policy' to keep it simple, Policy is what joins these 2 tables.
The Idea
The idea here is that the Points Per Policy are split 50/50 if the Opening Advisor and the Closing Advisor are different.
Line 1 the Opening and Closing Advisor is Sally, so for that policy she would receive all the points, however on Line 2 she opened the Policy however John closed it.
This would split the points out between them both i.e. 3/2 = 1.5. The output would then be similar to below:
The Output
Department | Policy | Advisor | Agg Pts | Aff Pts | Rnl Pts |
Sales A | LYJX01PC01 | Sally | 0 | 1.5 | 0 |
Sales A | LYJX01PC01 | John | 0 | 1.5 | 0 |
Sales A | MUMP01TW01 | Sally | 0 | 0 | 3 |
In my mind all I'm doing is GROUPING by Policy and Advisor and then splitting the points IF Opening / Closing Advisor differ, however putting that down in SQL I'm just turning circle and its one of those moments I need some exterior advice.

Crosstabs Crystal Reports Null value vs zero

I'm creating a crosstab report showing the survey history for gopher tortoises (if you must know what that is) monitoring stations. Not all stations are monitored for a given survey and sometimes when we monitor we don't find any and thus record a 0 which is a valid result.
In the crosstab when the station isn't used I would like it to say "N/A" or some other equivalent, but when it's a zero I want it to stay as zero.
I've found so much on how to change a null to a zero, but nothing when you want to keep the zero and somehow note the null.
Below is what the crosstab should look like. You'll see that the 0 in Station4 on 1/1/2004 is "real" (meaning we didn't find any) but all of the N/A's are when we didn't use the station.
Survey Dates
| | 1/1/2000 | 1/1/2002 | 1/1/2004 | 1/1/2006 |
|----------|----------|----------|----------|----------|
| Station1 | 9 | 5 | N/A | N/A |
| Station2 | 5 | 7 | 2 | 6 |
| Station3 | N/A | N/A | 6 | 9 |
| Station4 | 10 | 9 | 0 | 11 |
This is what the Oracle table look like for the 1/1/2000 survey as an example
| SurveyID | StationID | Number |
|----------|-----------|--------|
| 1 | 1 | 9 |
| 1 | 2 | 5 |
| 1 | 4 | 6 |
So, basically how to I keep the zero's and put some text in the nulls in a CR crosstab?
Thanks!
Because CR doesn't differentiate between nulls and actual zeros in the crosstab, you can try replacing actual zero values with a placeholder so you can tell the difference. Note that this solution will only work if you are trying to display the values and not do any aggregate calculations.
First, create a formula that will replace the zeros with a placeholder value. In this case, I'm using -1 since that number should never appear in the database.
//{#Survey Num}
local numbervar totalSurvey;
totalSurvey:={Table.ActiveBurrows} + {Table.InactiveBurrows};
if totalSurvey=0 then -1 else totalSurvey
Use this formula to create your crosstab. Now you need to set a display string so that everything appears correctly. Right-click one of your crosstab cells → hit "Format Field" → select the "Common" tab → then create a "Display String" formula. That formula should be something like:
if currentfieldvalue=-1 then "0" else if currentfieldvalue=0 then "N/A" else totext(currentfieldvalue,0,'')
Now you're basically just printing the real values over top of the placeholders.