Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How would i write a formula to be specific on my grouping?

Status
Not open for further replies.

lynda1

Programmer
Mar 25, 2004
11
AU
I am currently completing an error log report, and I am new to Crystal Reports. My problem is that i have a field called Event log description, which has heaps of records. At the moment i have this field and have done a count on the number of time each error message occurs.

Rather then showing the message 100 times it's only shown once. However this grouping doesn't work when there is a slight difference in the field. For example:

Application popup: SQLImporter.exe - Application Error : The instruction at "0x73d245d1" referenced memory at "0x0032904c". The memory could not be "read"....Click on OK to terminate the program..
Application popup: SQLImporter.exe - Application Error : The instruction at "0x77f4200b" referenced memory at "0x00000014". The memory could not be "read"....Click on OK to terminate the program..
To me this is pretty much the same error message even though there is a few differences. How do i make it appear once, not heaps of times?

There is so many of this repeating in the one field error log description.





 
Aren't there error message codes corresponding to the general error message that you could group on instead? Then you could display the description in the group header by creating a formula:

"Sample error message: " + {table.description}

I might be offbase here...

-LB

 
Thank you for the reply, I have tried grouping it by other codes but everthing is different, so the message still appears 100 times, is there another possible way to solve my problem?
 
You could try replacing the non-repeating elements within the messages with wildcards. For the above formula, create a formula like:

//{@errormsg1}:
if {table.errormsg} = "SQLImporter.exe - Application Error : The instruction at "+ "*" +" referenced memory at "+ "*" + ". The memory could not be "read"....Click on OK to terminate the program..." then "Error Message 1"

Or try using the left function up to the point where a variable element appears, e.g.,

left({table.errormsg},instr({table.errormsg},""")-1)

You could group on this last formula.

You could also try to replace elements in the message to make them identical by using something like:

replace(replace({table.errormsg}, mid({table.errormsg},
instr({table.errormsg},"""),10),"*"),
mid({table.errormsg}, instrrev({table.errormsg},""")-9,10)
,"*")

Something like this would work if it were always a 10-digit number appearing twice within the error message. Maybe one of these ideas will help.

-LB
 
Thanks lbass, i will try these different ways and let you know how i go.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top