Tema: Qreport??
Ver Mensaje Individual
  #3  
Antiguo 05-01-2005
fmonte fmonte is offline
Miembro
 
Registrado: ago 2004
Ubicación: Tandil
Posts: 67
Reputación: 22
fmonte Va por buen camino
Código Delphi [-]
 procedure
Código Delphi [-]
 TfrConVentas.SpeedButton4Click(Sender: TObject);
  var
  Bm:TbookMark;
  
  begin
  nOpcion:=0;
  nPages:=0;
  BM:=DmVil.Fact.GetBookMark;
  DmVil.Fact.DisableControls;
  
  DmVil.fact.Filter:='Numero ='+QuotedStr(DmVil.Factnumero.value);
  DmVil.fact.Filtered:=True;
  
    Application.CreateForm(TfrLptFactura,frLptFactura);
    frlptFactura.LptFactura.Prepare;
  
    nPages:=frlptFactura.LptFactura.QRPrinter.PageCount;
    noPcion:=0;
    frLptFactura.LptFactura.PreviewModal;
    frLptFactura.Close;
  
      DmVil.Fact.GotoBookmark(Bm);
      DmVil.Fact.EnableControls;
      DmVil.Fact.FreeBookMark(Bm);
  end;
  
  
  procedure TfrLptFactura.LptFacturaBeforePrint(Sender: TCustomQuickRep;
    var PrintReport: Boolean);
  begin
  
  lbPaginas.caption:='/ '+IntToStr(nPages);
Hola no entiendo el codigo, primero no se que es el componente "DmVil" y me parece que tiene q ser mas sensillo, mira yo me base en los ejemplos que viene con delphi 6 y creo q la cantidad de Paginas es "Qrep1.QRPrinter.PageCount", pero no se yo lo segui y no se en donde ponerlo a este codigo, porque al principio es 1 y en algun momento se vuelve el total y ahi en donde yo puse el codigo para que muestre pero no me lo cambia. Te paso algo de codigo:
Código Delphi [-]
 ////////////////////////////////////////////////////////////////////////////////////
 //En este formulario tengo el TQuictReport//
 procedure TProdVend.QRep1Preview(Sender: TObject);
 begin
   with Form3 do
   begin
     QRPrev.QRPrinter := TQRPrinter(Sender); //Mostrar el texto correspondiente
     sePage.Value := QRPrev.QRPrinter.PageNumber; //Inicializar valores
     QRPrev.PageNumber:=sePage.Value;
     sePage.Value := 1;
     sePage.MinValue := 1;
     sePage.MaxValue := QRPrev.QRPrinter.PageCount;
     QRPrev.Zoom := 100;
     ZoomTo100.Down := True;
     spZoom.Value := 100;
     form3.Caption:= 'MOVIMIENTOS DIARIOS';
     form3.StBar.Panels[2].Text := 'Nombre : ' + 'MOVIMIENTOS DIARIOS';
     Show;
     Qrep1.QRPrinter.PageCount;
   end;
 end;
 ////////////////////////////////////////////////////////////////////////////////
 //En este formulario tengo el TQRPreview//
 procedure TForm3.QRPrevPageAvailable(Sender: TObject; PageNum: Integer);
 begin
   sePage.MaxValue := PageNum; //Ajustar el contador y la
   StBar.Panels[0].Text := 'Pag. 1/' + IntToStr(PageNum); //barra de tareas
   MaxPag := PageNum;
 end;
 ///////////////////////////////////////////////////////////////////
 procedure TForm3.sePageChange(Sender: TObject);
 begin
   QRPrev.PageNumber := sePage.Value;
   StBar.Panels[0].Text := 'Pag. ' + IntToStr(sePage.Value) + '/' + IntToStr(MaxPag);
 end;
 ////////////////////////////////////////////////////////
 procedure TForm3.sbFirstPageClick(Sender: TObject);
 begin
   sePage.Value := 1;
 end;
 //////////////////////////////////////////////////////////
 procedure TForm3.sbNextPageClick(Sender: TObject);
 begin
   if sePage.Value < QRPrev.QRPrinter.PageCount then
     sePage.Value := sePage.Value + 1;
 end;
 ///////////////////////////////////////////////////////////
 procedure TForm3.sbPreviousPageClick(Sender: TObject);
 begin
   if sePage.Value > 1 then
     sePage.Value := sePage.Value - 1;
 end;
 //////////////////////////////////////////////////////////////////////////
 procedure TForm3.sbLastPageClick(Sender: TObject);
 begin
   sePage.Value := QRPrev.QRPrinter.PageCount;
 end;
 //////////////////////////////////////////////////
 procedure TForm3.PrintSetupClick(Sender: TObject);
 begin
   with ProdVend.QRep1 do
   begin
     tag := -1;
     PrinterSetup;
     if tag = 0 then
       print;
   end;
 end;
 ////////////////////////////////////////////////////////////////////
 procedure TForm3.PrintClick(Sender: TObject);
 begin
   QRPrev.qrprinter.Print;
 end;
 ///////////////////////////////////////////////////////////////

Última edición por marcoszorrilla fecha: 05-01-2005 a las 21:50:46.
Responder Con Cita