Jump to content

Tables using variable data


dave2297

Recommended Posts

Hi all

 

Dan Korn and esmith have helped me tremendously with my issues regarding diagonal strikethroughs

 

http://forums.printable.com/showthread.php?t=737

 

and Dan kindly suggested that I may do better to set up a document using tables and directed me to the Frodo Travel Tutorial - which would be fine if I wanted to create fixed text tables in a text editor and then import the resource as a tagged text file. I don't want to do this - I would rather create a resource in the rule editor using 'quoted string literals 'because then I would be able to assign cell values to fields in a data source.

 

I have read the user guide section regarding tables and can't find the correct syntax to use anywhere - I cannot validate my code as it keeps telling me I am entering an unexpected xml statement?? As you have probably guessed I am a complete newcomer to JavaScript (but I'm trying - honestly)

 

I don't want to bore anyone with the intricacies but just wondered if anyone may be able to direct me to (or send me) any meaningful examples of tables created in the rule editor as 'quoted string literals' that call in variable data and then hopefully I can work out the structure and syntax and apply it to my job?

 

Thanks :confused:

Link to comment
Share on other sites

Hi Dan

 

Thanks for the reply, I had looked at that thread and had started to use it as the basis for building my table. I have got this far:

var myTable = '<table columns =5><column width=10000><column width = 40000><column width = 10000><column width = 10000><column width = 10000>';

for(var i=1;Field('DESC'+i)!='';i++)

{

myTable += '<row><cell><f name = "FrutigerLT 55 Roman"><z newsize="10">' + Field("CODE"+i)+'<cell><z newsize="';

if(Len(Field("DESC"+i))>20)

myTable += '14';

else

myTable += '16';

 

myTable += '">' + Field("DESC"+i);

myTable += '<cell><z newsize = "20">'+ Field("DISPLIST"+i);

myTable += '<cell><f name = "Frutiger 77BlackCn"><z newsize="28">'+ "SALE";

myTable += '<cell>'+ Field("DISPSALE"+i);

myTable += '<row><cell><cell><f name = "FrutigerLT 55 Roman"><z newsize="10">' + Field("SUBHEAD"+i);

}

myTable += '</table>';

 

return myTable;

Now all I need to figure out is how to align 'bottom' the contents of a row and, could you possibly tell me if it is possible to adjust the leading between rows - depending on whether the contents of field 'SUBHEAD'+i is populated or not?

 

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...