I am making a report that has several groups. Each group represents an object, and in each group the details for the object is listed in a DetailBand.
However, I can not find a way to sort the groups so that they are ordered on the report based on the name of the of the objects. I have read documentation from DevExpress that explains how to sort groups by summary functions, and how to sort within a DetailBand, but this is not helpful for my situation.
The (very) basic structure of my report is like this:
Report
DetailReportBand
GroupHeaderBand (want to order by this)
DetailBand
Any help is appreciated :)
Edit: I am doing this in code.
Using the Group and Sort option you have to first add the field you wish to group by as a sort on the report and then tick the option Show Header, this will automatically create the group header for you and sort via that group.
If you have already created the group header band you can just copy and paste the fields into the new band and then delete the existing group header band.
I have been fighting this same battle today. I've found that in my case I had to set the SortingSummary.FieldName property to the name of the field to sort on, which in my case is different than the name of the field I'm grouping on.
The name of my GroupHeaderBand is QuestionsGroup. I am grouping on a field called "GroupName", but I want the groups sorted by "LineNumber". In code, I have this:
QuestionsGroup.SortingSummary.FieldName = "LineNumber";
GroupFields.Add(new GroupField("GroupName"));
Also, make sure that the GroupHeaderBand.SortingSummary.Enabled = true. I had previously set the Function to Custom, and that was not working so I arbitrarily changed it to Avg and now it's working.
Good Luck!
Related
I have a datagrid (radzen components) that I have grouped by staff member last name (column is call OwnerLName)
The grouping works fine and now I am trying to summarize the other columns in the table for each grouped staff member last name.
The radzen component examples website has the following code.
context.Data.Items.Cast().Sum(o => o.Freight)
I completely understand that it is used to cast each item in Order and sum up the freight.
My C# is very limited and I am not sure what 'context' is.
My table is called CrmTask
I am trying to count the number of times a specific column (first example is EventStep1Complete) equals true.
I have tried to use the application name, the table name, the database name, the grid name and none works.
So far I can only summarize the entire table and not by group.
if I use .Data.Items.Cast().Count(o => o.EventStep1Complete == true)
I cannot figure out what I need to put in front of .Data.....
I have little experience with C#, so I apologize if I asked a stupid question.
I am new to Lucene, so maybe i have missunderstood something about how it works.
I have indexed few hundred thousand documents with many string field. For example suppose we have 5 string field (named A,B,C,D,E) and the first 3 are indexed (A,B,C) leaving the last two unindexed, only included into the document (i mean D,E). Values in each field may be duplicate, for example assume that the field A is used to store names, and the name 'Richard' appear many times.
When i apply a query i looking for each term in each field, now for example, suppose i get 3K documents that match my query.
Is it possible to get a list of unique values (distinct) of each fields without scan and group the result? I am particularly interested into this because i apply a limit to the documents i actually read, but i would like to get a complete list of unique values in each fields (even the documents i dont' read) of the matching documents.
If this is possibile, can i apply this logic even for unindexed fields (D,E) ?
When doing the search, it will return to you all the documents that have the query conditions. On that result you can do a highlight (which will slow the process), but you can do something like pagination to return the result in pages if you want.
In the highligher you have many methods you can use (depending on what version of Lucene you are using; I am talking here about the last version 4.8.0) like GetBestTextFragments() which takes a parameter called maxNumberFragments. If you set that parameter to 1 then it will return only one value from that particular field even if there might be multiple values that match the query.
I am not sure if that answers your question, but I hope it helps. Regarding the unindexed fields, I dont think you can do that (although I have never tried it).
Hi :) What I'm trying to achieve is creating a Contact selector that, when you click on the selector icon, it brings up a filtered result of the contacts table that only shows Contacts related to that specific company, as shown below:
The above image is in the Sales Orders screen, and I'm aiming to actually have it in the Projects screen. So when I tried moving it over, making sure to have the same setup, it doesn't seem to be working in the Projects screen.
When I try opening the selector, the box is empty. I thought that maybe the problem was that the values I was trying to match between the PMProject table and the BAccount table weren't matching, so I used the Description field to output the values I was getting, and they appear to be the same.
This is the setup I am using to create the selector:
[PXUIField(DisplayName="Contact")]
[PXSelector(typeof(Search2<Contact.displayName,
LeftJoin<BAccount, On<BAccount.bAccountID, Equal<Contact.bAccountID>>>,
Where<Contact.contactType, Equal<ContactTypesAttribute.person>>>))]
[PXRestrictor(typeof(
Where<Current<PMContact.customerID>,
Like<BAccount.bAccountID>>), "")]
It's exactly the same setup that I was using for the Sales Order screen, just obviously now it's using the CustomerID of PMProject instead.
Is there something I am doing incorrectly? Any help would be appreciated :D
UPDATE
Thanks for the answer Joseph! The contact field still shows up as being empty when I click into it. See below:
This is how I added the solution:
It seems that your join with the BAccount might not be required.
Also, where are you using the displayname in "Search2<Contact.displayName"?
Did you try something like this:
[PXSelector(typeof(Search<Contact.contactID, Where<Contact.contactType, Equal<ContactTypesAttribute.person>,
And<Where<Contact.contactID, Equal<Current<PMContact.customerID>>>>>>))]
I managed to solve this issue. Joseph's answer made me rethink how I was matching contacts with the current project, as instead of using the BAccount table, I could use the Contact table instead.
I found that I just needed to compare the Contact.bAccountID field with the value of the PMContact.customerID field, and that would give me all the associated contacts.
Adding this comparison to the PXRestrictor solved this issue for me :)
[PXDBString(50)]
[PXUIField(DisplayName="Contact")]
[PXSelector(typeof(Search2<Contact.displayName,
LeftJoin<BAccount, On<BAccount.bAccountID, Equal<Contact.bAccountID>>>,
Where<Contact.contactType, Equal<ContactTypesAttribute.person>>>))]
[PXRestrictor(typeof(
Where<Current<PMContact.customerID>,
Like<Contact.bAccountID>>), "")]
I have searched and searched and have not been able to find the answer to this. I'm no stranger to SSRS, .Net (c# and vb.net), SQL, etc...been in it for years. I currently have a multi-select report parameter that is populated by a dataset in my report. There are hundreds of entries, so I built it to be driven by a wildcard character in a preceding parameter. Everything works fine right now. My question is this: is it possible to enter a wildcard value, select one (or more) of the filtered values and then store that/those value(s) on selection so that a user can go back and enter another wildcard value and select from a newly filtered list? (Basically, remember what has been selected in the overall dataset before report execution and create some sort of comma-separated list as the final parameter value to be passed to the report) I realize this may be better served in a web app w/a reportviewer control, but I'm trying to avoid deviating from the native SSRS server if possible. Thanks in advance!
The way I might approach this (not actually done it but the theory sounds ok)
Have 2 parameters for user input, your current one and a hidden one called say #filter (visible) and #filterHistory (this is the hidden one)
Have a textbox (formatted like button) with something like "Refine" as the text. Set the action to call your report again but set the #filterHistory to be something like #filterHistory & ", " & #filter. Basically we keep appending the last user input to the history.
Then your report would filter based on both parameters. You'll have to do some parsing of the delimited parameter now to split it out into the constituent parts but you get the idea.
I've no time to build a test report but hopefully that will point you in the right direction. If it doesn't help or work then comment and I'll see if I can knock up a quick example.
I'm trying to get grouping and paging (in a datagrid) to work simultaneously in RIA Services. I already have a pretty elaborate UserControl that is based on the excellent DomainCollectionView. However, I've had trouble making the grouping work.
I added this line to the sample:
this.CollectionView.GroupDescriptions.Add(new PropertyGroupDescription("Int32"));
Note about the sample: I changed how Int32 is being assigned as key % 2, so there should be
two resulting groups, which should have hundreds of items per group. The paging is set to 10 items. No grouping is applied at the query level.
So in this case, I would expect the grouping header to show the total number of items, however, it'll just 'Group 0', as having an item count of 10, which is clearly incorrect. It is only showing the item counts in the first page.
Question
Did any make grouping and paging work together with or without DomainCollectionView?
For proper context refer to the article regarding DomainCollectionView and the sample posted for it.
Kyle McClellan of Microsoft replied to a personal email regarding this question and provided the detailed explanation below.
In summary, grouping and paging won't work together well - you certainly won't get a fully featured grouping experience in the DataGrid.
For me the solution will be to remove paging when grouping is present.
On Wed, Jun 6, 2012 at 7:51 PM, Kyle McClellan
wrote: Ah, now I understand what you were expecting. There are two
(competing?) things at play here. First, the client technology knows
nothing about the server. It only sees data that exists locally.
Because of this, the controls, etc. will report that there’s only a
single group and it only contains a page’s worth of data. Second, the
server technology can see the all the data but has only been asked to
return a single page. It sorts and slices the data appropriately and
then returns it. It could determine the number of groups and the size
of each, but there’s no way to communicate it back to the client.
What you’re seeing is the view functioning as designed. It will show
you all the items in group 0 before all the items in group 1. At some
point in the middle you will see two groups on a page, but otherwise
the results will all be in the same group.