mnCnPrintBooks_click( menuItem : MenuItem input ) updating;

vars
	rpt		: RptBooksWeHold ;
	bwh	: BookWeHold ;
	liby	: PubLibrary;
	bk		: Book;
	
begin
	liby := global.lib;
	create rpt ;
	app.printer.printPreview	:= true ;
	app.printer.setMargins ( Print_Landscape, 15, 15, 15, 15 ) ;		// top, bottom , left, right

	foreach bk in liby.allBooks_AuthTitleCate do
		bwh := bk.myBookWeHold;
		rpt.laAccessn.caption	:= bwh.accessionNo ;
		rpt.laBookCl.caption	:= bwh.myBook.myCategory.name;
		rpt.laAuthor.caption		:= bwh.myBook.author ;
		rpt.laTitleBk.caption		:= bwh.myBook.name & "   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . ." ;						// the title
		if bwh.numbXIssued<= 0 then
			rpt.laTimesl.caption		:= "0" ;
		else
			rpt.laTimesl.caption		:= bwh.numbXIssued.String ;
		endif;	
		if bwh.isLent then
			rpt.laOnLoan.caption	:= bwh.dateDueBack.String ;
		else
			rpt.laOnLoan.caption	:= "<available>" ;
		endif ;
		app.printer.print ( rpt.frDetails ) ;							// This prints it
	endforeach ;
	app.printer.close ;
epilog
	delete rpt ;
end ;