Missing SummaryTypes and custom Comparer

Stimulsoft Reports.WPF discussion
Post Reply
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

Missing SummaryTypes and custom Comparer

Post by LukasT »

Hello,
we have need to sort groups by another column than it is grouped by. For this purpose is usable SummaryExpression and SummaryType. But there aren't all aggregate functions for all types.... for example MaxStr() etc. So we are not able to sort groups by string value....
And second problem is, that you are probably using IComparer object from CurrentCulture, but we have our own Comparer object. Is any possibility to set up Comparer on StiReport (StiEngine) object? Or it could be added?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Missing SummaryTypes and custom Comparer

Post by Alex K. »

Hello,
LukasT wrote:we have need to sort groups by another column than it is grouped by. For this purpose is usable SummaryExpression and SummaryType. But there aren't all aggregate functions for all types.... for example MaxStr() etc. So we are not able to sort groups by string value....
Please check the sample report in attachment.
If it is does not help please send us your report with test data for analysis.
LukasT wrote:And second problem is, that you are probably using IComparer object from CurrentCulture, but we have our own Comparer object. Is any possibility to set up Comparer on StiReport (StiEngine) object? Or it could be added?
Can you please describe your task in more details?
What are the basics of difference between our Comparer and ours, why it is better?

Thank you.
Attachments
SimpleGroup.mrt
(25.05 KiB) Downloaded 253 times
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

Re: Missing SummaryTypes and custom Comparer

Post by LukasT »

Please check the sample report in attachment.
If it is does not help please send us your report with test data for analysis.
Try to rename CategoryName in Data.xml in order not to be in alphabetical order.... and you will see, that it is still ordered by CategoryID
Can you please describe your task in more details?
We have another (specific) requirement for alphabetical and numerical order. For example we need to have numbers on end.... or if we decide to have some modifications in data order, we need to have possibility to somehow change Comparer object...
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

Re: Missing SummaryTypes and custom Comparer

Post by LukasT »

... I found my old topic http://forum.stimulsoft.com/viewtopic.p ... 432#p13432 .... you added string versions of Max/Min functions (MaxStr/MinStr) but maybe you forgot to add this functions to SummaryType enumeration....
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Missing SummaryTypes and custom Comparer

Post by Alex K. »

Hello,
LukasT wrote:Try to rename CategoryName in Data.xml in order not to be in alphabetical order.... and you will see, that it is still ordered by CategoryID
Sorry for mistake, as a way, you can set the necessary sort order for databand and for GroupHeader band set SortDirection property to None.
Please check the modified report in attachment.
LukasT wrote:We have another (specific) requirement for alphabetical and numerical order. For example we need to have numbers on end.... or if we decide to have some modifications in data order, we need to have possibility to somehow change Comparer object..
Unfortunate, on current moment it is not possible.
LukasT wrote:... I found my old topic viewtopic.php?f=8&t=3206&p=13432#p13432 .... you added string versions of Max/Min functions (MaxStr/MinStr) but maybe you forgot to add this functions to SummaryType enumeration....
This functions was added for Totals functions in dictionary.

Thank you.
Attachments
SimpleGroup_modified.mrt
(25.16 KiB) Downloaded 248 times
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

Re: Missing SummaryTypes and custom Comparer

Post by LukasT »

Sorry for mistake, as a way, you can set the necessary sort order for databand and for GroupHeader band set SortDirection property to None.
Please check the modified report in attachment.
....but we have data sorted from server and I don't wont to define new sorting rules on DataBand... solution is MaxStr function in SummaryTypes.
Unfortunate, on current moment it is not possible.
Ok, but we have a lot of expressions with for example MaxStr function exported from old reporting system and there is expecting concrete result. We are not able to manually rewrite theese expressions it due another sorting rules. But if it is not possible, what shall we do.... :?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Missing SummaryTypes and custom Comparer

Post by Alex K. »

Hello,
LukasT wrote:....but we have data sorted from server and I don't wont to define new sorting rules on DataBand... solution is MaxStr function in SummaryTypes.
Can you please send us a sample report with test data and sample how it should look like for analysis.
LukasT wrote:Ok, but we have a lot of expressions with for example MaxStr function exported from old reporting system and there is expecting concrete result. We are not able to manually rewrite theese expressions it due another sorting rules. But if it is not possible, what shall we do....
As a way, you can use your own function in report. You can add your function in dictionary or in code of report.

Thank you.
Post Reply