excel and nav ASCII code

nebotnebot Member Posts: 4
in excel- i copy cell
in NAV - paste. copyng my info+two square. this is symbols - char(13) and char(10).
In ONE computer - this symbols is visible (square).
In another computer - invisible (space).

I need make symbols visible. (square, not space).

OS - equall.
regional setting - equall.
version excel -all the same.
system font - change. No result.

I need help))
Sorry my english).
Thanks.

Comments

  • ppavukppavuk Member Posts: 334
    MakeCode(VAR Text : Text[250]) : Integer
    CharsToRemove[1] := 13; //CR
    Text := DELCHR(Text,'=',CharsToRemove) ;
    CharsToRemove[2] := 10; //LF
    Text := DELCHR(Text,'=',CharsToRemove) ;
    CharsToRemove[3] := 9; //TAB
    Text := DELCHR(Text,'=',CharsToRemove) ;
    

    put this code to codeunit 1 and assign ID 109 to finction.

    Amend the maketext function in same codeunit.
    MakeText(VAR Text : Text[250]) : Integer
    
    CharsToRemove[1] := 13;
    Text := DELCHR(Text,'=',CharsToRemove) ;
    CharsToRemove[2] := 10;
    Text := DELCHR(Text,'=',CharsToRemove) ;
    CharsToRemove[3] := 9;
    Text := DELCHR(Text,'=',CharsToRemove) ;
    
    
    
    Position := 1;
    Length := STRLEN(Text);
    ReadCharacter(' ',Text,Position,Length);
    IF NOT ReadSymbol('?',Text,Position,Length) THEN
    

    this will eliminate the excel copy/paste problem as CR/LF and TAB will be removed on validate of any text/code textbox.
  • nebotnebot Member Posts: 4
    Thanks, but i want see this symbols in table.
    users can copy excel and i dont see in table where bug.
  • ppavukppavuk Member Posts: 334
    For what you want to see garbage data? This symbols are meaningless, it is a bug in clipboard, nothing else. Data in excel do not contain this CR/LF, so this symbols should not hit database. Even more, if you got CR/LF in text and code fields - this will cause various issues in future, for example, you will be surprised why your data can not be published on webservice, or exported to XML. Even simple dataport will break - as CRLF is end of line. Imagine you got CR/LF in customer name - what happens with your text export?
  • ppavukppavuk Member Posts: 334
    Even more, it's make sense to run the same process on all text\code fields to eliminate CR/LF and TAB symbols from text/code data.

    In fact, you don't need to see them - you need to prevent them to be entered, which my code will do.
  • nebotnebot Member Posts: 4
    I want data entry user to see that there is extra symbols. I do not want to fix later))
    this is bug operation system, and I'm looking for a solution, not a crutch.
    but your code saved me temporary. Very thanks)
  • ppavukppavuk Member Posts: 334
    actually there is no other solution for your problem. MS never bothered to fix this in classic client.
  • kapamaroukapamarou Member Posts: 1,152
    In my opinion this is not a bug.

    Tell your user not to copy the Cell but the cell's value from the Formula Bar.
  • ppavukppavuk Member Posts: 334
    We a here to make customer life easier, aren't we?

    This is a bug, as user can put unwanted rubbish data into system.
Sign In or Register to comment.