FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Custom report.
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Custom report.
Posted: Thu Nov 19, 2009 10:13 AM

How can I print a report in which each record has two lines and the data being printed comes from at least 4 different files. The data processing is no problem, how do I setup this report ? I've been looking through the samples folder but I can't find one. Thank you.

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Custom report.
Posted: Thu Nov 19, 2009 12:46 PM

I would suggest you to try FastReport od EasyReport.

Best regards,
Otto

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Custom report.
Posted: Thu Nov 19, 2009 03:50 PM

Hunter,

column title "PaidDate","InvDate" data oCash:dtepaid,oCash:invdte

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Re: Custom report.
Posted: Thu Nov 19, 2009 04:42 PM

James, Otto:

Thank you for your help.

Otto:
Which one is more flexible (has more options) EasyReport or FastReport ?

James:

Sorry, I don't understand your answer.

Is there a "pure" FiveWin example, I mean, done with FiveWin instead of a third party reporting engine ? Basically I want to compare all options available ? Thank you all.

Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Custom report.
Posted: Thu Nov 19, 2009 04:43 PM
Hunter:

Here is an other free way:

Define the columns with empty data

Code (fw): Select all Collapse
COLUMN TITLE "Oprcn" DATA "" SIZE  5 RIGHT
COLUMN TITLE "Tipo"   DATA "" SIZE  4 LEFT


Then use the ON CHANGE method to define a function.

Code (fw): Select all Collapse
ACTIVATE REPORT oReport;
   ON CHANGE DrawDet(oReport)


And in the DrawDet function you can do whatever you need.

Code (fw): Select all Collapse
STATIC PROCEDURE DrawDet(oReport)
oReport:SAY( 1,(cHdrOpe)->HDR_OPE,,RPT_RIGHT)
IF ! EMPTY((cHdrOpe)->HDR_CLI)
   oReport:SAY( 2,LEFT((cCliente)->CLI_NOM,45),,RPT_LEFT)
ELSE
   oReport:SAY( 2,"VENTAS MOSTRADOR",,RPT_LEFT)
ENDIF
RETURN(.T.)


I hope these can help you.

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Re: Custom report.
Posted: Thu Nov 19, 2009 05:11 PM

Thank you Armando.

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Custom report.
Posted: Thu Nov 19, 2009 05:23 PM
Hunter,

Code (fw): Select all Collapse
column title "PaidDate","InvDate" data oCash:dtepaid,oCash:invdte


The above is pure FWH using TReport. There are two lines in the column and two fields from the same database object are being displayed. You can display items from different databases if you wish, or calculated data, or whatever.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Custom report.
Posted: Thu Nov 19, 2009 06:10 PM
Hello Hunter,

EasyReport is a good tool written in FiveWin. You have access to the source. The ReportDesigner is easy to use.
I use EasyReport very much.

Since a couple of month I also have FastReport. FastReport is as mighty as Crystal Reports. The integration is very easy and you don’t have to install anything on the client PC.
This is so far the most complex report I made with FR.


For lists I use Fivewin’s oReport class:
Code (fw): Select all Collapse
function test ()
   local nrgNr         := tagdbf->rgnr
   local oReport,oFont1,oFont2,oFont3,oPen1,oline, cTITLE:="Kopie Kassaquittung "+str(nRgNr)
   *--------------------------------------------

   DEFINE PEN oPen1 WIDTH 0.5

   DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10
   DEFINE FONT oFont3 NAME "ARIAL" SIZE 0,-16 BOLD
   DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD
   select tagdbf
   go top

   REPORT oReport TITLE " ",cTITLE," "  LEFT ;
         FONT   oFont1,;
         oFont2,;
         oFont3 ;
         PEN oPen1;
         HEADER Setup():LizenzNehmer()," ", ALLTRIM("Erstellt: " + dtoc(date())+ " - "+time()) RIGHT;
         FOOTER "Seite " + Str(oReport:nPage,3) RIGHT PREVIEW

      COLUMN TITLE "DATUM"        DATA    tagdbf->datum            SIZE 9
      COLUMN TITLE "Bondatum"     DATA    tagdbf->bondatum         SIZE 9
      COLUMN TITLE "Zeit"         DATA    tagdbf->zeit             SIZE 5
      COLUMN TITLE "Bezeichnung"  DATA    tagdbf->Bezeichnun       SIZE 20
      COLUMN TITLE "Menge"        DATA    tagdbf->Menge            SIZE 6  PICTURE "99,999.99"
      COLUMN TITLE "Wert"         DATA    tagdbf->Wert      TOTAL  SIZE 8  PICTURE "99,999,999.99"
        COLUMN TITLE "Name" , "Header2", "Header3"             DATA    (tagdbf->PLANNAME)+" "+tagdbf->gastnr,;
               "TestText:",;
               (left(tagdbf->standard,50)),;
               (left(tagdbf->preis,50)),;
               (left(tagdbf->leistung,50)) SIZE 35

   END REPORT
   oReport:CellView()

   oLine:= oReport:oTitle
   oLine:aFont[2] := {|| 3}

   ACTIVATE REPORT oReport FOR nrgNr = tagdbf->rgnr
   oPen1:End()
   oFont1:End()
   oFont2:End()
   oFont3:End()

   msginfo("Kopie Kassaquittung")

return nil

Best regads,
Otto
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Re: Custom report.
Posted: Thu Nov 19, 2009 07:11 PM

Otto:

Thank you very much for your help, very much appreciated ! :D

The pure FiveWin option is very straightforward. Can you tell me how I define a two line per record report ? Thank you.

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Custom report.
Posted: Thu Nov 19, 2009 08:34 PM
Hello Hunter,
If I understand your question right:
This should give
3 headers and 6 lines - You can also insert a textline "TestText" if you want.

Best regards,
Otto


Code (fw): Select all Collapse
  COLUMN TITLE "Name" , "Header2", "Header3"             DATA    (tagdbf->PLANNAME)+" "+tagdbf->gastnr,;
               "TestText:",;
               (left(tagdbf->standard,50)),;
               (left(tagdbf->preis,50)),;
               (left(tagdbf->leistung,50)) SIZE 35
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Re: Custom report.
Posted: Sat Nov 21, 2009 03:48 AM

Otto:

Thank you very much ! I'll move on with your help. :D

Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: Custom report.
Posted: Mon Nov 23, 2009 08:58 AM

Alfredo has shared an interactive report generator:

http://www.despachoarteaga.com.mx/Visor.zip

it may help

Saludos,



Eduardo
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Custom report.
Posted: Mon Nov 23, 2009 11:56 PM

Where do you get a copy of easy report?

Thank you

Harvey
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Custom report.
Posted: Tue Nov 24, 2009 12:38 AM
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Custom report.
Posted: Tue Nov 24, 2009 05:05 AM

thanks

Thank you

Harvey