XBrowse: report header and footer

XBrowse: report header and footer

Postby Enrico Maria Giordano » Wed Dec 16, 2020 8:43 am

Dear friends, I need to make a report from an XBrowse (oBrw:Report()) with an header in the first page and a footer in the last page. Is it possible?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8502
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse: report header and footer

Postby Enrico Maria Giordano » Wed Dec 16, 2020 2:51 pm

Solved for footer:

oRpt:bPostEnd = { || oRpt:Say( ... ) }

Any ideas for header? I'm trying with oRpt:bInit but it prints after the columns header.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8502
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse: report header and footer

Postby FranciscoA » Wed Dec 16, 2020 5:17 pm

Enrico.
Try this, please:
Code: Select all  Expand view
  ACTIVATE REPORT oReport ;
      ON ENDPAGE ( oReport:oHeader := TrLine():New({}) , oReport:oTitle := TrLine():New({}) , oReport:nTitleRow := 0 )
 
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2157
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: XBrowse: report header and footer

Postby Enrico Maria Giordano » Wed Dec 16, 2020 5:43 pm

Thank you. Unfortunately, the page number is overwritten by the double line from the second page on. I tried to reduce the height of the list without results.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8502
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse: report header and footer

Postby FranciscoA » Wed Dec 16, 2020 6:23 pm

Enrico Maria Giordano wrote:Thank you. Unfortunately, the page number is overwritten by the double line from the second page on. I tried to reduce the height of the list without results.

EMG


Enrico, can you test?
Code: Select all  Expand view
//------------------------------------------//
Function TituSoloEnPag1()
local oReport, oFont

   DBUSEAREA(.T.,,"CUSTOMER","CUST",.T.)
   DBGOTOP()

   DEFINE FONT oFont NAME "ARIAL" SIZE 0,-10

   REPORT oReport ;
      TITLE "PROBANDO TITULO-HEADER SOLO EN PRIMERA PAGINA",;
            "UTILIZAMOS 'CUSTOMER.DBF'",;
            "LISTADO DE NUESTROS CLIENTES" ;
      FONT oFont;
      HEADER Dtoc(Date()), "Pag: " + str(oReport:nPage,3) RIGHT ;
      PREVIEW

      COLUMN TITLE "FIRST"  DATA Field->FIRST  SIZE 20
      COLUMN TITLE "LAST"   DATA Field->LAST   SIZE 20
      COLUMN TITLE "STREET" DATA Field->STREET SIZE 30
      COLUMN TITLE "CITY"   DATA Field->CITY   SIZE 20
      COLUMN TITLE "STATE"  DATA Field->STATE  SIZE 10
   ENDREPORT

   ACTIVATE REPORT oReport ;
      ON ENDPAGE ( oReport:oTitle := TrLine():New({}) )

      //Header y Title solo en la primer pagina.
      //ON ENDPAGE ( oReport:oHeader := TrLine():New({}) , oReport:oTitle := TrLine():New({}) , oReport:nTitleRow := 0 )

      //Header y Title en pag 1, y en siguientes header y espacio vacio del title.
      //ON ENDPAGE ( oReport:oTitle := TrLine():New({}) )

      CUST->(DBCLOSEAREA())
      RELEASE oFont

Return nil


 
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2157
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: XBrowse: report header and footer

Postby Enrico Maria Giordano » Wed Dec 16, 2020 6:41 pm

Thank you, Francisco. In your sample, the header is printed on the first page, ok, but the header space is left blank from the second page on.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8502
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse: report header and footer

Postby FranciscoA » Wed Dec 16, 2020 8:02 pm

Enrico Maria Giordano wrote:Thank you, Francisco. In your sample, the header is printed on the first page, ok, but the header space is left blank from the second page on.

EMG


Enrico, here.
Code: Select all  Expand view
//------------------------------------------//
Function TituSoloEnPag1()
local oReport, oFont

   DBUSEAREA(.T.,,"CUSTOMER","CUST",.T.)
   DBGOTOP()

   DEFINE FONT oFont NAME "ARIAL" SIZE 0,-10

   REPORT oReport ;
      TITLE "PROBANDO TITULO-HEADER SOLO EN PRIMERA PAGINA",;
            "UTILIZAMOS 'CUSTOMER.DBF'",;
            "LISTADO DE NUESTROS CLIENTES" ;
      FONT oFont;
      HEADER Dtoc(Date()), "Pag: " + str(oReport:nPage,3) RIGHT ;
      PREVIEW

      COLUMN TITLE "FIRST"  DATA Field->FIRST  SIZE 20
      COLUMN TITLE "LAST"   DATA Field->LAST   SIZE 20
      COLUMN TITLE "STREET" DATA Field->STREET SIZE 30
      COLUMN TITLE "CITY"   DATA Field->CITY   SIZE 20
      COLUMN TITLE "STATE"  DATA Field->STATE  SIZE 10
   ENDREPORT

   ACTIVATE REPORT oReport ;
         ON ENDPAGE ( oReport:oTitle := TrLine():New({}), oReport:nTitleRow := oReport:oHeader:nHeight + oReport:nTopMargin )

      CUST->(DBCLOSEAREA())
      RELEASE oFont

Return nil
 

Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2157
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: XBrowse: report header and footer

Postby Enrico Maria Giordano » Wed Dec 16, 2020 8:27 pm

Great! Many thanks, Francisco! :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8502
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse: report header and footer

Postby FranciscoA » Wed Dec 16, 2020 8:35 pm

Nice to collaborate.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2157
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: XBrowse: report header and footer

Postby nageswaragunupudi » Wed Dec 30, 2020 3:52 pm

Thank you. Unfortunately, the page number is overwritten by the double line from the second page on. I tried to reduce the height of the list without results.

This is a bug. Happens when oRep:lJoin or oRep:lSeparator is true.
We will fix it soon and inform you.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10465
Joined: Sun Nov 19, 2006 5:22 am
Location: India



Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests