I currently have a tabpage with a browse to a database containing customer collection contact comments. The file size is starting to get large and I would like to maintain the same basic application structure but have the browse show the appropriate comments from the appropriate file. Older paid off accounts, after a certain period of time, but prior to being archived from the main databases into the archived databases would have their comments moved from the first current file to the 2nd or 3rd current file. Thus, when navigating from one account to the next, the tab page with the comments browse (which is one of 10 tab pages) would show data from one file for one account and potentially different file for the other account. The browse on the tab pages is created at initial dialog creation.
What is the best way to handle this efficiently. Create multiple browses, one for each file and hide the inactive ones and activate only the one applicable to the current comments file assigned to the account. Or is their a better way to reconfigure the browse on the fly, when needed, that is efficient in turns of time and system resources. I do not want to be copying the data into an array as that is too costly in turns of time and processing.
I know with arrays you change the datastore point or the pointer using the DC_Get.....() function.
Cliff
Browse multiple databases on one tab page
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: Browse multiple databases on one tab page
I don't know if you can assign a new datasource as an alias.
I will have to experiment with that.
I will have to experiment with that.
The eXpress train is coming - and it has more cars.
Re: Browse multiple databases on one tab page
Here is a proof of concept for you. It uses only one browse but applies the new alias to the browse when you click on each pushbutton.
Code: Select all
#INCLUDE "dcdialog.CH"
FUNCTION Main()
LOCAL GetList[0], oBrowse, cAlias, oDlg
DC_LoadRdds()
USE xtest1 via foxcdx index xtest1 new
xtest1->(ordSetFocus('AREACODE'))
xtest1->(dc_setscope(0,'600'))
xtest1->(dc_setscope(1,'600'))
xtest1->(dc_dbGoTop())
USE xtest2 via foxcdx index xtest2 new
xtest2->(ordSetFocus('AREACODE'))
xtest2->(dc_setscope(0,'700'))
xtest2->(dc_setscope(1,'700'))
xtest2->(dc_dbGoTop())
USE xtest3 via foxcdx index xtest3 new
xtest3->(ordSetFocus('AREACODE'))
xtest3->(dc_setscope(0,'777'))
xtest3->(dc_setscope(1,'777'))
xtest3->(dc_dbGoTop())
cAlias := 'XTest1'
@ 0,0 DCBROWSE oBrowse ALIAS cAlias SIZE 500, 400 PIXEL ;
FONT '10.Lucida Console'
@ 420, 0 DCPUSHBUTTON CAPTION 'Area 600' SIZE 100,25 PIXEL ;
ACTION {||cAlias := 'XTest1', oBrowse:dataSource := cAlias, ;
oBrowse:refreshAll(), oDlg:setTitle('Browsing ' + cAlias)}
@ 420, 120 DCPUSHBUTTON CAPTION 'Area 700' SIZE 100,25 PIXEL ;
ACTION {||cAlias := 'XTest2', oBrowse:dataSource := cAlias, ;
oBrowse:refreshAll(), oDlg:setTitle('Browsing ' + cAlias)}
@ 420, 240 DCPUSHBUTTON CAPTION 'Area 777' SIZE 100,25 PIXEL ;
ACTION {||cAlias := 'XTest3', oBrowse:dataSource := cAlias, ;
oBrowse:refreshAll(), oDlg:setTitle('Browsing ' + cAlias)}
DCBROWSECOL FIELD (cAlias)->areacode WIDTH 10 HEADER 'AreaCode' PARENT oBrowse
DCBROWSECOL FIELD (cAlias)->exchange WIDTH 10 HEADER 'Exchange' PARENT oBrowse
DCBROWSECOL FIELD (cAlias)->city WIDTH 20 HEADER 'City' PARENT oBrowse
DCREAD GUI FIT TITLE 'Browsing ' + cAlias PARENT @oDlg
RETURN Nil
* -----------
PROC appsys ; return
- Attachments
-
- test4.zip
- (1011.31 KiB) Downloaded 652 times
The eXpress train is coming - and it has more cars.
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: Browse multiple databases on one tab page
Thanks Roger. I was wondering after I saw the use of oBrowse:datasource for arrays if the same thing would work for for database files.
Cliff
Cliff