Printing an oBrw array

Post Reply
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Printing an oBrw array

Post by hag »

I have a xBrowse display using an array. Works fine. Lost on how to figure out how to pint the array. Help please.
Thank you
Harvey
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Printing an oBrw array

Post by Richard Chidiak »

Harvey

this is a sample ,

Hth

Richard

REPORT oREPORT ;
......
COLUMN TITLE "Date Visite" ;
DATA TVISU[nField][02];
FONT 2 ;
GRID 2
COLUMN TITLE "Heure" ;
DATA TVISU[nField][03];
GRID 2
COLUMN TITLE "Ouvrier" ;
DATA TVISU[nField][06];
SIZE 20 ;
FONT 1 ;
GRID 1
END REPORT

oReport:bSkip := {|| nField++}

ACTIVATE REPORT oREPORT WHILE nField <= len(TVISU)
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Printing an oBrw array

Post by hag »

Thanks for the quick response. Tried it but I get a bound array access. Here is the code maybe you can tell me what I'm doing wrong.

Code: Select all

static function printIt()

   local oFont4 
   local oReport,oPen1, oPrn, oRep
     local nVar := 1, nField := 1
   local menucon3[3,03]


   for i = 1 to 3
      menucon3[i,1]  := "hag1"
      menucon3[i,2]  := "hag2"
      menucon3[i,3]  := "hag3"
   next i
                        
        
   if nVar == 1
      DEFINE FONT oFont4 NAME "Arial narrow" SIZE 0,-5.85 BOLD //of oRep:oDevice        
   else 
      DEFINE FONT oFont4 NAME "Arial narrow" SIZE 0,-6.25 BOLD //of oRep:oDevice        
   endif    
   define pen oPen1 width 1
   PRINT oPrn NAME "Profit and Loss"

  prnlandscape()
        
  ENDPRINT

     REPORT oReport ;
              TITLE rtrim(mcompname);
              FONT  oFont4,oFont4;
              PEN oPen1  ;
              HEADER "date";
              LEFT                      ;
              FOOTER OemtoAnsi("Footer");
              CENTERED                                ;
              PREVIEW                   ;
              CAPTION "Previewing Profit & Loss"
                            
              oReport:nTitleUpLine := RPT_NOLINE


   oReport:aFont[1] :=  oFont4
                        
   COLUMN TITLE "No." ;
   DATA menucon3[nField],[01];
   FONT oFont4 ;
   GRID 

   COLUMN TITLE "Name" ;
   DATA menucon3[nField],[02];
   FONT oFont4  ;
   GRID 

   COLUMN TITLE "Total" ;
   DATA menucon3[nField],[03];
   SIZE 20 ;
   FONT oFont4  ;
   GRID 

END REPORT

oReport:bSkip := {|| nField++}

ACTIVATE REPORT oReport WHILE nField <= len(menucon3)
Thank you
Harvey
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Printing an oBrw array

Post by Richard Chidiak »

Harvey

try it this way

DATA menucon3[nField][01]

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Printing an oBrw array

Post by hag »

Bound array error
Thank you
Harvey
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Printing an oBrw array

Post by Richard Chidiak »

Harvey

i am refering to this in particular

DATA menucon3[nField],[01]

should be replaced with DATA menucon3[nField][01]

The comma in the data syntax will specify a second data value

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Printing an oBrw array

Post by hag »

I took out the comma. Still get the error.
Thank you
Harvey
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Printing an oBrw array

Post by hag »

the error is at the activate line.
Thank you
Harvey
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Printing an oBrw array

Post by Richard Chidiak »

Harvey

there are several errors in your report definitions

i have made some changes and it compiles and run ok

the code is below

Richard

Code: Select all

menucon3 := {}

AADD(MENUCON3,{"hag1",1,100})
AADD(MENUCON3,{"hag2",2,200})
AADD(MENUCON3,{"hag3",3,300})

   DEFINE FONT oFont4 NAME "Arial narrow" SIZE 0,-5.85 BOLD //of oRep:oDevice
   define pen oPen1 width 1

     REPORT oReport ;
              TITLE "This is a test";
              FONT  oFont4 ;
              PEN oPen1  ;
              HEADER "date";
              LEFT                      ;
              FOOTER OemtoAnsi("Footer");
              CENTERED                                ;
              PREVIEW                   ;
              CAPTION "Previewing Profit & Loss"


   COLUMN TITLE "Name" ;
   DATA menucon3[nField][02];
   FONT 1  ;
   GRID 1

   COLUMN TITLE "No." ;
   DATA menucon3[nField][01];
   FONT 1 ;
   GRID 1

   COLUMN TITLE "Total" ;
   DATA menucon3[nField][03];
   SIZE 20 ;
   FONT 1  ;
   GRID 1

END REPORT

oReport:bSkip := {|| nField++}

ACTIVATE REPORT oReport WHILE nField <= len(menucon3)

 
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Printing an oBrw array

Post by nageswaragunupudi »

hag wrote:I have a xBrowse display using an array. Works fine. Lost on how to figure out how to pint the array. Help please.
If you are already browsing the array, the simplest way to print is to call

Code: Select all

oBrw:Report()
Regards

G. N. Rao.
Hyderabad, India
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Printing an oBrw array

Post by hag »

Thanks for all the help. oBrw:report( ) worked








0
Thank you
Harvey
Post Reply