function formataddr problem.

previously, i had this in my report 310 - Vendor Labels. then, i tried to incorporate the “FormatAddr” codeunit inside mt report 310. However, i m not sure of the parameters that is pass into FormatAddr codeunit. For example, FormatAddr(VAR AddrArray: ARRAY[8] OF TEXT[90]; Name : TEXT[90]; Name2: TEXT[90]…) What does Name, Name2 meant? can someone please explain? ------------------------------------------------- code in 310-Vendor Labels -------------------------------------------------- FormatAddr.Vendor(VendAddr[ColumnNo],Vendor); IF RecordNo = NoOfRecords THEN BEGIN FOR i := ColumnNo + 1 TO NoOfColumns DO CLEAR(VendAddr[i]); ColumnNo := 0; END ELSE BEGIN IF ColumnNo = NoOfColumns THEN ColumnNo := 0; END;

Name, Name2 and so on are for corresponding fields in Vendor table.

i tried assigning a text array to every field of name but there ‘s an error saying text cannot be qual to char! whats wrong? IF Vendor.FIND(’-’) THEN REPEAT FOR i := 1 TO ARRAYLEN(Name) DO Name[i] := “Name”; END; UNTIL Vendor.Next = 0;

quote:


Originally posted by spiral
i tried assigning a text array to every field of name but there ‘s an error saying text cannot be qual to char! whats wrong? IF Vendor.FIND(’-’) THEN REPEAT FOR i := 1 TO ARRAYLEN(Name) DO Name[i] := “Name”; END; UNTIL Vendor.Next = 0;


You might want to try this: Name[i] := Vendor.Name; Anna

it still the same

this is from 310-vendor labels… OnAfterGetRecord() --------------------------- RecordNo := RecordNo + 1; ColumnNo := ColumnNo + 1; FormatAddr.Vendor(VendAddr[ColumnNo],Vendor); IF RecordNo = NoOfRecords THEN BEGIN FOR i := ColumnNo + 1 TO NoOfColumns DO CLEAR(VendAddr[i]); ColumnNo := 0; END ELSE BEGIN IF ColumnNo = NoOfColumns THEN ColumnNo := 0; END; the recordno and columnno adds up until the last record, but why the columnno is set to 0 after clear VendAddr? why must columnno be set to 0? i am modifying this 310-Vendor labels to make the report print 8 labels in a report.

If ColumNo = NoOfColumns then columnNo = 0 so when ColumnNo := ColumnNo +1 on the next onaftergetrecord ColumnNo = 1; Notice that If columnNo = Noofcolumns then columnNo := 0 it’s only IF (NOT RecordNo = NoOfRecords) (pay attention to the ELSE)… About the Name[i] := Vendor.Name error… did you set the dimensions on the variable Name??? or are you just using an string without dimensions? Regards

what dimension should i set it to?

Variables Name Text 30… if on that variable you don’t set on it’s properties dimensions (for creating an array of texts) you’re dealing with a single string… Differences: Name1 Text 30 Dimensions 0 Name2 Text 30 Dimensions 8 If you refer to Name1[1] you’ll get the first character of the text name1… If you refer to Name2[1] you’ll get the first text from the text array Name2… For choosing the dimensions just click on the variable and then on properties… Please, read the developer’s manual at least before start developing something… it’s not just copy & paste. Regards,

how do i set the space between each record when they are printed on the report? i got problem aligning the records according to my labels alignment

i try deleting some of the array from vendaddr[z,6] onwards, changing the font but the alignment does turn out to be what i want.

Did you tried changing the size of the report section (height)??? Usually you’ve to change the height on your report for adaptin to your label size, also setup properly the driver for the printer. Regards

my driver for printer is setup already. how do i change the report section height?

I think that if you don’t know just how to change the section height you should think about starting by reading the developers guide first and try the samples that are included on it before starting changing reports as the vendor labels. You can change the height of a section by draging and dropping on the botton limit of that section or clicking on properties of that section and setting the numeric value of the height. Sorry if i sound a bit rude… but i seriously think you should learn the basis before trying something more complicated… it’s like building a house… you cannot start by the roof. Regards,

yeah that i know. i tried that but it doesnt help at all last week.

RecordNo := RecordNo + 1; ColumnNo := ColumnNo + 1; IF Vendor.FIND(’-’) THEN REPEAT Name := Vendor.Name; Name2 := Vendor.“Name 2”; Addr := Vendor.Address; Addr2 := Vendor.“Address 2”; Contact := Vendor.Contact; CountryCode := Vendor.“Country Code”; UNTIL Vendor.NEXT = 0; i got an error := canot be performed on arrays. Choose a single array using an expression such as MyArray[…]

Sorry, guy, but this is the LAST time i answer a post on this subject. PLEASE, READ THE DEVELOPER’S MANUAL CAREFULLY AN DO THE TESTS INCLUDED BEFORE CONTINUING TRYING TO DEVELOP SOMETHING OR CONTACT YOUR NSC FOR DOING THE JOB IF YOU’RE NOT ABLE. The forum it’s supposed to be made for helping people on solving the problems, but not for replacing reading the manual and self-study. It’s really frustrating having to explain the same thing the error is clearly saying to you… Ok… let’s go… := cannot be performed on arrays. Chose a single array using and expresion such as myArray[]. Let’s say you’ve set a dimension (that means you’re creating an array) on the name variable… so you’ve that Name is having dimension 4. When you’re trying to set the values on Name like Name := Vendor.Name; you’re trying to give values to the components of the array. So, as dimension has a maximum of 4 components (is an array with 4 components), you can indicate it in 4 different ways: name[1] := vendor.name; name[2] := vendor.name; name[3] := vendor.name; name[4] := vendor.name; In general, you can express it as name[i] := vendor.name; where i it’s going from 1 to the value of the dimension. For each i value you can have a different (in this case text) value to keep, so you can say name[1] := vendor.name; name[2] := vendor.“Name 2”; name[3] := vendor.address; and if you try after that MESSAGE(’%1 %2 %3’,name[1],name[2],name[3]);you’ll see that it will show you a message with the vendor’s name, the vendor’s name2 and the vendor’s address. In your example, you’re not only trying to give a value without indicating what “component” of the array variable you’re trying to set, but you’re having a loop that in the end can be replaced with IF Vendor.FIND(’+’) THEN BEGIN … END; As you’re not increasing recordno or columno in the loop and just trying to replace the values in the variable. I hope you will at least fully read and try the developer’s guide included in the navision’s cd before continuing, as almost all these questions can easily be solved if you read carefully and do the tests included in that manual (inclusively more complex problems can be solved after reading it). As i told you before on this post, this is not intended to replace self-study and reading the books by having people telling you step-by-step how to do a certain development, but for helping when having problems. I’m sure that if you’re not having experience enough for doing such report and you’re seriously needing it your NSC will be really pleased of doing it for you (but they’ll probably charge you for their time). Regards,