Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Experts, it seems, know more about less and absolutely everything about nothing
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!


How Do I Highlight the Largest Value in a Cross-tab in Crystal Reports 2008?

Over the last couple of weeks I have been asked by a number of clients "How Do I Highlight the Largest Value in a Crystal Reports 2008 Cross Tab?"


Crystal Reports 2008 has additional cross tab functions that allows the user to interrogate the components of the cross tab report object.

To Highlight the Largest Row Value of a Cross Tab:

  1. Create a New Blank Report
  2. Select the Xtreme.mdb database
  3. Add the Customer and Orders tables to the report
  4. Use a text object to add the report Header "Customer Orders Xtab"
  5. Add a Cross tab object to the Report Header section
  6. Go to the Insert Menu and Picture
  7. Select the required picture and add it to the Report Header section
  8. Right click on the Cross tab object and select the Cross-Tab Expert menu option
  9. Add the following fields to the sections of the cross tab:

    • Rows: Customer.Customer Name
    • Columns: Orders.Order Date
    • Summarised Fields: Orders.Order Amount

  10. Select the Orders.Order Date field in the Columns section
  11. Press the Group Options button
  12. Select the For Each Month, from the Column will be printed drop down:
  13. Press the OK button
  14. Click on the Customize Style Tab
  15. Set the following formatting options for the cross tab:

    • Select Repeat Row Labels
    • Select Keep Columns Together
    • Deselect Column Totals on Top
    • Deselect Row Totals on Left

  16. Press the OK button
  17. Right click on the Summary cell, for the customer and month
  18. Select the Format Field menu option:
  19. In the Format Editor dialog box, click on the Border tab
  20. Press the conditional format button for the Color -  Background option:
  21. In the Formula Workshop, enter the following formula:
  22. CurrencyVar Maximum_Value:=0;
    Numbervar Xtab_col;
    Currencyvar Summary_value;

    For Xtab_col := 0 to GetNumColumns-2 do (

    Summary_value := GridValueAt (CurrentRowIndex, Xtab_col, CurrentSummaryIndex);

    If  Summary_value > Maximum_Value then Maximum_Value := Summary_value;
    Summary_value := GridValueAt (CurrentRowIndex, Xtab_col, CurrentSummaryIndex);


    If GridValueAt (CurrentRowIndex, CurrentColumnIndex, 0) = Maximum_Value Then     CrLime Else CrNoColor

  23. Press the Save and Close button
  24. Run the Report

To View Report PDF

If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us

Mark D.

Thanks for contributing to the global CR knowledge base. But there are several insurmountable problems with your example that prevented me from even getting past step #10" * Step #10 "Select the Orders.Order Amount field in the Columns section". This does not make any sense since, in step #9, it clearly states that the Orders.OrderAmount field is in the Summarized Fields section, *not* the Column section. * Step #12 - "Select the For Each Month, from the Column will be printed drop down". I'm not sure what that means. What does "from the column will be printed drop down" mean? Secondly, there is no such grouping option in Crystal Reports 2008. This is probably a very old post, but it would still be very helpful if those errors were corrected, or explained. Thanks, Mark


Name *

Email Address *

Comment *