RTC error: cannot convert from 'char' to 'byte'

poppinspoppins Member Posts: 647
edited 2012-12-17 in NAV Three Tier
Hi everyone,

After converting from Classic and trying to run a report in NAV 2009 RTC, I am getting the following error:
Compilation of assembly 'C:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\assembly\Report60015.dll' failed. This can be caused by differences between binaries in your installation or your database. Ensure that all installation components are consistent and up to date. Error details: c:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Report\Report60015.cs(1192,33) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.ALSystemString.SetChar(string, int, byte)' has some invalid arguments
c:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Report\Report60015.cs(1192,67) : error CS1503: Argument '3': cannot convert from 'char' to 'byte'
c:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Report\Report60015.cs(1193,33) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.ALSystemString.SetChar(string, int, byte)' has some invalid arguments
c:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Report\Report60015.cs(1193,67) : error CS1503: Argument '3': cannot convert from 'char' to 'byte'


The code lines causing the error are the following:
var1 = new NavText(1, ALSystemString.SetChar(var1, 0, NavFormatEvaluateHelper.Format(ALCompiler.ToNavValue(1000.1M))[1]));

var2 = new NavText(1, ALSystemString.SetChar(var2, 0, NavFormatEvaluateHelper.Format(ALCompiler.ToNavValue(1.1M))[1]));
where var1 and var2 are two text variables...

What shall I do???

Comments

  • ppavukppavuk Member Posts: 334
    I had same issue before. Looks there is an bug in c\al -> c# converter. Can you please post c/al code - I'll guide you how to fix.

    Basically, for some reason it is impossible to assign to char datatype a text constant in c# (which is fine in C\Al).

    in my case this was something like :
    Name	 DataType	Subtype	Length
    SingleQuoteChar	Char	
    
    Name	 ConstValue
    SingleQuote	'
    	
    //SingleQuoteChar := SingleQuote;
    SingleQuoteChar := 39;
    

    If you assigning an integer to char - c# code compiles just fine.
    I was opened a case on MS for this - but still no fix.

    It could be same issue in your case, as the error message is exactly the same.
Sign In or Register to comment.