FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to: xBrowse Column Span
Posts: 34
Joined: Wed Jun 17, 2009 05:52 PM
How to: xBrowse Column Span
Posted: Thu Dec 06, 2012 05:18 PM

I need to display data in columns in a dbf. However there is a special requirement as displayed below:

Serial Date Customer Amount

Agent: JOSEPH DSOUZA
1 20/11/2012 Gagan Raj 20,000
5 21/11/2012 Gagan Raj 22,030

In the above, the field width of dbf is as follows:

Serial 6 character
Date 10 character
Customer 40 character
Amount 12 character

What I need is that the display of name: Agent: JOSEPH DSOUZA will be splitted in the dbf like below:

Serial Agent: first 6 characters
Date _JOSEPH D next 10 char...
Customer SOUZA remaining characters

The display should come continuous without any break in xBROWSE.

This is faciliated in EXCEL with column SPAN option

Gagan Raj
GTalk: csplsurat@gmail.com
WhatsApp: +91 9879000301
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: How to: xBrowse Column Span
Posted: Thu Dec 06, 2012 05:45 PM

Are all the fields type character?
Is this what you want?

oCol:bStrData := { || alltrim(serial)+' '+alltrim(date)+' '+alltrim(customer)+' '+alltrim(amount)}

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 34
Joined: Wed Jun 17, 2009 05:52 PM
Re: How to: xBrowse Column Span
Posted: Thu Dec 06, 2012 05:47 PM

This will cause only single column to be displayed.

In need to display all the separate columns, but data should be spanned.

If possible, please give your gtalk id to connect to you directly. Mine is: csplsurat@gmail.com

Gagan Raj
GTalk: csplsurat@gmail.com
WhatsApp: +91 9879000301
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: How to: xBrowse Column Span
Posted: Thu Dec 06, 2012 06:05 PM
Is all the data in one field, and you want to dispayed it in 4 columns?

Is this what you need?
Fname is the fieldname of the DBF

Code (fw): Select all Collapse
oCol:bStrData := { || substr(fname,1,6)}
oCol:bStrData := { || substr(fname,7,10)}
oCol:bStrData := { || substr(fname,17,40)}
oCol:bStrData := { || substr(fname,57,12)}
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 34
Joined: Wed Jun 17, 2009 05:52 PM
Re: How to: xBrowse Column Span
Posted: Thu Dec 06, 2012 06:11 PM

Thanks for your support, but still NO.
Consider this example:
aValues := {}
aadd( aValues, { 'Agent: Joseph Dsouza' , '', '', '' } )
aadd( aValues, { '1' , '20/11/2012', 'Gagan Raj', '20,000' } )
aadd( aValues, { '5' , '22/11/2012', 'Gagan Raj', '20,320' } )

Thea above array has 3 sub arrays, with 4 Elements each.
When using xBrowse, the width of each column will be as: 6, 10, 40, 14

Now the real problem: In the first sub-array, the data: 'Agent: J.....' will be displayed truncated as per the coumn width!!
I want that when the next element data in this sub-array is empty, then the first element should be OVERFLOWED / SPANNED to the next column automatically.

Gagan Raj
GTalk: csplsurat@gmail.com
WhatsApp: +91 9879000301
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: How to: xBrowse Column Span
Posted: Thu Dec 06, 2012 07:03 PM
Sorry I cant't help you since I still using an older version of FWH.
I know that there exist a oBrw:lMergeVert := .T for vertical merge, but you need a horizontal merge.

Here is the example of the vertical merge.
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=18963&p=99421&hilit=merge#p99421

I think someone with a newer version (or Antonio) can confirm that a that already exist.
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 34
Joined: Wed Jun 17, 2009 05:52 PM
Re: How to: xBrowse Column Span
Posted: Thu Dec 06, 2012 07:12 PM

Exactly.

Anyway, thanks a lot for your attention.

Gagan Raj
GTalk: csplsurat@gmail.com
WhatsApp: +91 9879000301

Continue the discussion