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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Start position is less than 1" Error 1

Status
Not open for further replies.

sergiogove

Programmer
Oct 17, 2002
19
MT
hi
I have a report in Crystal 8.5
When i open this report from crystal itself, it's fine but when i call it from my application, it gives me an error "Start position is less than 1"

ANy ideas why this happens ?
Thanks
sergio.
 
Do you have any formulas in the report?
What happens if you try to launch a report without any formulas? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
I have several reports, some with formulas and some without. They all run fine.

It's only this one report that does not.

sergio.
 
Deos this report have any formulas that look at string position numbers? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Because one is trying to hit position zero, which will generate an error. Post one or two of these formulas from that report.
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
The report is intended to print cheques and I have this formula to extract the hundreds figure from a net value and convert it to words:

UpperCase(ToWords (val(Mid (ToText ({cPayslip.NET},0 ),length(ToText ({cPayslip.NET},0 )) -2, 1)),0))

Like this I have others for the Tens and Units.
Do you want to see them as well ?

Thanks
Sergio.
 
Looks like it will fail if the amount is less than one hundred.
Check the size before you use this formula. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
You were right !!!

The first digit was infact a zero and so it was crashing. I did the formulas programmatically and everything worked out fine.

Thank you for your invaluable help Mr. Hamady

Sergio.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top