×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Cross-tab calculated Member

Cross-tab calculated Member

Cross-tab calculated Member

(OP)
Hi all,
I'm using Crystal Reports 2016.
I have a report that shows the properties of objects.
The data coming into the report has both the Current value of the properties and the Previous value.
e.g.

PropertyName, PropertyValue, HistoryType
ObjectColour, Green, Current
ObjectColour, Red, Previous
ObjectFont, Arial, Current
ObjectFont, Arial, Previous


The report is grouped by Area (where the objects are located).
I'm using a Cross-tab to display the data, where the column is HistoryType, the Row is PropertyName and the Summarized value is the Max of PropertyValue.
The Cross-tab is in the Group Header for the Section.
This works well, but I'd like to suppress the Cross-tab if all of the properties in the Cross-tab have equal values for both Current and Previous.

In my sample data shown above, Object Colour is different for Current and History so, even though ObjectFont is the same for Current and Previous, I would want the Cross-tab to still be displayed.

In the data shown below, both properties have the same value for Current and Previous
PropertyName, PropertyValue, HistoryType
ObjectColour, Red, Current
ObjectColour, Red, Previous
ObjectFont, Arial, Current
ObjectFont, Arial, Previous


What I was considering was to add a new calculated column that would return a value of 0 if the properties in a given row were identical, and a 1 if they were different.
If I could then sum up this calculated value, I'd like to suppress the Cross-tab if the summarized value was 0.

The problem is that I don't know how to create the calculated column, and then summarize it.
Further, I'm not sure if I could use that value to turn on the Suppress property for the Cross-tab.

Any suggestions?

Thanks.

Bob Suruncle

RE: Cross-tab calculated Member

You could accomplish this through a work around. You would have to create the same crosstab in a GH-a section, with your original crosstab in GH_b. In the new GH-a crosstab, you would select an inner cell->right click->format field->suppress->x+2 and enter:

whileprintingrecords;
numbervar prev;
numbervar curr;
if gridrowcolumnvalue("table.historytype")="Previous" then //replace brackets from field name with "'s as shown
prev := currentfieldvalue else
if gridrowcolumnvalue("table.historytype")="Current" then
curr := currentfieldvalue;
true

Also suppress the row and column headings. In the crosstab expert, in the customize style tab, uncheck "show cell margins" and then click on "format grid lines" and uncheck "show grid lines". Now the crosstab should not be visible. Minimize the row height of the crosstab in design mode and then right click on the gray section to the left (where the section names are located) and check "fit section". Next go into the section expert and select GH-a and check "underlay following sections".

Finally, also in the section expert, select GH_b->suppress->x+2 and enter:

whileprintingrecords;
numbervar prev;
numbervar curr;
prev-curr=0

-LB

RE: Cross-tab calculated Member

Sorry, just realized I tested with numeric values, but you are using strings. Let me get back to you with a fix, as just converting to strings won't work.

-LB

RE: Cross-tab calculated Member

How many distinct PropertyNames are there?

-LB

RE: Cross-tab calculated Member

(OP)
There are around 20 properties, but the number of properties may change on each run.
We're returning the differences between current values and previous values for these objects.
For a given run of the report, 2 or 3 properties may have changed, but it's possible that 15 or 20 properties could change.
I appreciate your ideas Linda, but I think I'm going to mull things over for a while and see what comes of this.

Thank you!

Bob Suruncle

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close