Invoice number in report contains alpha numeric upto 15 ch length(MAN-12-13-00001) , but when converting to excel i want to print only numeric values(00001).i want code to print in excel (00001)
I hope this code is work, write this code OnAfterGerRecord()
Str1 := FORMAT('MAN-12-13-0001');
FOR I := STRLEN(Str1) DOWNTO 0 DO BEGIN
Pos := STRPOS(Str1,'-');
IF Pos <> 0 THEN
Count1 := Pos;
Str1 := COPYSTR(Str1,Pos+1,STRLEN(Str1));
I := Pos;
END;
Str1 := 'CHO-12-13-0001';
ActualStr := COPYSTR('MAN-12-13-0001',(STRLEN(Str1) -Count),STRLEN(Str1));
MESSAGE('%1',INSSTR(ActualStr,'''',1)); .........This for Excel.
Comments
Working with NAV since 2001
“Knowledge speaks, but wisdom listens” - Jimi Hendrix
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
(I don't know if this is an official rule).
This is a community website were we help each other expecting that the people we help have tried what they can to solve the issue themselves.
Hence the question, what have you tried and where does your code stop working.
I understand that not everyone speaks or types perfect english but please realise that everyone is a volunteer.
regards
Prashanth
how about onaftergetrecord of the dataitem.
if the length & style of your # is always the same you could use copystr
http://msdn.microsoft.com/en-us/library/dd338944.aspx
good luck!
Download & print w1w1adg.pdf
http://www.microsoft.com/en-us/download ... x?id=24432
Read the section about Reports
http://www.BiloBeauty.com
http://www.autismspeaks.org
Str1 := FORMAT('MAN-12-13-0001');
FOR I := STRLEN(Str1) DOWNTO 0 DO BEGIN
Pos := STRPOS(Str1,'-');
IF Pos <> 0 THEN
Count1 := Pos;
Str1 := COPYSTR(Str1,Pos+1,STRLEN(Str1));
I := Pos;
END;
Str1 := 'CHO-12-13-0001';
ActualStr := COPYSTR('MAN-12-13-0001',(STRLEN(Str1) -Count),STRLEN(Str1));
MESSAGE('%1',INSSTR(ActualStr,'''',1)); .........This for Excel.