Group more than one fields in one page

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

Group more than one fields in one page

Post by Ehab Samir Aziz »

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

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

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

Re: Group more than one fields in one page

Post by mmercado »

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

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
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

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
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Post by Ehab Samir Aziz »

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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

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

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

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
Post Reply