Page 1 of 2

Custom report.

PostPosted: Thu Nov 19, 2009 10:13 am
by HunterEC
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.

Re: Custom report.

PostPosted: Thu Nov 19, 2009 12:46 pm
by Otto
I would suggest you to try FastReport od EasyReport.

Best regards,
Otto

Re: Custom report.

PostPosted: Thu Nov 19, 2009 3:50 pm
by James Bott
Hunter,

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

Regards,
James

Re: Custom report.

PostPosted: Thu Nov 19, 2009 4:42 pm
by HunterEC
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.

Re: Custom report.

PostPosted: Thu Nov 19, 2009 4:43 pm
by Armando
Hunter:

Here is an other free way:

Define the columns with empty data

Code: Select all  Expand view

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: Select all  Expand view

ACTIVATE REPORT oReport;
   ON CHANGE DrawDet(oReport)
 


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

Code: Select all  Expand view

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

Re: Custom report.

PostPosted: Thu Nov 19, 2009 5:11 pm
by HunterEC
Thank you Armando.

Re: Custom report.

PostPosted: Thu Nov 19, 2009 5:23 pm
by James Bott
Hunter,

Code: Select all  Expand view
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

Re: Custom report.

PostPosted: Thu Nov 19, 2009 6:10 pm
by Otto
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.
Image

For lists I use Fivewin’s oReport class:
Code: Select all  Expand view


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

Re: Custom report.

PostPosted: Thu Nov 19, 2009 7:11 pm
by HunterEC
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.

Re: Custom report.

PostPosted: Thu Nov 19, 2009 8:34 pm
by Otto
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: Select all  Expand view
 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
 

Re: Custom report.

PostPosted: Sat Nov 21, 2009 3:48 am
by HunterEC
Otto:

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

Re: Custom report.

PostPosted: Mon Nov 23, 2009 8:58 am
by mgsoft
Alfredo has shared an interactive report generator:

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


it may help

Re: Custom report.

PostPosted: Mon Nov 23, 2009 11:56 pm
by hag
Where do you get a copy of easy report?

Re: Custom report.

PostPosted: Tue Nov 24, 2009 12:38 am
by Armando

Re: Custom report.

PostPosted: Tue Nov 24, 2009 5:05 am
by hag
thanks