Export to excel

Hi,
I am exporting to excel in that I wrote this code.
Address2 data type is text
OverLimitMsg data type is text
IF ExportToExcel THEN BEGIN
if Address2 <> ‘’ or OverLimitMsg <> ‘’ then begin
i += 1;
EnterCell(i,2,Address3,FALSE,FALSE,FALSE,’’,’’);
EnterCell(i,9,OverLimitMsg,FALSE,FALSE,FALSE,’’,’’);
End;
End;
Problem is:

Microsoft Dynamics NAV Classic

Type conversion is not possible because 1 of the operators contains an invalid type.
Text OR Text

OK

Hi

I got my solution.

Try

if (Address2 <> ‘’) or (OverLimitMsg <> ‘’ )then begin

Hi Srikanth,

Please share your solution also with us not only problems/questions [Y]

Thanks.

Hi Manish,

Thanks for Reply, and one more Problem in this:

Blocked data type is Option

EnterCell(i,4,Customer.Blocked,FALSE,FALSE,FALSE,’’,’’);

Problem is:


Microsoft Dynamics NAV Classic


Type conversion is not possible because 1 of the operators contains an invalid type.

Text := Option


OK


Did you try FORMAT(Customer.Blocked) in above code?

Hi Mohana

I tried that but no use

What do you mean by no use?

are you still getting error?

Hi All,

I got Solution.

Solution is:

CASE Customer.Blocked OF

Customer.Blocked ::ship:

EnterCell(i,4,‘Ship’,FALSE,FALSE,FALSE,’’,’’);

Customer.Blocked ::Invoice:

EnterCell(i,4,‘Invoice’,FALSE,FALSE,FALSE,’’,’’);

Customer.Blocked ::All:

EnterCell(i,4,‘All’,FALSE,FALSE,FALSE,’’,’’);

ELSE

EnterCell(i,4,’ ‘,FALSE,FALSE,FALSE,’’,’’);

END;

What Mohana is saying, is that you don’t need your CASE statement, you can just as well replace it all with one line:

EnterCell(i,4,FORMAT(Customer.Blocked),FALSE,FALSE,FALSE,'','');