Ticket T1279763
Visible to All Users

How to add a static "Extra Working Time" row before the grand total in XRCrossTab

created 3 days ago (modified 2 days ago)

[DevExpress Support Team: CLONED FROM T1279152: XtraReport - Display overview of all found nested groups AFTER displaying the details for these nested groups]

Just note: I create the report definitions by C# code on my own but in case of troubles I can export it to WYSIWYG editor, find the solution and then to project found solution to my code.

My current result is this summary table:
Clipboard-File-1.png

Issue 4) There is a report parameter called "Proplaceni". This is some ad hoc number value entered by the user and it has meaning "extra working time". There should be an extra row in a table (right before the "Grand Total" row) displaying the value "Proplaceni" in the column WORKED and in the column DIFFERENCE. This row could be considered "static" as its value doesn't depend on the data source and is always presented. This "extra working time" should then by added to the summary values of "Grand Total" row.

The desired result is something like this:
Clipboard-File-2.png

Thank you very much. I know I have a lot of questions. :-)
M.

Answers approved by DevExpress Support

created 2 days ago

Hello Miroslav,

XRCrossTab cannot use parameters to display a separate row. However, it is still possible to meet your objectives. Hide the Grand Total row and add a separate XRTable below your cross tab. Design it according to your specifications.
Clipboard-File-1.png

To calculate a total for the current user, use aggregate functions. For instance, the following expression computes the difference between NORM and WORKED and formats the result:

Code
MinutesToDuration([][[IDPRACPOMER] == ^.[IDPRACPOMER]].Sum([DZ005]) - [][[IDPRACPOMER] == ^.[IDPRACPOMER]].Sum([VYKON])-?Proplaceni)

I hope this helps.

Regards,
Aleksandr

    Comments (2)

      Thank you Aleksandr, this helped a lot.
      You are DevExpress reporting magician who knows every trick. :-)

      I was able to transfer your idea from sample report to my C# code and this is the desired result:
      Clipboard-File-1.png

      Note: The first column with a month information is now translated using one fixed language, generic solution is mentioned in Passing a non-simple type (POCO object) as a custom function parameter in XRCrossTabCell expression bindings.

      Note II: I know, there is some inaccuracy in my screenshot caused by rounding the numbers and converting them to time and adding them up, but I'll have to work that out myself.

      This ticket can be closed.

      Aleksandr (DevExpress Support) 13 hours ago

        Thank you for your kind words, Miroslav! I appreciate your feedback, and I'm happy to hear that my recommendations were helpful.

        Regarding your other question, we are working on it. You will receive a follow-up as soon as we have any information.

        Best regards,
        Aleksandr

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.