Quiero imprimir datos de 6 diferentes componentes: 2 textinput, 2 grillas y 2 labels, en una misma hoja, y no lo logro hacer,
traté esto:
Código :
public function Paraimprimir():void{
var trabajo: FlexPrintJob= new FlexPrintJob();
if (trabajo.start() != true)
return;
trabajo.addObject(labelnombre,FlexPrintJobScaleType.NONE);
trabajo.addObject(inputnombre,FlexPrintJobScaleType.NONE);
trabajo.addObject(labelfecha,FlexPrintJobScaleType.NONE);
trabajo.addObject(inputfecha,FlexPrintJobScaleType.NONE);
trabajo.addObject(grillaimprime,FlexPrintJobScaleType.NONE);
trabajo.addObject(gridpreciostotales,FlexPrintJobScaleType.NONE);
trabajo.send();
}
Pero me arroja lo que quiero en 6 diferentes hojas.
Vi este ejemplo en livedocs, pero no lo logro seguir por el hecho la libreria "Myprintview" que no dicen que es
Código :
import mx.printing.FlexPrintJob;
import myComponents.MyPrintView;
public function doPrint():void {
// Create a FlexPrintJob instance.
var printJob:FlexPrintJob = new FlexPrintJob();
// Start the print job.
if(printJob.start()) {
// Create a MyPrintView control as a child
// of the current view.
var formPrintView:MyPrintView = new MyPrintView();
addChild(formPrintView);
// Populate the print control's contact label
// with the text from the form's name,
// phone, and e-mail controls.
formPrintView.contact.text =
"Contact: " + custName.text + " " +
custPhone.text + " " + custEmail.text;
// Set the print control's data grid data provider to be
// the displayed data grid's data provider.
formPrintView.myDataGrid.dataProvider =
myDataGrid.dataProvider;
// Add the SimplePrintview control to the print job.
// For comparison, try setting the
// second parameter to "none".
printJob.addObject(formPrintView);
// Send the job to the printer.
printJob.send();
// Remove the print-specific control to free memory.
removeChild(formPrintView);
}
}
Espero una ayuda por ahi
