Re: [api-dev] How to chenge column formats in DatsourceBrowser

2008-12-08 Thread Frank Schönheit - Sun Microsystems Germany
Hi Fernand,

>>> I hope Frank is still there :-)
>>> 
>> forcing me to answer your mails this way won't work forever :)
>>   
> Please do not see it as "forcing" where the hell sould i find  the  
> information who is apparently only in your head ??
> But i understood alsoo your point,  I will never do it again :-)

Just wanted to say that this kind of introduction is unnecessary, I
usually find the topics I can/want to contribute to without it :)

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Base   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to chenge column formats in DatsourceBrowser

2008-12-08 Thread Fernand Vanrie

Frank Schönheit - Sun Microsystems Germany wrote:

Hi Fernand,

  

I hope Frank is still there :-)



forcing me to answer your mails this way won't work forever :)
  
Please do not see it as "forcing" where the hell sould i find  the  
information who is apparently only in your head ??

But i understood alsoo your point,  I will never do it again :-)

  

I Try to change the column format in a Data Source Browser
I used following code with no suces, the Formatkey off the column 
properties is changed but no visual changes


oModel = oDataSourcebrowser.com_sun_star_awt_XTabController_getModel

oMOdel.columns.getbyname("docdat").setpropertyvalue("FormatKey",2) ' 
2 = DATE

oMOdel.reset
omodel.reload



Try omitting the "columns". What you access here is the *database
column*, not the *grid column*.

That is, oModel is an css.sdb.RowSet, which is a ResultSet, which
provides the XColumnsSupplier interface, giving you access to the single
columns of this result set. Those columns also support a FormatKey
property, but the grid columns are not expected to react on their changes.

On the other hand, "oModel.getByName(  )" would give you
the *grid column*. Usually, every grid column is bound to a result set
column (in that it fetches from and stores to this result set column).
Upon creating the grid column and binding it to a result set column, the
FormatKey from the latter is transferred to the former, but there's no
life connection.

So, a
  oModel.getByName( ).setPropertyValue( "FormatKey", 2 )
  

for  the completness: your omodel  is
   oModel = oDataSourcebrowser.com_sun_star_awt_XTabController_getModel
   oGridModel = omodel.getbyindex(0)

and for who wanted to force the format to the "local" version :
  


oSupp = oGridModel.getbyName(mydatecolumni).FormatsSupplier
Dim aLocale as new com.sun.star.lang.Locale, oCell1 as Object, _
aLocale.Language = "ne"
 aLocale.Country = "BE"
sFormat = "DD/MM/YY"  ' or wathever other version of the date 
formats;..
vFormatKey = oSupp.getNumberFormats().queryKey (sFormat, aLocale, 
TRUE)

   vFormatkey = oSupp.getNumberFormats().addNew ( sFormat, aLocale )

oGridMOdel.getbyName(mydatecolumn).setpropertyvalue("FormatKey",vFormatkey)
   next i 


thanks

Fernand


should do.

Ciao
Frank

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to chenge column formats in DatsourceBrowser

2008-12-05 Thread Frank Schönheit - Sun Microsystems Germany
Hi Fernand,

> I hope Frank is still there :-)

forcing me to answer your mails this way won't work forever :)

> I Try to change the column format in a Data Source Browser
> I used following code with no suces, the Formatkey off the column 
> properties is changed but no visual changes
> 
> oModel = oDataSourcebrowser.com_sun_star_awt_XTabController_getModel
> 
> oMOdel.columns.getbyname("docdat").setpropertyvalue("FormatKey",2) ' 
> 2 = DATE
> oMOdel.reset
> omodel.reload

Try omitting the "columns". What you access here is the *database
column*, not the *grid column*.

That is, oModel is an css.sdb.RowSet, which is a ResultSet, which
provides the XColumnsSupplier interface, giving you access to the single
columns of this result set. Those columns also support a FormatKey
property, but the grid columns are not expected to react on their changes.

On the other hand, "oModel.getByName(  )" would give you
the *grid column*. Usually, every grid column is bound to a result set
column (in that it fetches from and stores to this result set column).
Upon creating the grid column and binding it to a result set column, the
FormatKey from the latter is transferred to the former, but there's no
life connection.

So, a
  oModel.getByName( ).setPropertyValue( "FormatKey", 2 )
should do.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Base   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[api-dev] How to chenge column formats in DatsourceBrowser

2008-12-04 Thread Fernand Vanrie

I hope Frank is still there :-)

I Try to change the column format in a Data Source Browser
I used following code with no suces, the Formatkey off the column 
properties is changed but no visual changes


   oModel = oDataSourcebrowser.com_sun_star_awt_XTabController_getModel

   oMOdel.columns.getbyname("docdat").setpropertyvalue("FormatKey",2) ' 
2 = DATE

   oMOdel.reset
   omodel.reload

thanks for any hint

Fernand



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]