Ticket T699640
Visible to All Users

XtraReports - how to display row count of group?

created 6 years ago

When using WYSIWYG editor for XtraReports, I'm trying to display the row number for a group. However, I can't seem to get the count to work. I've attached a screenshot example.

1. Let's say you have a table with 100 rows of city names where 20 are Boston, 30 are NYC, and 50 are LA
  2. XtraReports displays 3 rows and I'd like the output to be:

Row 1 - Boston
  Row 2 - NYC
  Row 3 - LA

The actual words "Row X" should be displayed. I thought I could do this with a RecordNumber, but can't get it to work. Thank you for any assistance you can provide.

Show previous comments (2)

    Thank you for your fast response.

    However, the provided solution is only for Question 1, i need solution for Question 2 which is showing the Row X. Do you mind to provide it as well? Thanks a lot.

      The previous solution BeforePrint was working, but it's not secure as Report scripts are not secure. So i need alternative solution.

      DevExpress Support Team 5 years ago

        Hello,

        We will process this issue in the How to display row count of group using expressions ticket.

        Thanks,
        Elliot

        Answers approved by DevExpress Support

        created 6 years ago (modified 6 years ago)

        Hello Tom,

        There is no straightforward way to resolve this issue in the XtraReports Suite without handling the BeforePrint event. I've passed your request to our developers so that they consider implementing this feature in the future.

        Thanks,
        Elliot

          Comments (1)

            Okay, thank you for checking. As always, your support has been top notch. Really appreciated!

            created 6 years ago (modified 6 years ago)

            Hello Tom,

            You can handle the XRTableCell.BeforePrint event as shown below to accomplish this task.

            C#
            int counter = 0; private void xrTableCell1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { counter++; xrTableCell1.Text = "Row: " + counter.ToString(); }

            See also:
            Use report scripts

            Thanks,
            Elliot

              Comments (1)

                Any options without using the print event? My users are limited to WYSIWYG editor.

                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.