Ver Mensaje Individual
  #3  
Antiguo 28-03-2011
Diana Carolina Diana Carolina is offline
Miembro
NULL
 
Registrado: nov 2010
Posts: 30
Reputación: 0
Diana Carolina Va por buen camino
imprimir y vista preliminar

ok...bueno anteriormente el reporte funcionaba correctamente...es decir el boton imprimir del formulario y el imprimir que esta en la vista preliminar mostraban el reporte completo, me toco meterle la validacion de qrynuevo por un cambio en el nombre de un campo en una tabla, despues de ese cambio me sucedio el problema con el imprimir de la vista preliminar...los eventos afterprint y beforeprint estan programados.

Código Delphi [-]
procedure TFrmRepFormulario.spbPreliminarClick(Sender: TObject);
begin
  inherited;
  if Qrytipopersona.AsString = 'A' then
    begin
     VarTipoIdCl := Qrytipopersonatipo.AsString;
     ppReportepers1.DeviceType := dtScreen;
     ppReportepers1.Print;
    end
  else
    begin
     VarTipoIdCl := Qrytipopersonatipo.AsString;
     ppReportepers2.DeviceType := dtScreen;
     ppReportepers2.Print;
    end;
  Qrynuevo.Close;
  if FrmPrincipal.QryperteneceFirma.AsString = '001' then
     begin
          Qrynuevo.SQL.Strings[2]:='A.ALGO,';
          Qrynuevo.SQL.Strings[11]:='AND OP.ALGO = A.ALGO';
     end
   else
      begin
          Qrynuevo.SQL.Strings[2]:='A.OTRO,';
          Qrynuevo.SQL.Strings[11]:='AND OP.OTRO = A.ALGO'
      end;

  Qrynuevo.open;
end;

procedure TFrmRepFormulario.spbImprimirClick(Sender: TObject);
var
  i : Integer;
  Pers1,Pers2 : Boolean;
begin
  inherited;
  Pers1 := False;
  Pers2 := False;
  for i := 0 to Qrypersona.RecordCount -1 do
  begin
    if Qrytipopersona.AsString = 'A' then
      begin
       VarTipoIdCl := Qrytipopersonatipo.AsString;
       ppReportepers1.DeviceType := dtPrinter;
       if Pers1 then
         begin
           ppReportepers1.ShowPrintDialog := False;
           ppReportepers1.ShowCancelDialog := False;
         end;
       ppReportepers1.Print;
       Pers1 := True;
      end
    else
      begin
       VarTipoIdCl := Qrytipopersonatipo.AsString;
       ppReportepers2.DeviceType := dtPrinter;
       if PersNat then
         begin
           ppReportepers2.ShowPrintDialog := False;
           ppReportepers2.ShowCancelDialog := False;
         end;
       ppReportepers2.Print;
       Pers2 := True;
      end;
    Qrytipopersona.FindNext;
   end;
  Qrynuevo.Close;//***Aqui agregue
if FrmPrincipal.QryperteneceFirma.AsString = '001' then
     begin
          Qrynuevo.SQL.Strings[2]:='A.ALGO,';
          Qrynuevo.SQL.Strings[11]:='AND OP.ALGO = A.ALGO'
     end
   else
      begin
          Qrynuevo.SQL.Strings[2]:='A.OTRO,';
          Qrynuevo.SQL.Strings[11]:='AND OP.OTRO = A.ALGO'
      end;

  Qrynuevo.open;  
end;

Cuando le doy click en vista preliminar muestra el fromulario con toda la informacion(Completo),,,pero al darle click en el boton de imprimir que sale en esa misma ventana, es decir la ventana con el reporte que saca el report builder...no imprime el formulario completo

Última edición por Casimiro Noteví fecha: 29-03-2011 a las 22:32:07. Razón: completar
Responder Con Cita