Grid with grouped headers/columns (super headers) - wpf

I would like to achieve something like:
Day 1 | Day 2
--------------------------------------| -------------------------------------
Location 1 | Location 2 | Location 3 | Location 1 | Location 2 | Location 3
---------- | ---------- | ----------- | ---------- | ---------- | -----------
| | | | |
-----------------------------------------------------------------------------
| | | | |
-----------------------------------------------------------------------------
| | | | |
-----------------------------------------------------------------------------
| | | | |
-----------------------------------------------------------------------------
I need to display a list of appointments/events for specific days but grouped by locations.
I want to display days and locations even when there are no events (just empty grid so I can add my own events there).
I'm planning on using DataGrid or ListBox/ListView. Is it a good idea or I should create those headers some other way? Could you point me in the right direction?
This question is just about displaying empty grid(multiple listviews or datagrid with headers generated from list of locations and list of dates):
public IObservableCollection<DateTime> DaysToDisplay { get; set; }
public IObservableCollection<string> LocationsToDisplay { get; set; }

I'm a bit confused by your edit saying:
"This question is just about displaying empty grid (generated from list of locations and list of dates)"
Because that directly contradicts:
"I need to display a list of appointments/events for specific days"
But you keep on editing your question and one of those can't be true.
WPF datagrid is best for editing, if that's what you mean by "add my own events there". Although editing directly in a datagrid introduces a lot of edge cases if you are going to validate.
The datagrid doesn't support grouped headers like that.
All solutions you could adopt come with some limitations.
One would be to make the Days template columns. You then line up your 3 locations inside them in the one template.
One way of building these repeated columns dynamically:
https://gallery.technet.microsoft.com/WPF-Dynamic-XAML-Awkward-41b0689f
Another option is 2 datagrids.
The top one only has headers - these being the Days.
The main datagrid is below that and in the same grid, the locations are columns in that.
This works best if the user can't do things like resize and re-order columns.
Re-sizing can be handled by binding the width of the day columns using a converter adds up the width of the corresponding day columns.
An example:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/1e414159-70f6-4be3-9be5-56e4f3278366/wpf-multicolumn-super-header?forum=wpf

Related

Pulling ill-formatted data in Libre Calc: What Function will work with this?

I am working on a project where I am pulling tables from a Fandom Wikia page and feeding it into a spreadsheet named 'WikiPullSheet'. The data in the wiki tables is irregular in format; sometimes using multiple rows for the same entry.
Here is an example of some rows as described above from the sheet:
Name | Power | Stamina | Agility
Townsman Shield | 2 | 1 | 2
Starter | | |
Broken Shield | 4(+1) | 2(+1) | 2(+1)
Z1 | | |
Heater | 2(+1) | 4(+1) | 2(+1)
Z1 | | |
Wood Elf Shield | 2(+1) | 2(+1) | 4(+1)
Z1 | | |
Shiv | 4 | 4 | 3
Z1 Shop | | |
Deimos* | 26 | 16 | 26
| 34 | 22 | 34
I want the sheet to auto-update from the wikia page but this format will not allow me to reference items as the sheet expands. For instance, if on another sheet I want to have a drop down list of all the names for items in this list, I would be referencing the blank and starter cells even though they are not actually unique items in the table. I have done research on VLOOKUP, COUNTIF, REGEX options, MATCH, and more, but none of these seem to work for the issue I am having.
How would I take this input and either create a formula to reformat it or pull from the sheet as is and use the columns appropriately for a drop-down box containing only the item names from the NAME column?
Desired Output:
I need the data to end up formatted with each row representing a different unique item. Since the information is pulling with rows that contain location of the item in the name column (Z1 for instance), this is proving difficult. I could simply remove the rows that cause problems such as 'Z1' & 'Z1 Shop' in the above example, however this does not help when an item has multiple upgrade paths like in the case of the 'Deimos' row entry.
If you insert a pivot table (there is a icon to do so, select ColumnA first) based on ColumnA (assuming that is where Name is to be found) you should get something like:
It is far from a complete solution (you don't show what the desired output should be) but I thought a sorted list, with each entry unique and the blanks at least out of the way, might have been a start.

How to add a break-out aggregate row group in SSRS

I know virtually nothing about SSRS, so forgive me if I'm using the wrong vocab.
The group I'm working for has a list of volunteer opportunities. Each opportunity has a specified number of volunteers needed. The database keeps track of people who have volunteered, for which opportunity they volunteered, and the status of their volunteering: whether they've just signed up and need to be contacted, whether they're somewhere in the process of becoming a volunteer, whether they are volunteering, or whether they've quit volunteering.
Certain volunteer opportunities (i.e. those requiring contact with children and therefore requiring a background check), have more volunteer states than the rest of the opportunities. For these opportunities there are a total of 14 states, compared to 3 or 4 for the rest.
I need to create a report that displays the counts of people in each state for each opportunity. It's unreasonable for there to be 15 columns (14 + the volunteers needed) for states when most have only three. For children-related opportunities, I want to specify an 'other' column, and have a expansion [+] to the left of the volunteer opportunity name which will expand out all the children-specific states with their associated counts.
The report as it is now looks like this:
My background is in database/query design, so naturally I wrote a query with a joined sub-query for each of the columns. Rather than making an additional new subquery for each of the 'Other' states, I assume there's a way that I can have a single subquery join grouping on the volunteer status, and let SSRS do the rest of the work. (I may be wrong about SSRS's capabilities here.)
My proposed query looks something like this:
SELECT vo.name, vo.volunteers_needed, vm.status, vm.status_count
FROM tbl_volunteer_opportunity vo
JOIN (SELECT volunteer_opp_id, status, COUNT(*) "status_count"
FROM tbl_volunteer_opportunity_member
GROUP BY volunteer_opp_id, status) vm ON vo.volunteer_opp_id = vm.volunteer_op_id
I now need to make a tablix and/or datasource to make columns for the Connected, In Process, No Contact, and an aggregate for Other values, and then do something else for a expansion for each of the Other statuses.
I'm not sure how to do either of those things.
Assuming you have a query that returns data in the following format:
+-------------+--------------------+-------------+-------+
| ProfileName | Status | StatusGroup | Count |
+-------------+--------------------+-------------+-------+
| A | Needed | Needed | 5 |
| A | Connected | Connected | 3 |
| A | In Process | In Process | 5 |
| A | No Contact | No Contact | 2 |
| A | Other status | Other | 3 |
| A | Another status | Other | 6 |
| A | Yet another status | Other | 2 |
+-------------+--------------------+-------------+-------+
You then create a tablix that uses the ProfileName as a row grouping, and the StatusGroup as a column group. The tablix will look like this in the designer:
+-----------------+
| [StatusGroup] |
+-----------------+-----------------+
| [ProfileName] | [Sum(Count)] |
+-----------------+-----------------+
You can then add a totel column on the right, and add an additional level to the column group with interactive expand/collapse functionality (to expand the "Other" StatusGroup into the individual statuses). Using SSRS expressions, you should be able to hide the expand/collapse button on the column headers of the StatusGroups that are not "Other".
Hope this is enough to get you started.

How to use a IF statement in devexpress report's filtering string?

I have created a Devexpress xtrareport , and I have set it's data source to a dataset which contain MyData table. And I want to achieve something like in the below picture ,
Can someone tell me how to achieve this behavior ?
-------------------------
MY Data Table
-------------------------
Active | Name | Age
------------------------
True | Okas | 1
True | Kaos | 2
False | Kas | 3
After a long search on internet I found that to use IReport.ParametersRequestSubmit to dynamically change the XtraReport.FilterString property in code.
This is the way to solve this problem

RDLC Report - Repeating vertical lines on all pages

I am designing an Invoice (Bill) using RDLC, WinForms, C# in Visual Studio 2012. The Invoice could span from 1 to N pages. I am using Tablix to show the Invoice details (line items) in the Report Body. An Invoice may contain 1 to N line items.
As per the design requirement the Tablix Columns need to be separated by Visible Vertical Lines when the report is viewed, printed or exported. These lines need to start at the top near the Tablix Header and run to the end of the page i.e. they cover the Report Body from top to bottom. The Body part of the Invoice looks something like this:
| SNo.| Code | Quantity | Particulars | Rate | Amount |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
I thought of 2 options to do this:
Turn ON the border of the Tablix on all 4 sides.
This does not work because if the records are less, then the lines are only shown half way through the page.
Turn OFF the border of the Tablix on all 4 sides and use the LINE OBJECTs to decorate the Invoice and extend it till the end of the page. This works only on the first page and no Lines are shown on the subsequent pages.
There were other options that I thought of, but did not give me a clean result and was a compromise in other areas.
Please help me as I am completely stuck.
In a VS2005 application (no Tablix) I had to:
set body height so that the sum of header height + body height + footer height + top/bottom margin = PageSize.Height
put one rectangle for every column OVER my table (i.e. 1 rectangle for SNo. column, 1 rectangle for Code column)
set RepeatWith of every rectangle to my table
I think the same solution will work for VS2012, Tablix and Line: try to set Line.RepeatWith to your Tablix.
You can use list for displaying data with a table inside it.
Then have a list height full upto bottom. Draw vertical lines inside list upto bottom.
Then in list group, provide following expression.
ROWNUMBER(nothing)\20.
20 is the number of lines required on one page.

Infragistics Silverlight XamGrid with different layouts in hierarchy

How can I create a XamGrid with a ColumnLayout that looks like,
| Name |
John
(+/-)
| First Name | Last Name | Address |
Mary
(+/-)
| Height | Weight |
From the description it appears that you would like to have a hierarchical grid where you would expand out different details for different rows. The XamGrid does allow sibling ColumnLayouts in a nested layout and there is an example of this in the help topic for Defining Hierarchical Layouts:
http://help.infragistics.com/NetAdvantage/Silverlight/Current/CLR4.0?page=xamGrid_Defining_Hierarchical_Layouts.html

Resources