Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #3284 > unrolled thread
| Started by | Ian <ithomson@mikroaid.co.uk> |
|---|---|
| First post | 2012-04-04 08:54 -0700 |
| Last post | 2012-04-07 07:48 -0700 |
| Articles | 6 — 3 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
bBrowser auto column width Ian <ithomson@mikroaid.co.uk> - 2012-04-04 08:54 -0700
Re: bBrowser auto column width "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2012-04-04 23:18 +0200
Re: bBrowser auto column width "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2012-04-05 18:34 +1000
Re: bBrowser auto column width Ian <ithomson@mikroaid.co.uk> - 2012-04-06 07:41 -0700
Re: bBrowser auto column width "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2012-04-07 15:31 +1000
Re: bBrowser auto column width Ian <ithomson@mikroaid.co.uk> - 2012-04-07 07:48 -0700
| From | Ian <ithomson@mikroaid.co.uk> |
|---|---|
| Date | 2012-04-04 08:54 -0700 |
| Subject | bBrowser auto column width |
| Message-ID | <775dea7f-7aba-408c-8dd3-e54f1dcb024f@d4g2000vbn.googlegroups.com> |
Hi all, I am making changes to my app so the windows resize to suit the screen resolution of the users pc. I have used the following value for the Owner Alignment of the windows and controls and bBrowsers. OA_PX_PY_PWIDTH_PHEIGHT This is working ok and the windows and controls resize perfectly to suit the screen resolution. Within the code for the bBrowsers that are on the windows I set a value like so for each column; oColumn :=self:oDcContractBrowser:GetColumn(#USERNAME) oColumn:Width :=150 oColumn:Caption :="Users Name" When the bBrowsers are resized the columns do not fill the screen as the sizes were set to suit the original system design for a screen resolution of 1024x768. To get round this I added to my default bBrowser class the following value; MyBrowser:AdjustAutoWidthColumn(true,true) This works ok and the columns fill the browser no matter what resolution the screen is in. However, there are some columns in some of the browsers that have a width of 0 (zero) so the user does not see that data but the app can access it. When I added the AdjustAutoWidthColumn(true,true) to my bbrowser class these columns are also resized and are then visible to the user. I have tried to set these columns with's to 0 (zero) using; oColumn:WidthMax :=0 But they are still being resized. How can I get the columns in the bBrowsers to resize themselves but leave the ones with a default width of 0 (zero) alone. Many Thanks Ian
[toc] | [next] | [standalone]
| From | "Urs Eggmann" <Urs.Eggmann@shinternet.ch> |
|---|---|
| Date | 2012-04-04 23:18 +0200 |
| Message-ID | <9u3s6oFsj0U1@mid.individual.net> |
| In reply to | #3284 |
Hi Jan, In some of my bBrowsers I have written a METHOD bBrowserConfig( if necessary some parameters) CLASS dtaTabelle ..........snip SELF:oDCbBrowser1:Use( SELF:oServer) // These modifications are valid for all configurations // Close columns that have to be invisible SELF:oDCbBrowser1:CloseColumn(#SCHLUESSEL, TRUE) SELF:oDCbBrowser1:CloseColumn(#LAUFNUMMER, TRUE) SELF:oDCbBrowser1:CloseColumn(#ALTERSATZ, TRUE) SELF:oDCbBrowser1:CloseColumn(#KOPIE, TRUE) ..........snip The fields are still reachable by code, but are not visible. I think AdjustAutoWidthColumn(..) should not show closed columns. regards Urs "Ian" <ithomson@mikroaid.co.uk> schrieb im Newsbeitrag news:775dea7f-7aba-408c-8dd3-e54f1dcb024f@d4g2000vbn.googlegroups.com... > Hi all, > > I am making changes to my app so the windows resize to suit the screen > resolution of the users pc. I have used the following value for the > Owner Alignment of the windows and controls and bBrowsers. > > OA_PX_PY_PWIDTH_PHEIGHT > > This is working ok and the windows and controls resize perfectly to > suit the screen resolution. > > Within the code for the bBrowsers that are on the windows I set a > value like so for each column; > > oColumn :=self:oDcContractBrowser:GetColumn(#USERNAME) > oColumn:Width :=150 > oColumn:Caption :="Users Name" > > > When the bBrowsers are resized the columns do not fill the screen as > the sizes were set to suit the original system design for a screen > resolution of 1024x768. > > To get round this I added to my default bBrowser class the following > value; > > MyBrowser:AdjustAutoWidthColumn(true,true) > > This works ok and the columns fill the browser no matter what > resolution the screen is in. However, there are some columns in some > of the browsers that have a width of 0 (zero) so the user does not see > that data but the app can access it. > > When I added the AdjustAutoWidthColumn(true,true) to my bbrowser class > these columns are also resized and are then visible to the user. > > I have tried to set these columns with's to 0 (zero) using; > > oColumn:WidthMax :=0 > > But they are still being resized. > > How can I get the columns in the bBrowsers to resize themselves but > leave the ones with a default width of 0 (zero) alone. > > Many Thanks > Ian
[toc] | [prev] | [next] | [standalone]
| From | "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> |
|---|---|
| Date | 2012-04-05 18:34 +1000 |
| Message-ID | <9Vcfr.5382$%E2.250@viwinnwfe01.internal.bigpond.com> |
| In reply to | #3284 |
Ian If the columns are zero width then why have them?? The app can still see data in the Server on the window/bBrowser. The other thing you might try is what Urs said<g> CYA Steve
[toc] | [prev] | [next] | [standalone]
| From | Ian <ithomson@mikroaid.co.uk> |
|---|---|
| Date | 2012-04-06 07:41 -0700 |
| Message-ID | <e3394cef-f92b-44ab-8db4-b8a87413a583@n5g2000vbf.googlegroups.com> |
| In reply to | #3287 |
On Apr 5, 9:34 am, "Stephen Quinn" <stevej...@bigpondSPAM.net.au> wrote: > Ian > > If the columns are zero width then why have them?? > > The app can still see data in the Server on the window/bBrowser. > > The other thing you might try is what Urs said<g> > > CYA > Steve Hi Steve, I have a lo of master detail browsers in my app. I also give the user the option to export the data to excel or any other file format. I do this by passing the detail browser to a routine I have written that takes the data straight from the browser, using the column headings to create column titles in excel. As I am using the browser for this and not the server I do dupelicate some data such as the account number and name from the header server is added to the detail browser with zero column widths. So although the user does not see the dupelicate data in the browser the excel spreadsheet when created is complete. May not be the right way to do it but as all the browsers in my app work the same way I was looking at solving my problem without have to change all of my data export routines. May need to look at AutoWidthColumn rather than the global AdjustAutoWidthColumn(true,true). Ian
[toc] | [prev] | [next] | [standalone]
| From | "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> |
|---|---|
| Date | 2012-04-07 15:31 +1000 |
| Message-ID | <zhQfr.5343$v14.2871@viwinnwfe02.internal.bigpond.com> |
| In reply to | #3291 |
Ian
> create column titles in excel. As I am using the browser for this and
> not the server I do dupelicate some data such as the account number
You could close them for normal display and 'Open' them when exporting.
Eg
Export (oDetBB)
oCol := oDetBB:GetColumn( #X2)
oDetBB:OpenColumn( oCol, 4) // If you want it in position #4
// ExportLoop
oCol := oDetBB:GetColumn( #X2)
oDetBB:CloseColumn(oCol, FALSE)
You don't even have to 'Open' them to use them (might save any flickering,
when the columns are open/closed, in the window)
>>
May not be the right way to do it but as all the browsers in my app
work the same way I was looking at solving my problem without have to
change all of my data export routines.
<<
There is no 'right way' - if it works got you it's the right way<bg>
Might not be efficient but that's a different exercise.
>>
work the same way I was looking at solving my problem without have to
change all of my data export routines.
<<
'all'??
If your creating a file then why not have 1 class/method/function that does
it for you.
Eg
oExport := ExportData{ #EXCEL, oServer }
oExport:DoIt()
or
oExport := ExportData{ #CSV, oServer }
oExport:DoIt()
or
you could do a 2 stage process where you extract the data into an array and
pass that into the export class.
Eg
METHOD Export() CLASS MYBBrowser
// Loop thru server to fill array using whichever data is required
oExport := ExportData{ SELF:symExportType, anArray }
// oExport:ExportToPath := 'C:\Temp'
// oExport:ExportFileName := 'XXX'
oExport:DoIt()
Example Class
CLASS ExportData
METHOD CSVExport() CLASS ExportData
METHOD EXCELExport() CLASS ExportData
METHOD AnotherTypeExport() CLASS ExportData
METHOD INIT( symExportType, xData )
SELF:symExportType := symExportType
SELF:aData := xData
SELF:ExportToPath := GetDefault()
SELF:ExportFileName := 'FredWasHere.txt'
METHOD EXCELExport() CLASS ExportData
IF SELF:oFile:Find()
// OK it's been created
// Write headers,etc... as required
// Write the data to file
FOR i := 1 UPTO ALen( SELF:xData )
anArray := SELF:xData[i]
FOR j := 1 UPTO ALen( anArray )
// Write line if data
SELF:oFile:Write( anArray[j] )
SELF:oFile:Write( _CHR(9) ) // TAB field delimiter?
NEXT
SELF:oFile:Write( CRLF ) // EOL character - whatever it
is for EXCEL
NEXT
// Write trailing codes etc... as required
ENDIF
METHOD Doit() CLASS ExportData
// Create a output file here
SELF:OutputFile( #OPEN )
DO CASE
CASE SELF:symExportType = #EXCEL
SELF:EXCELExport()
CASE SELF:symExportType = #CSV
SELF:CSVExport()
ENDCASE
SELF:OutPutFile( #CLOSE )
RETURN
If you need a File handling class see the free VOForum code
http://www.piko.com.au/ftp/vo25lib.zip - FileObject{}
CYA
Steve
[toc] | [prev] | [next] | [standalone]
| From | Ian <ithomson@mikroaid.co.uk> |
|---|---|
| Date | 2012-04-07 07:48 -0700 |
| Message-ID | <6dccdc42-890c-4754-a82d-b01e0dd57359@d17g2000vba.googlegroups.com> |
| In reply to | #3292 |
On Apr 7, 6:31 am, "Stephen Quinn" <stevej...@bigpondSPAM.net.au>
wrote:
> Ian
>
> > create column titles in excel. As I am using the browser for this and
> > not the server I do dupelicate some data such as the account number
>
> You could close them for normal display and 'Open' them when exporting.
> Eg
> Export (oDetBB)
>
> oCol := oDetBB:GetColumn( #X2)
> oDetBB:OpenColumn( oCol, 4) // If you want it in position #4
> // ExportLoop
> oCol := oDetBB:GetColumn( #X2)
> oDetBB:CloseColumn(oCol, FALSE)
>
> You don't even have to 'Open' them to use them (might save any flickering,
> when the columns are open/closed, in the window)
>
>
>
> May not be the right way to do it but as all the browsers in my app
> work the same way I was looking at solving my problem without have to
> change all of my data export routines.
> <<
> There is no 'right way' - if it works got you it's the right way<bg>
> Might not be efficient but that's a different exercise.
>
>
>
> work the same way I was looking at solving my problem without have to
> change all of my data export routines.
> <<
> 'all'??
> If your creating a file then why not have 1 class/method/function that does
> it for you.
> Eg
> oExport := ExportData{ #EXCEL, oServer }
> oExport:DoIt()
> or
> oExport := ExportData{ #CSV, oServer }
> oExport:DoIt()
>
> or
> you could do a 2 stage process where you extract the data into an array and
> pass that into the export class.
> Eg
> METHOD Export() CLASS MYBBrowser
>
> // Loop thru server to fill array using whichever data is required
>
> oExport := ExportData{ SELF:symExportType, anArray }
> // oExport:ExportToPath := 'C:\Temp'
> // oExport:ExportFileName := 'XXX'
> oExport:DoIt()
>
> Example Class
> CLASS ExportData
> METHOD CSVExport() CLASS ExportData
> METHOD EXCELExport() CLASS ExportData
> METHOD AnotherTypeExport() CLASS ExportData
> METHOD INIT( symExportType, xData )
>
> SELF:symExportType := symExportType
> SELF:aData := xData
> SELF:ExportToPath := GetDefault()
> SELF:ExportFileName := 'FredWasHere.txt'
>
> METHOD EXCELExport() CLASS ExportData
>
> IF SELF:oFile:Find()
> // OK it's been created
> // Write headers,etc... as required
> // Write the data to file
> FOR i := 1 UPTO ALen( SELF:xData )
> anArray := SELF:xData[i]
> FOR j := 1 UPTO ALen( anArray )
> // Write line if data
> SELF:oFile:Write( anArray[j] )
> SELF:oFile:Write( _CHR(9) ) // TAB field delimiter?
> NEXT
> SELF:oFile:Write( CRLF ) // EOL character - whatever it
> is for EXCEL
> NEXT
> // Write trailing codes etc... as required
> ENDIF
>
> METHOD Doit() CLASS ExportData
>
> // Create a output file here
> SELF:OutputFile( #OPEN )
> DO CASE
> CASE SELF:symExportType = #EXCEL
> SELF:EXCELExport()
>
> CASE SELF:symExportType = #CSV
> SELF:CSVExport()
>
> ENDCASE
> SELF:OutPutFile( #CLOSE )
>
> RETURN
>
> If you need a File handling class see the free VOForum code
> http://www.piko.com.au/ftp/vo25lib.zip - FileObject{}
>
> CYA
> Steve
Hi Steve,
Thanks for the suggested code samples. I will have a look at that when
time allows. I have changed my bBrowser code to use
AutoWidthColumn and then setting the WidthMax to 0 (zero) for those
columns I do no want the user to see and this does
seem to be working ok.
However, it makes sense to look at other solutions and I will
certainly try your suggestions. many thanks for the advice.
Regards,
ian
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web