Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Always read between the lines
 
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!!!!

28
May

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?"


Solution:

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. Go to the Insert Menu and Cross tab
  6. Add the Cross tab object to the Report Header section
  7. Right click on the Cross tab object and select the Cross-Tab Expert menu option
  8. Add the following fields to the sections of the cross tab:

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

  9. Select the Orders.Order Date field in the Columns section
  10. Press the Group Options button
  11. Select the For Each Month, from the Column will be printed drop down
  12. Press the OK button
  13. Click on the Customize Style Tab
  14. 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

  15. Press the OK button
  16. Right click on the Summary Sum of Orders.Order Amount field
  17. Select the Format Field option:
  18. In the Format Editor dialog box, click on the Border tab
  19. Press the conditional format button for the Color -  Background option:
  20. In the Formula Workshop, enter the following formula:
  21. 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

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



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

Mark D.

29
June
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
2

Luc

29
April
Hello Mark You know how to do the same with Minimum Thanks Luc

MAKE A COMMENT

Name *

Email Address *

Comment *

To prove you are human what is:

43 + 59 =