Ver Mensaje Individual
  #4  
Antiguo 27-07-2007
Avatar de BlueSteel
[BlueSteel] BlueSteel is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Concepción - Chile
Posts: 2.310
Reputación: 24
BlueSteel Va por buen camino
mi ejemplo de impresion de StringGrid a QReport

para empezar suponemos que ya tenemos un StringGrid (para este caso de 8 columnas y de X filas9

toda la información ya esta ingresada...

además, debes tener un QReport, y en la banda Detail debes porner tantos QRLabel como columnas tenga tu StringGrid

en el evento OnNeedData del QReport pones el sgte codigo
Código Delphi [-]
if ItemIndex < xCodigo.StrinGrid.RowCount then
begin
      QRLabel1.Caption := xCodigo.StrinGrid.Cells[0, ItemIndex];
      QRLabel2.Caption := xCodigo.StrinGrid.Cells[1, ItemIndex];
      QRLabel3.Caption := xCodigo.StrinGrid.Cells[2, ItemIndex];
      QRLabel4.Caption := xCodigo.StrinGrid.Cells[3, ItemIndex];
      QRLabel5.Caption := xCodigo.StrinGrid.Cells[4, ItemIndex];
      QRLabel6.Caption := xCodigo.StrinGrid.Cells[5, ItemIndex];
      QRLabel7.Caption := xCodigo.StrinGrid.Cells[6, ItemIndex];
      QRLabel8.Caption := xCodigo.StrinGrid.Cells[7, ItemIndex];
end;
Inc(ItemIndex);
MoreData := ItemIndex <= xCodigo.StrinGrid.RowCount;

xCodigo corresponde al formulario en donde esta el StringGrig...

y en el evento OnStartPage pones esto
Código Delphi [-]
ItemIndex1 := 1;

y despues solo debes imprimir
__________________
BlueSteel

Última edición por BlueSteel fecha: 27-07-2007 a las 21:05:28.
Responder Con Cita