xBrowse header from an Array

Post Reply
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

xBrowse header from an Array

Post by Rick Lipkin »

To All

I know I have done this before ... I am creating an empty array without any rows and assigning it to xBrowse. I remember I could define the Headers from an array ... I do not want any rows to show in xBrowse .. I just want to define my columns with headers .. this does not work.

Code: Select all


aPlan    := {}
aColumns := {}


AAdd( aColumns, { "Budget Item",         ;
                  "Origional Budget",    ;
                  "Budget Revision",     ;
                  "Current Budget",      ;
                  "Origional Contract",  ;
                  "Contract Revisions",  ;
                  "Current Committed",   ;
                  "Pending Proposals",   ;
                  "Potential Exposures", ;
                  "Potential Costs",     ;
                  "Potential Proj Costs" } )

REDEFINE xBROWSE oLbx3  ;
              ARRAY aPlan             ;
              HEADERS aColumns        ;  // <----- here
              COLSIZES 65,43,43,43,43,43,43,43,43,43,43 ; // 11
              ID 174 of oCust     ;
              AUTOCOLS CELL LINES

 
Image

Thanks
Rick Lipkin
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xBrowse header from an Array

Post by cnavarro »

Try

Code: Select all


HEADERS aColumns[ 1 ]        ;  // <----- here
 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse header from an Array

Post by Rick Lipkin »

Christabol

Unfortunately .. that did not work ..

Image

Rick Lipkin
User avatar
alerchster
Posts: 31
Joined: Mon Oct 22, 2012 4:43 pm

Re: xBrowse header from an Array

Post by alerchster »

I think you have to build the Array in this way!

Code: Select all


aPlan    := {}
aColumns := {}

AAdd( aColumns, "Budget Item" )
AAdd( aColumns, "Origional Budget" )
AAdd( aColumns, "Budget Revision" )
AAdd( aColumns, "Current Budget" )
AAdd( aColumns, "Origional Contract" )
AAdd( aColumns, "Contract Revisions" )
AAdd( aColumns, "Current Committed" )
AAdd( aColumns, "Pending Proposals" )
AAdd( aColumns, "Potential Exposures" )
AAdd( aColumns, "Potential Costs" )
AAdd( aColumns, "Potential Proj Costs" )

REDEFINE xBROWSE oLbx3  ;
              ARRAY aPlan             ;
              HEADERS aColumns        ;  // <----- here
              COLSIZES 65,43,43,43,43,43,43,43,43,43,43 ; // 11
              ID 174 of oCust     ;
              AUTOCOLS CELL LINES
 
Regards

Ing. Anton Lerchster
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse header from an Array

Post by Rick Lipkin »

Anton

Your solution works as long as aPlan has a single record .. I wanted to leave ( the data ) aPlan empty.

Thanks
Rick
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse header from an Array

Post by Rick Lipkin »

To All

Kind of a sloppy work around was to resize the array to zero ON INIT

Code: Select all

 ACTIVATE DIALOG oCust  NOWAIT ;
          ON INIT ( oCust:Move(0,0),Asize( aPlan,0 ),oLbx3:ReFresh() ) ; //<----- 
          VALID(!GETKEYSTATE( 27 ))

 
Image

Was hoping for a more elegant solution.

Rick LIpkin
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: xBrowse header from an Array

Post by reinaldocrespo »

Hey Rick;

I'm a friend of anything that works. Even better If it can be done elegantly but at the end of the day all that matters is if it works and how much time/effort it took. Admittedly I like it simple, stupid and quick. So far I happen to be doing the same thing as you to solve this very same problem. Thank you for posting this question. I was hoping you got a better answer to this thread. I'm sure there is. Please keep me posted if you do find it.

Best regards,



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

Re: xBrowse header from an Array

Post by James Bott »

Rick,

I don't know if this would help, but did you know you can create temp data files in memory? They are like arrays but work just like DBFs. There was a recent thread on this. Perhaps this would solve your header problem.

James
Francisco Horta
Posts: 845
Joined: Sun Oct 09, 2005 5:36 pm
Location: la laguna, mexico.

Re: xBrowse header from an Array

Post by Francisco Horta »

Rick

Try,

REDEFINE xBROWSE oLbx3 ;
ARRAY aPlan ;
HEADERS aColumns ; // <----- here
COLUMNS 1,2,3,4,5,6,7,8,9,10,11 ; <------ Add
COLSIZES 65,43,43,43,43,43,43,43,43,43,43 ; // 11
ID 174 of oCust ;
AUTOCOLS CELL LINES

Regards
Paco
____________________
Paco
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse header from an Array

Post by nageswaragunupudi »

Method-1

Code: Select all

aPlan    := {}
aColumns := {}

aHeaders  := { "Budget Item",         ;
                  "Origional Budget",    ;
                  "Budget Revision",     ;
                  "Current Budget",      ;
                  "Origional Contract",  ;
                  "Contract Revisions",  ;
                  "Current Committed",   ;
                  "Pending Proposals",   ;
                  "Potential Exposures", ;
                  "Potential Costs",     ;
                  "Potential Proj Costs" } 

AEval( aHeaders, { |u,i| AAdd( aColumns, i ) } )

REDEFINE xBROWSE oLbx3  ;
              ARRAY aPlan             ;
              COLUMNS aColumns        ;
              HEADERS aHeaders        ;  // <----- here
              COLSIZES 65,43,43,43,43,43,43,43,43,43,43 ; // 11
              ID 174 of oCust     ;
              CELL LINES
 
METHOD-2

Code: Select all

aPlan    := {}

aSpec :=  { ;
   {  1, "Budget Item",         nil, 65 }, ;
   {  2, "Origional Budget",    nil, 43 }, ;
   {  3, "Budget Revision",     nil, 43 }, ;
   {  4, "Current Budget",      nil, 43 }, ;
   {  5, "Origional Contract",  nil, 43 }, ;
   {  6, "Contract Revisions",  nil, 43 }, ;
   {  7, "Current Committed",   nil, 43 }, ;
   {  8, "Pending Proposals",   nil, 43 }, ;
   {  9, "Potential Exposures", nil, 43 }, ;
   { 10, "Potential Costs",     nil, 43 }, ;
   { 11, "Potential Proj Costs",nil, 43 }  }

// { Exprn/ArrayColNo, cHeader, cPicture, nWidth, lnAlign, cSortOrder } 

REDEFINE xBROWSE oLbx3  ;
              ARRAY aPlan             ;
              COLUMNS aSpec        ;
              ID 174 of oCust     ;
              CELL LINES
 
Personally I prefer to write my programs using the Method-2.
Regards

G. N. Rao.
Hyderabad, India
Post Reply