Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: String functions return junk characters Post Reply Post New Topic
Author Message
japss
Newbie
Newbie


Joined: 05 Jan 2011
Online Status: Offline
Posts: 1
Quote japss Replybullet Topic: String functions return junk characters
     Posted: 05 Jan 2011 at 8:01pm

I am trying to write a simple string manipulation on a formula field. 

Left (string, N) returns junk character but if I hard code N to some numbers it returns proper string like Left(string, 10) returns good;

Left (string, 10) --> returns good string

Left (string, Instr(string, ">")); --> returns junk

X := InStr(string, ">"); Left (string, X); --> returns junk

Here is my formula field:

local StringVar temp;
local StringVar temp1;
local NumberVar x;
temp := "<span style='font-size:10pt;font-weight:bold;color:red;'>testing</span>";
x := InStr (temp, ">");
temp := Left (temp, x);
if (1=1) then
    temp;

Same case with Left or Right or Mid

Using Visual Studio 2005; CrystalReports.NET

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 06 Jan 2011 at 4:08am
Hate to say, works fine in CR 2008, so I am not sure what is going wrong.

Edited by lockwelle - 06 Jan 2011 at 4:09am
IP IP Logged
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