Text length error
sunnyk
Member Posts: 280
Hi Guys,
i wrote this code to capture extended text lines based on the standard text code selected
Now when i run the report i got this message The text in the report exceeds the limit allowed by 110 characters.
When i deleted some lines from extended text conatining ~~~,*** or
its working fine.
Why is it so?
i wrote this code to capture extended text lines based on the standard text code selected
IF StandardTextCode <> '' THEN BEGIN
ExtTextLine.RESET;
ExtTextLine.SETRANGE(ExtTextLine."Table Name",ExtTextLine."Table Name"::"Standard Text");
ExtTextLine.SETRANGE(ExtTextLine."No.",StandardTextCode);
ExtTextLine.SETFILTER(ExtTextLine.Text,'<>%1','');
IF ExtTextLine.FINDSET THEN
REPEAT
IF (STRLEN(Stdtext1) + STRLEN(ExtTextLine.Text)) <= 1000 THEN
Stdtext1 := Stdtext1 + ' '+ExtTextLine.Text
ELSE IF (STRLEN(Stdtext2) + STRLEN(ExtTextLine.Text)) <= 1000 THEN
Stdtext2 := Stdtext2 + ' '+ExtTextLine.Text
ELSE IF (STRLEN(Stdtext3) + STRLEN(ExtTextLine.Text)) <= 1000 THEN
Stdtext3 := Stdtext3 + ' '+ExtTextLine.Text
ELSE IF (STRLEN(Stdtext4) + STRLEN(ExtTextLine.Text)) <= 1000 THEN
Stdtext4 := Stdtext4 + ' '+ExtTextLine.Text
UNTIL ExtTextLine.NEXT = 0;
END;
Now when i run the report i got this message The text in the report exceeds the limit allowed by 110 characters.
When i deleted some lines from extended text conatining ~~~,*** or
its working fine.
Why is it so?
0
Comments
-
Your error message doesn't sound like that's the problem, but maybe the length of Stdtext1 (or one of the other Text variables) and the length of ExtTextLine.Text are together exactly 1000 characters. If so, you would get an overflow because you add an extra blank space."Money is likewise the greatest chance and the greatest scourge of mankind."0
-
Hi Einstein,
The problem is in the code only. its wrong. Thank you.0 -
Without much detail it appears your checking to see if these two texts are Less than or equal to 1000.
if so, you're adding them together, but you are also new adding a new space [+' '+] so if was 1000 now it's 1001. So assuming STDTEXT1 length is 1000 you now have an overflow.
IF (STRLEN(Stdtext1) + STRLEN(ExtTextLine.Text)) <= 1000 THEN
Stdtext1 := Stdtext1 + ' '+ExtTextLine.Text0 -
Hi,
But this error comes when i place the textbox to capture StdText1+' '+Stdtext2. suppose if i place this text box in the fotter of a dataitem then rest of the things are printing but afater this footer the report is breaking. i checked the Max length property also of the text box and set the autoenter to yes.
the total no of characters in my extended lines are nearly 1051.
And when i place 2 texboxes to take stdtext1 and stdtext2 respectvely it working fine.
if this was an overflow error than half of the report will not print. Am i right?0 -
as said with little detail it's hard to say.
What's happening if the value is >?
The code appears not to handle this.
If this plus that <= to 1000 the str1 has a value if it's not you go right to str2 with no more regards to str1.
Have you thought about using an array?
Do you have code to clear the Stdtext(1-4) after it's run though?0 -
Hi Harry,
I doubt that i am trying to insert data in a text box of length more than 1056. I tried to put condition well before the variables have data of length 1000. so i modified my condition as stdText1 < 900 but keep the size of variable 1000. So whenever i used source expression of the textbox as StdText1 its working fine but when i use the sourceexp as StdText1 + StdText2 then only i get this error.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions