Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Error: string length is less than 0.... Post Reply Post New Topic
Author Message
MiKeZZa
Newbie
Newbie


Joined: 20 Feb 2008
Online Status: Offline
Posts: 12
Quote MiKeZZa Replybullet Topic: Error: string length is less than 0....
    Posted: 17 Sep 2008 at 1:26am
My formula give's an error:

string length is less than 0 or no number (this is translated so it can be not the exact English error.

This error is given when I run a report, if I check the formula and his syntax it's ok. But when I want to display a print preview I get that error.

The formula is called add_formula1# and the code is:

Mid({@formula1#},1,(InStr({@formula1#},":")  ))



Wo can help me solving this problem?
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 17 Sep 2008 at 3:51am
check the length of formula1 before doing the calculation like
 
if length(trim(@formula1#)) > 0 then
  Mid({@formula1#},1,(InStr({@formula1#},":")  )) ;
Thanks
Savan
IP IP Logged
MiKeZZa
Newbie
Newbie


Joined: 20 Feb 2008
Online Status: Offline
Posts: 12
Quote MiKeZZa Replybullet Posted: 17 Sep 2008 at 4:32am
Works fine!

thanx
IP IP Logged
Leti
Newbie
Newbie
Avatar

Joined: 28 May 2015
Location: Bulgaria
Online Status: Offline
Posts: 1
Quote Leti Replybullet Posted: 19 Oct 2015 at 2:53am
Hello everybody,

I need someone's help.
I have the same error.

I have a field which is number but combine with string - (lets say "500 km" for example).
I need to remove the 'km' part of it and to stay only number - 500.

This happen with:
tonumber (mid ({Command.string_field},1,(INSTR({Command.string_field}, "km")-1)))

But when i try to export it in pdf it gives me this error message - "string length is less than 0 or not an integer". I already the previous suggestion to the problem but it's not working to men.

Any other ideas??

Edited by Leti - 19 Oct 2015 at 2:57am
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.032 seconds.