Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: parsing data? Post Reply Post New Topic
Page  of 2 Next >>
Author Message
TQ-Jeff
Newbie
Newbie


Joined: 07 Jun 2010
Location: United States
Online Status: Offline
Posts: 7
Quote TQ-Jeff Replybullet Topic: parsing data?
     Posted: 09 Aug 2010 at 3:06pm
Hello All,

New to Crystal Reports but from what I see so far it is Very Robust and worth Every Penny! I have been elected to create reports from our database on a bunch of things. One of the things is CPU info. The problem is that the database has a plethora of info in it. I only need about the first 20 characters. Is there a way to limit the field to the first 20 characters or so?

Thanks for the help!

Jeff
IP IP Logged
nix1016
Groupie
Groupie


Joined: 07 Jun 2010
Online Status: Offline
Posts: 40
Quote nix1016 Replybullet Posted: 09 Aug 2010 at 4:28pm
You can use the left command if the field is a str, e.g. left(cpu_info, 20), or left(totext(cpu_info,20)) if it isn't a str.
IP IP Logged
TQ-Jeff
Newbie
Newbie


Joined: 07 Jun 2010
Location: United States
Online Status: Offline
Posts: 7
Quote TQ-Jeff Replybullet Posted: 10 Aug 2010 at 5:43am
Originally posted by nix1016

You can use the left command if the field is a str, e.g. left(cpu_info, 20), or left(totext(cpu_info,20)) if it isn't a str.


I am new to CR can you push me in the right direction for this? Thanks,

Jeff

IP IP Logged
nix1016
Groupie
Groupie


Joined: 07 Jun 2010
Online Status: Offline
Posts: 40
Quote nix1016 Replybullet Posted: 10 Aug 2010 at 8:32pm
You'll need to create a forumla for this by going to the formula workshop under the report menu and then write the formula i.e. left({tablename.fieldname},20) and then drag the formula to where you want it to display the CPU info on the report from the field explorer menu. If you can't see this menu you can toggle it under the View menu.
IP IP Logged
TQ-Jeff
Newbie
Newbie


Joined: 07 Jun 2010
Location: United States
Online Status: Offline
Posts: 7
Quote TQ-Jeff Replybullet Posted: 23 Sep 2010 at 5:08am
Sorry it took so long to respond...got moved off this report and on to another more important report.

When I am in Formula Editor and create left({computers.Processors},36) I get "there is an error in this formula. Do you want to save it anyway? I click no and it gives me this error: The result of selection formula must be a Boolean. I have a Crystal Reports book but the info I have on Boolean is just the breakdown of who invented Boolean Algebra...not much help really.



IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Sep 2010 at 5:17am
your in the select expert.
that only wants boolean results to select rows of data.
you should be in the Field Explorer > Formula Fields>Right click and select New
IP IP Logged
TQ-Jeff
Newbie
Newbie


Joined: 07 Jun 2010
Location: United States
Online Status: Offline
Posts: 7
Quote TQ-Jeff Replybullet Posted: 23 Sep 2010 at 6:06am
Here is the whole string that displays:

Dual-Core AMD Opteron(tm) Processor 2212:0:1995:32:131:2048:AuthenticAMD:178BFBFF00040F13-1:4:1

Is there a way to Limit it after the first : ?

The reason I ask is that every process or is different and if I allow for 36 characters some of the processors have more and some have less so it just looks ugly on a report.

Thanks!

Edited by TQ-Jeff - 23 Sep 2010 at 6:12am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Sep 2010 at 6:11am
 left({computers.Processors},instr({computers.Processors},':')-1)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Sep 2010 at 6:13am

I think I just gave you the inverse of what you wanted.

MID({computers.Processors},instr({computers.Processors},':')+1)
IP IP Logged
TQ-Jeff
Newbie
Newbie


Joined: 07 Jun 2010
Location: United States
Online Status: Offline
Posts: 7
Quote TQ-Jeff Replybullet Posted: 23 Sep 2010 at 6:44am
I need a class for this stuff! The formula is created but I cannot seem to "insert" it into the report.
IP IP Logged
Page  of 2 Next >>
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum