Report filter dates

Report filter dates

Postby Silvio.Falconi » Wed Oct 07, 2020 4:07 pm

I wish print a report from a day to a day
I'm using Tcalex class and citas.dbf

the user select the date pick and when the report is activated

ACTIVATE REPORT oRep FOR dDesde <= citas->dStart .AND. citas->dend <= dHasta

but not execute this command but print only the one date

Code: Select all  Expand view


function  Imprime(  dFecha )

   local oRep
   local oFont1, oFont2, acor, oDlg1, oGet1, oGet2, oGet3, oBot1, oBot2
   local lRep    := .f.
   local dDesde
   local dHasta
   local mestado := 1


   Local  nBottom   := 12
   Local  nRight    := 60
   Local  nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local  nHeight := nBottom * DLG_CHARPIX_H
   local  oBtnPrt,oBtnExit
   local  aGet[3]


   DEFAULT dFecha := oApp():oCalex:dDateSelected

   dDesde := dFecha
   dHasta := dFecha  + 7

   DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10
   DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD



   DEFINE DIALOG oDlg1          ;
         SIZE nWidth, nHeight   PIXEL  ;
         TITLE "Stampa appuntamenti"

            oDlg1:lHelpIcon := .F.
            oDlg1:nStyle    := nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION,  4 )
           * oDlg1:SetFont( oFont1 )



             @ 12, 05 SAY "Stato:"                   OF oDlg1 PIXEL SIZE 50,12
             @ 10, 45 COMBOBOX oGet1 VAR mestado OF oDlg1 SIZE 60,12 PIXEL ;
                                 ITEMS { "Tutte", "Solo pendenti", "Solo effettuate" }

             @ 44,05     SAY "Data Inizio"            OF oDlg1  SIZE 50,10 PIXEL      TRANSPARENT
             @ 44,108    SAY "Data Fine"              OF oDlg1  SIZE 50,10 PIXEL      TRANSPARENT
             @ 42,45  DTPICKER oGet2 VAR  dDesde  OF oDlg1  SIZE 50,10 PIXEL UPDATE
             @ 42,148 DTPICKER oGet3 VAR dHasta   OF oDlg1  SIZE 50,10 PIXEL UPDATE



         @ 70, 92  BUTTON oBtnPrev ;
                PROMPT  "&Stampa"  OF oDlg1 PIXEL SIZE 45, 12 ;
                ACTION  oDlg1:end( IDOK )

          @ 70, 188 BUTTON oBtnExit;
                PROMPT "&Annulla"   OF  oDlg1 PIXEL SIZE 45, 12 ;
                ACTION  oDlg1:end( IDCANCEL )


          ACTIVATE DIALOG oDlg1 CENTER

    IF oDlg1:nresult == IDOK


   REPORT oRep ;
       TITLE "Appuntamenti" + " dal " + DTOC( dDesde ) + " al " + DTOC( dHasta ) LEFT ;
       FONT  oFont1, oFont2 ;
       HEADER OemToAnsi( "01" ) RIGHT ;
       FOOTER "pagina: " + STR( oRep:nPage, 3 ) ,"Data: " + DToc( DATE() ) LEFT ;
       PREVIEW CAPTION "Appuntamenti"


   COLUMN TITLE "Codice"      DATA citas->idx     SIZE 07 FONT 1
   COLUMN TITLE "Cliente"     DATA Left( citas->subject, 40 ) SIZE 20 FONT 1
   COLUMN TITLE "Data"        DATA citas->dStart SIZE 08 FONT 2
   COLUMN TITLE "Da"          DATA TRANSFORM( citas->start, "999:99" ) SIZE 05 FONT 1 RIGHT
   COLUMN TITLE "a"           DATA TRANSFORM( citas->end,   "999:99" ) SIZE 05 FONT 1 RIGHT
   COLUMN TITLE "Note"        DATA citas->text    SIZE 25 FONT 1 MEMO
   COLUMN TITLE "Data"        DATA citas->dend SIZE 08 FONT 2


   // Digo que el titulo lo escriba con al letra 2

   oRep:oTitle:aFont[1] := {|| 2 }
   oRep:oTitle:aFont[1] := {|| 2 }
   oRep:bInit           := {|| citas->( DbGoTop() ) }

   //oRep:bSkip := {|| ( ::cAlias )->Skip() }

   END REPORT

   ACTIVATE REPORT oRep FOR  dDesde <= citas->dStart .AND. citas->dend <=  dHasta  ;
                    ON POSTEND  (oRep:Say(1, 'Totale appuntamenti: '+Tran(oRep:nCounter, '@ 999,999'), 1) )
    endif                

   RETURN nil
//-------------------------------------------------------------------------------------------//


How I can resolve it ?



I tried with EmadDbu and the filter run ok

Image


I made the same on fwh source why not run ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: Report filter dates

Postby artu01 » Wed Oct 07, 2020 4:46 pm

Silvio:
Add it
Code: Select all  Expand view

select citas
index on dtos(fecha) tag 1 temporary
...
...
...


oRep:bInit           := {|| citas->( DbGoTop(), citas->(dbseek(dtos(dDesde),.t.) ) }
 
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql
artu01
 
Posts: 400
Joined: Fri May 11, 2007 8:20 pm
Location: Lima

Re: Report filter dates

Postby Silvio.Falconi » Wed Oct 07, 2020 5:41 pm

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: Report filter dates

Postby Silvio.Falconi » Wed Oct 07, 2020 6:00 pm

Now run ok only I not understood why ncounter give me a number bad

Code: Select all  Expand view
ON POSTEND  (oRep:Say(1, 'Totale appuntamenti: '+Tran(oRep:nCounter, '@ 999,999'), 1) )


I tried to make a report from 08/10 to 09/10

Image

give me 229 records ??????

I see only 19 records !!!!!!!!!!!!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: Report filter dates

Postby Silvio.Falconi » Wed Oct 07, 2020 6:33 pm

on METHOD Skip( n ) CLASS TReport

we found

::nCounter++

ok

but there is a bfor codeblock it must execute the skip of the ncounter for the bfor codeblock and not entire the archive
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: Report filter dates

Postby Silvio.Falconi » Wed Oct 07, 2020 7:17 pm

RESOLVED



Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 17 guests