Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with printing listbox contents

Status
Not open for further replies.

jefargrafx

Instructor
May 24, 2001
273
US
trying to print ony the content of a list box to a printer.

I've go the concept down

move the contents to an empty clip and print the clip.

I'm using:

_root.mcPrinter.txtOut.text = contactListBox_lb.getItemAt(1).label;

where contactlistbox_lb is the listbox content I want to print.

the above code will print the info at item item "1"

I want to print it all, reguadless of how many items

any ideas jef
 
okay...my concept is wrong,

where as I can capture the contents of the listbox in a mc if the contents is larger than 8.5x11 page, it's go to the next page, it just doesn't print.

so.....

anyone ever do this?


just print the contents of a list box reguardless of how long the contents is in the box?

let me know jef
 
Are you saying, you got it to print all items, but it now just doesn't print the additional items on page 2, if a page 2 is needed? How many items do you have in that listbox? Regards,

oldman3.gif
 
sorry for the delay, been out of town.

yes you are right,

the list box could be any number, it a list of contact names and numbers. Could be 50 could be as many as the player cache will allow (hunderds)

if we print more than one page the printer just skips the rest that won't fit on the page

what a pain

any ideas jef
 
okay I go this workng by passing a vaiable to javascript in and new html page adn then printing that page.

however, I'm sure there is a better way to get the contents of the listbox into the variable than:

listboxContent00 = &quot;<FONT COLOR=\&quot;#FFFFFF\&quot;>&quot;
+ contactListBox_lb.getItemAt(0).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(1).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(2).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(3).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(4).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(5).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(6).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(7).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(8).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(9).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(10).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(11).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(12).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(13).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(14).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(15).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(16).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(17).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(18).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(19).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(20).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(21).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(22).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(23).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(24).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(25).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(26).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(27).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(28).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(29).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(30).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(31).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(32).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(33).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(34).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(35).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(36).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(37).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(38).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(39).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(40).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(41).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(42).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(43).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(44).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(45).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(46).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(47).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(48).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(49).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(50).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(51).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(52).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(53).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(54).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(55).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(56).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(57).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(58).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(59).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(60).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(61).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(62).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(63).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(64).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(65).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(66).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(67).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(68).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(69).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(70).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(71).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(72).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(73).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(74).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(75).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(76).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(77).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(78).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(79).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(80).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(81).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(82).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(83).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(84).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(85).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(86).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(87).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(88).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(89).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(90).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(91).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(92).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(93).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(94).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(95).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(96).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(97).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(98).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(99).label +
&quot;<BR>&quot; + contactListBox_lb.getItemAt(100).label +
&quot;</font>&quot;;


see what I mean,

and I'd liek not to stop at 100?

what do ya think

while statement?

let me know jef
 
okay I'm getting it, maybe only a little help is needed?


for(i=0; i < contactListBox_lb.getLength(); i++){
ListBoxFN = &quot;<BR>&quot; + contactListBox_lb.getItemAt(i).label;
trace(ListBoxFN);

}
listboxContent00 = ListBoxFN;


here my trace works fine in the out put window, but my variable only contains the last entry in my list?

what ami doing wrong? jef
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top