I have a Dictionary<Datetime, List<Item>> and I want to populate the dictionary in a GridView. I would like to show data as following:
--------------------------------------
Datetime1
--------------------------------------
item1.prop1 item1.prop2
item2.prop1 item2.prop2
--------------------------------------
Datetime2
--------------------------------------
item3.prop1 item3.prop2
item4.prop1 item4.prop2
item5.prop1 item5.prop2
Is the GridView the correct control? How can I group the data by the key of a Dictionary?
Related
I am trying to use a LATERAL JOIN on a particular data set however i cannot seem to get the syntax correct for the query.
What am i trying to achieve:
Take the first column in the dataset (See picture) and use that as the Table headers (rows) and populate the rows with the data from the StringValue column
Currently it appears like this:
cfname | stringvalue |
----------------------------------------
customerrequesttype | newformsubmission|
Assignmentgroup | ITDEPT |
and I would like to have it appear as this:
customerrequesttype| Assignmentgroup|
-------------------------------------
newformsubmission | ITDEPT
As mentioned i am very new to SQL i know limited basics
This might be beyond the limits of report builder.
I have an SQL Report that generates a table. The table is a fixed number of columns with a dynamic number of rows. The point of the table is to show recipe information of a system and I would like to make it more clear to a user when recipe information has been changed.
Example
+-----------+-------+-----+
| row names | Col A | Col |
+-----------+-------+-----+
| row1 | 10 | 20 |
| row2 | 14 | 20 |
+-----------+-------+-----+
The value of colA has changed so I would like to either change the cell color of row2,colA or change the font. To make it clear to a user what has changed.
I would want to do this dynamically for ever row. Basically compare to the row before and determine if I need to change colors of any of the cells.
Assuming you just mean you want to compare the previous row shown in the report then you can this is easily.
To recreate the exmaple, I used the following query in a dataset called DataSet1.
DECLARE #t TABLE(RowID int, ColA int, ColB int)
INSERT INTO #t VALUES
(1,10,20),
(2,14,20),
(3,14,20),
(4,15,21),
(5,15,22)
SELECT * FROM #t
I then created a simple table with the results sorted by RowID.
I then changed the BackgroundColor property of the cell containing [ColA] to the following expression.
=IIF(
Fields!ColA.Value = Previous(Fields!ColA.Value)
OR Fields!RowID.Value = MIN(Fields!RowID.Value, "DataSet1")
, Nothing
, "Khaki"
)
I repeated this for Col B changing the field name as applicable.
The expression simply checks if the value is the same as the previous row. For the first row with will always be false so I put a check in to see if we are formatting the first row. So if either (a) we are on the first row or (b) the number is the same as the previous number in this column, then the background is set to Nothing (the default), if neither of the conditions are met we set the background to 'Khaki'.
The end result looks like this...
The another way would be modifying the .RDL file.The RDL file basically contains XML tags so if you open them in Notepad or Visual Studio using View Code .You will find a tag called BackgroundColor for each and every column .By giving the color code in the place of existing one will get you the desired color.you can design a custom color and use it in your report.
I'm trying to fill the combobox with values from a concatenated field in a MS Access query. The embedded image is what is currently shown in the drop down box and what is shown in the box when a value is selected.
The problem is that i do NOT want the values in the drop down box to show as if in columns, but rather as a concatenated string. So, instead of ... TAYLOR | AVICHAI ... it should be TAYLOR, AVICHAI. And additionally, when the value is selected, then instead of showing just TAYLOR it would show TAYLOR, AVICHAI.
I've tried every property I can think of and tried concatenating in the original table, the query and even in vba code AFTER just grabbing the two fields from the database.
Any help? Concatenated View
You need to concatenate the values together in your query and display that field in the combo box.
SELECT peopleID, lastName & ", " & firstName AS name FROM tblPeople
And then in your the format tab of your combobox set:
column count to 2
column widths to 0";1"
This will cause only your column with a width (the combined names) to be displayed in the drop down and when selected.
The documentation says: "In a combo box, the first visible column is displayed in the text box portion of the control."
More precisely, the value shown is the value of the first column with a non-zero width.
Thus, to achieve your goal, modify your query so that it returns the following:
Taylor, Avichai | Taylor | Avichai
Raines, Patricia | Raines | Patricia
...
Then, in the combox box properties, set
the number of columns to 3 and
the column widths such that the first column is very small (but not zero).
Hi I was wondering if there is a way to split long column values in this case I am using SSRS to get the distinct values with the number of product ID against a category into a matrix/pivot table in SSRS. The problem lies with the amount of distinct category makes it a nightmare to make the report look pretty shall we say. Is there a dynamic way to split the columns in say groups of 10 to make the table look nicer and easy to read. I was thinking of using in operator then the list of values but that means managing the data every time a new category gets added. Is there a dynamic way to present the data in the best way possible? There are 135 distinct category values
Also I am open to suggestions to make the report to nicer if anyone has any thoughts. I am new to SSRS and trying to get to grips with its.
Here is an example of my problem
enter image description here
Are your column names coming back from the database under the SubCat field you note in the comments above? If so I imagine your dataset looks something like this
Subcat | Logno
---------+---------------
SubCatA | 34
SubCatB | 65
SubCatC | 120
SubCatD | 8
SubCatE | 19
You can edit this so that there is an index of each individual category being returned also, using the Row_Number() function. Add the field
ROW_NUMBER() OVER (ORDER BY SubCat ASC) AS ColID
To your query. This will result in the following.
Subcat | LogNo | ColID
-----------+--------------+----------
SubCatA | 34 | 1
SubCatB | 65 | 2
SubCatC | 120 | 3
SubCatD | 8 | 4
SubCatE | 19 | 5
Now there is a numeric identifier for each column you can perform some logic on it to arrange itself nicely on the page.
This solution involves a Tablix, nested inside a Matrix nested inside a Matrix as follows
First create a Matrix (Matrix1), and set it’s datasource to your dataset. Set the Row Group Properties to group on the following expression where ‘4’ is the number of columns you wish to display horizontally.
=CInt(Floor((Fields!ColID.Value - 1) / 4))
Then in the data section of the Matrix (bottom right corner) insert a rectangle and on this insert a new Matrix (Matrix 2). Remove the leftmost row. Set the column header to be the Column Name SubCat. This will automatically set the column grouping to be SubCat.
Finally, in the Data Section of Matrix 2 add a new Rectangle and Add a Tablix on it. Remove the Header Row, and set it to be one column wide only. Set the Data to be the information you wish to display, i.e. LogNo.
Finally, delete the Leftmost and Topmost rows/columns from Matrix 1 to make it look tidier (Note Delete Column Row only! Not associated groups!)
Then when the report is run it should look similar to the following. Note in my example SubCat = ColName, and LogNo = NumItems, and I have multiple values per SubCat.
Hopefully you find this helpful. If not, please ask for clarification.
Can you do something like this:
The following gives the steps (in two columns, down then across)
New to Access here... I asked a similar question the other day, but have a new twist for a different form I am creating.
Say I have a table (tblNamesAndValues) that looks like this:
Name Value
---- ----
Mary 100
Carrie 500
Terri 999
Gerrie 749
I have created a form that displays all four names and values.
My question is this: how can you make the form display only the names Mary and Terri and their values, and have the values in updateable textboxes? On top of that, is there any way to only display those two, and not the blanks underneath that allow new entries?
Thanks in advance...
You can filter the form or use a query instead of the table as table source:
select * from tblNamesAndValues where name = "Mary" or name = "Terry"
For disabling the blank line, just set the AllowAdditions property of the form to false.