Group more than one fields in one page

Group more than one fields in one page

Postby Ehab Samir Aziz » Sun Jun 22, 2008 10:46 pm

I may asked that before but if somebody has one easy way other than to alter \source\classes\report.prg it will be fine
I need to show more than three fields in the same page . I need to show more than the titlles of headers may permit .


Code: Select all  Expand view
method print(oSurvey) CLASS TSurvey
*-------------------------------     

     REPORT oReport TITLE  "*** Survey1 Report ***" PREVIEW

     COLUMN TITLE "Survey ID"   DATA oSurvey:SurveyID
     COLUMN TITLE "Contact Name"   DATA oSurvey:cnt_last,oSurvey:cnt_first,oSurvey:cnt_middle
     COLUMN TITLE "Position Title Within Surveyion"   DATA oSurvey:title
     COLUMN TITLE "Name of Surveyion"   DATA oSurvey:ass_name
     GROUP ON oSurvey:SurveyID
           EJECT
           
     END REPORT

     oReport:CellView()

     ACTIVATE REPORT oReport


RETURN NIL

Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Re: Group more than one fields in one page

Postby mmercado » Mon Jun 23, 2008 1:09 am

Ehab Samir Aziz wrote: alter \source\classes\report.prg it will be fine
I need to show more than three fields in the same page . I need to show more than the titlles of headers may permit
Ehab:

Try this way:
Code: Select all  Expand view
method print(oSurvey) CLASS TSurvey
*-------------------------------     

     REPORT oReport TITLE  "*** Survey1 Report ***" PREVIEW

     COLUMN TITLE "Survey ID"   DATA oSurvey:SurveyID
     COLUMN TITLE "Contact Name" ;
     DATA Trim(oSurvey:cnt_last) + Space(1) + Trim(oSurvey:cnt_first) + Space(1) + Trim(oSurvey:cnt_middle)
     COLUMN TITLE "Position Title Within Surveyion"   DATA oSurvey:title
     COLUMN TITLE "Name of Surveyion"   DATA oSurvey:ass_name
     GROUP ON oSurvey:SurveyID
           EJECT
           
     END REPORT

     oReport:CellView()

     ACTIVATE REPORT oReport


RETURN NIL

Regards.

Manuel Mercado
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Postby James Bott » Mon Jun 23, 2008 1:13 am

Ehab,

If you are trying to print all the data from one record down the page instead of across the page, then you cannot do this with TReport.

You have to use the TPrinter class and hand code the entire report.

However, I don't think you need this type of report for your current project, as they already have the original paper copy of each survey.

They will be looking for summary information containing data from multiple surveys as I pointed out previously.

You really need to get the report specifications from the customer.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby nageswaragunupudi » Mon Jun 23, 2008 8:45 am

Mr James

>
If you are trying to print all the data from one record down the page instead of across the page, then you cannot do this with TReport.

You have to use the TPrinter class and hand code the entire report.
>
Do you mean all fields of one record, one below the other? If so, please reconider. We can do it I think.

Skip block should increment filed number and frist column is defined as fieldnaem and second column fieldget.

Do you agree with me?

I am not very clear what he wanted. But if we need to print mulitple fiends in one column in multitow mode, it is also possible with treport.

Or have I not underestood the question?
Regards

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

Postby Ehab Samir Aziz » Mon Jun 23, 2008 1:26 pm

Yes I have 84 fields database I am searching a mechanism of how can I show all fields either :
fields distributed all over for example 12 page ( 7 fields per page ) (for example)
, Or show every field headers with values one record per one page as rows under each other .
Thanks
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby nageswaragunupudi » Mon Jun 23, 2008 1:54 pm

This can be done in two ways.

1) Normal report format:

You can print two or more fields in the same column, one below the other. Please see REP09.PRG in the \FWH\SAMPLES\REPORT folder. It should be possible to fit all the data in to a single report.

For example,
Code: Select all  Expand view
COLUMN TITLE "Last Name","First name","Middle Name" ;
  DATA field->last, field->first,field->middle


2) Field wise valuese vertically.
---------------------------------
FIELD NAME FIELD VALUE
-------------------------------
<recno>
fld1name fld1value
fld2name fld2value
..etc.


Sample relevant code:
Code: Select all  Expand view
static nfld, nflds

nfld := 1
nflds := fcount()

< .. code ... >

COLUMN TITLE "Description" DATA fname( nfld )
COLUMN TITLE "Value" DATA cValToChar( FieldGet( nFld ) )

GROUP ON RECNO() HEADER "RecNo : " + LTrim( Str( RecNo() ) )

< .. code .. >

oRep:bSkip := { || If( nFld < nFlds, nFld++, ( DbSkip( 1 ), nFld := 1 ) ) }


You can suitably adopt any of the above approaches for your situation
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: karinha, nageswaragunupudi and 88 guests