RDLC Grouping Changes my Sort - c#

I have a simple report which is to be sorted by date.
If I sort by date without grouping, everything is fine. As soon as I add my group, the data is no longer sorted by date.
I have tried added interactive sorting for "Date" on every column and still no luck.
Is there something I am missing? This must be possible!
PS: My data is sorted by date with the SQL.

I did not notice the group automatically added sorting. I fixed this right-clicking the Group, and under sorting I deleted the sort field.

Even I spent a day trying to fix the same issue. The trick is edit the 'Group Properties'
Right click on the cell you are grouping by. Go to Row Group > Group Properties
Click the Tab called Sorting and then add the expression or column you would like to sort on.

Related

How to remove sorting of specific rows of gridview in asp. Net

Hi i have one Gridview with data. I have already applied sorting and filtering option to Gridview. But i don't want to sort and filter my last 2 rows of Gridview. Please suggest me what can i do for it? . Thankx in advance
In asp.net gridview one property is provided by .net. Which is called as custom sorting.
By custom sorting method. you have to slice bottom two rows and sort the 1st half of data and append 2nd half sliced row. Return as a set.
For reference Custom sorting in grid view by MSDN
Thanks #Kiran Potawale, English is not my first language, If any grammatical mistake please ignore or edit into my answer.
Just don't set the SortExpression on those columns you don't want to Sort on.

RDLC report from MySQL formating issue

I need to create a RDLC report from a MySQL db that needs to show timecard info per user, per day between 2 dates (user choice) Like this eg:
UserFirstName UserLastName
2019-01-11 InTimeStamp OutTimeStamp TimeSpan
2019-01-12 InTimeStamp OutTimeStamp TimeSpan
2019-01-13 InTimeStamp OutTimeStamp TimeSpan
2019-01-14 InTimeStamp OutTimeStamp TimeSpan
Total: totalTimeForThePeriod
I need this for every user within the dates provided by the user.
I have already setup the HR report page and the date choice (works perfectly) but I can`t seem to be able to format my RDLC report to show the info as requested. How can I seperate the data to acheive this? My dataset gets all the data from the db (query works great). All I need to do now is to show it properly in the report. Any ideas on how I can acheive this?
I've tried using a simple table but that does'nt work.
I also tried a matrix, but I can't seem to show the data as requested.
You'll want to go one by one creating your rows. Also have your Grouping window open, so you can see your grouping. First right click where you want your first row and click Add Group -> Parent Group. In the Group by: drop down select a UserFirstName. Then it should add UserFirstName to your grid. To the right of it add UserLastName. Next in your grouping window under Row Groups click the drop down arrow on (UserFirstName) and click Add Group->Child Group. This time group by [TimeStampDate]. This will create a new row under your original row that is a sub group of UserFirstName. Add in the addition data in this new row. Lastly in the grouping window under Row Groups click the drop down on TimeStampDate then click Add Total->After. This should add a total row under the TimeStampDate row. You can change the [Sum(TimeStampDate )] to [totalTimeForThePeriod]. This should get you what you need.
[UserFirstName] [UserLastName]
[TimeStampDate] [InTimeStamp] [OutTimeStamp] [TimeSpan]
Total: [totalTimeForThePeriod]
I struggled with the same issue for hours, so I hope this helps!

Custom Grouping with Telerik Grid for MVC

I wish to create a Telerik grid which can be grouped by different fields in the table, but I'm running into quite a problem - Telerik only allows me to designate a property to group by, and then that's it.
What I want to do is to partly be able to designate the title of the group. Instead of "Current Index: 9" I might want to remove the property name (Current Index) and replace the number by getting the value for it in a dictionary.
Also, say I want to sort by a date - Then I'll be wanting to sort only by year, month and day, and not by the full extent of the datetime down to the very last millisecond (results in separate groups for every object).
Is there any way to achieve something like this at all?
Thanks.
I solved my conumdrum by using ClientTemplates (Ajax binding) and custom properties in my viewmodel.

DataView rows - order by most recently modified?

What we're doing - we have some DataGrids bound to some DataViews and when the user hits a 'submit' button we want to pass all the changed rows to a SPROC. There are some complexities here I can't go into detail about but...
what we need - a list of the modified rows ordered by the time they were modified. Is this possible? I doubt it is possible with the current DataView class so I was wondering what other options I have?
Using .NET 4.0
Kind regards,
Fugu
One way could be to manually add a column "ModifiedTime" that will hold the modified date and time. Every time a row is modified, modify the "ModifiedTime" column by updating its value to current date and time. Now you can simply sort by "ModifiedTime" to get required results.

Implementing user defined display order UI

i have a list of products that are being displayed in particular order. store admin can reassign the display order, by moving the "hot" items to the top of the list. what's the best way of implementing the admin functionality UI [asp.net C#]? Products table has a [displayOrder(int)] filed which determines the display order.
i'm looking for something intuitive and simple.
thank you.
p.s. i guess i didn't make myself clear, i'm looking for UI advice more than anything.
SOLUTION: ReorderList worked out great, this article helped too. Also, make sure OldValuesParameterFormatString="{0}" in your DataSource.
using AJAX you could implement a Reoder list control you can find more information here http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ReorderList/ReorderList.aspx
Mauro
http://www.brantas.co.uk
You need a Rank field for each product (which could also be the DisplayOrder field).
When the administrator ups or downs a product, update the rank value.
When you need to list the products, do a select query which sorts in DESC order of rank.
i'm implementing that using the 'Order' column/property where people input numbers like 10, 20, 30 (i have ascending ordering). i have a list of items with text boxes to input order, and an 'apply order' button that saves new values to the database and reorders/reloads items on the page with the new ordering applied.
i don't forbid inputting the same value for two items, i sort them by name as a second sort parameter, or leave it to the database to sort it at will if it doesn't matter much. i believe it's understandable enough to put it that way, it seems like an ordered list which everybody understand easily.
If you can modify the database, add an IsHot column. Then sort by IsHot and DisplayOrder (in that order). This will keep the products in the correct order and the "hot" products will bubble up to the top.

Categories