Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Prewiew CR error Post Reply Post New Topic
Author Message
nalfein
Groupie
Groupie


Joined: 07 Jul 2008
Online Status: Offline
Posts: 47
Quote nalfein Replybullet Topic: Prewiew CR error
    Posted: 08 Jul 2008 at 11:43pm
Hi all i have a field in the report that have this formula:

numbervar start := instr({@articolo}, {@Form1}) + len({@Form1});
numbervar stop := instr({@articolo},{@Form3}) +2;

Mid ({@articolo}, start,stop - start - 2)

And all works good if records are a certain size (example: me.you.them.all)

If some record is short (example: me.you) the prewiev and following print cannot be done and CR report this problem

"String lenght is less than 0 or not an integer"

Can i put some formula to skip this problem so if start or stop are less than 0 (i think that is the problem) they come back positive?

I've tried with this formula:

numbervar start := instr({@myfield}, {@Form1}) + len({@Form1});
numbervar stop := instr({myfield},{@Form3}) +2;

if start <0 or stop <0 then

{@myfield}

else


Mid ({@myfield}, start,stop - start - 2)

But the messsage is the same

Any idea?

Thnx for help in advance
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 09 Jul 2008 at 2:01am
Hi
 
Did you try <= 0
 
Can you post the data for  @articolo and @Form1,@Form3,@myfield
 
cheers
Rahul


Edited by rahulwalawalkar - 09 Jul 2008 at 2:01am
IP IP Logged
nalfein
Groupie
Groupie


Joined: 07 Jul 2008
Online Status: Offline
Posts: 47
Quote nalfein Replybullet Posted: 09 Jul 2008 at 5:03am
@articolo and @myfield are the same sorry

Data on those fields are on this format:
xxx.xxxxx.xxx.xx.xx
or similar lenght

@form1 is:
left({@myfield},instr({@myfield},'.')-1)

@form3 is:
Right({@myfield},instr({@myfield},'.')-2)

the problem is when the data on @myfield are similar to this kind of format:
x.xxx.xxx.xx
or
x.xxx.xx

So when they're short

I've tried with <=0 but the same error appear

Thnx in advance for help


IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.