Page 1 of 1

ajustar columna XBrowse(SOLUCIONADO)

PostPosted: Sun Oct 27, 2019 11:04 am
by jvtecheto
Hola amigos:

Estoy intentando pasar los Browses a Xbrowses , en algunas columnas observo que no se ajustan como antes.

mirad esta en el campo codigo.

Image

Como puedo hacer que se ajuste al ancho de la columna de texto, en este caso para que se vea bien toda la cabecera.

Gracias por vuestra inestimeble ayuda.

Jose.

Re: ajustar columna XBrowse

PostPosted: Sun Oct 27, 2019 1:25 pm
by Bayron
Esto puede darte una idea

Code: Select all  Expand view
ListVentWidth :=  oDialog:nWidth;

xBrowse oBrw OF oDialog ;
FIELDSIZES ( ListVentWidth * .10 ) , ( ListVentWidth * .50 ) , ( ListVentWidth * .15 ) , ( ListVentWidth * .25 );

Re: ajustar columna XBrowse

PostPosted: Sun Oct 27, 2019 6:42 pm
by jvtecheto
Hola Bayron.

Muchisimas gracias. Funciona perfecto. aunque esto ya es opinion mia

el mas antiguo Browse realiza bien el calculo de las columnas y el mas moderno debes de definirlo por codigo.
no es muy logico la verdad.

Mr. Rao, posibilidad de arreglar esto ?

Saludos.

Jose.

Re: ajustar columna XBrowse(SOLUCIONADO)

PostPosted: Mon Oct 28, 2019 12:06 pm
by cnavarro
Al margen del comentario que pueda hace Mr Rao, creo que eso ocurre cuando aparece el "bitmap" que indica el orden en el que está ordenada esa columna

Re: ajustar columna XBrowse(SOLUCIONADO)

PostPosted: Mon Oct 28, 2019 12:41 pm
by nageswaragunupudi
Mr. Jose

Code: Select all  Expand view
Como puedo hacer que se ajuste al ancho de la columna de texto, en este caso para que se vea bien toda la cabecera.
 


I am surprised that in your case the header does not look good. But it should automatically look good.
Hope you are testing with FWH1905 or later.

I tried to reproduce the problem at my end, but it is working correctly.
This is the test program I tried here.
Code: Select all  Expand view
#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oDlg, oBrw, oFont

   USE CUSTOMER VIA "DBFCDX"
   FW_CdxCreate()

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL FONT oFont TITLE FWVERSION

   @ 40,40 XBROWSE oBrw SIZE -60,-40 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "STRZERO(ID,4)","FIRST","LAST" ;
      HEADERS "CODIGO" ;
      CELL LINES NOBORDER ;
      FOOTERS AUTOSORT

   WITH OBJECT oBrw
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
 


Image

Here the header appears correctly with automatic calculation of column widths.

How can you help me to reproduce the problem?

We try our best to ensure that XBrowse should work as expected without any extra code by the programmer for colsizes, alignments, number formats, etc.

Re: ajustar columna XBrowse(SOLUCIONADO)

PostPosted: Mon Oct 28, 2019 1:07 pm
by nageswaragunupudi
I did another test. I created a DBF similar to your image above.
This is the program:
Code: Select all  Expand view
#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oDlg, oBrw, oFont

   CreateDBF()

   USE TEST VIA "DBFCDX"

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 500,300 PIXEL TRUEPIXEL FONT oFont TITLE FWVERSION

   @ 40,40 XBROWSE oBrw SIZE -40,-40 PIXEL OF oDlg ;
      DATASOURCE "TEST" AUTOCOLS ;
      CELL LINES NOBORDER ;
      FOOTERS AUTOSORT

   WITH OBJECT oBrw

      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil

function CreateDBF()

   local aStru := ;
      {  { "CODIGO", "C", 4, 0 } ;
      ,  { "CIF",    "C", 9, 0 } ;
      ,  { "NOMBRE", "C",20, 0 } ;
      }

   DBCREATE( "TEST", aStru, "DBFCDX", .T., "TST" )
   FW_ArrayToDBF( ;
      {  { "0001", "", "HOTEL PLAYA" } ;
      ,  { "0002", "016308363", "ANOZ, DEMETRIO" } ;
      ,  { "0003", "", "WIEDEMAN" } ;
      ,  { "0004", "", "KREIGER"  } ;
      ,  { "0005", "", "MODESTO"  } ;
      } )

   FW_CdxCreate()

   CLOSE TST

return nil
 


Image

Even this is working correctly.
How can you help me to recreate your problem?

Did you by any chance set the column widths yourself in your program?

Re: ajustar columna XBrowse(SOLUCIONADO)

PostPosted: Mon Oct 28, 2019 6:58 pm
by jvtecheto
Hi. Mr. Rao

First of all thank you for your effort and attention in helping me. I value it very much.
You are right that it works well in your examples, I do not get the arrow, look at the image.

Image

the code that fails me is this

Code: Select all  Expand view

@ 2, 0 XBROWSE oBrw  DATASOURCE cAlias ;
          COLUMNS "Codigo", "cif", "Nombre", "direc" ;
          HEADERS "CODIGO", "C.I.F.", "NOMBRE", "DIRECCION" CELL LINES ;
          WHEN cAlias->( LastRec() ) > 0 OF oWndObr
 


I don't know what the problem may be, anyway thank you very much

Jose.

Re: ajustar columna XBrowse(SOLUCIONADO)

PostPosted: Tue Oct 29, 2019 12:04 am
by nageswaragunupudi
Please click on headers to see arrows

Re: ajustar columna XBrowse(SOLUCIONADO)

PostPosted: Tue Oct 29, 2019 8:31 am
by jvtecheto
nageswaragunupudi wrote:Please click on headers to see arrows


Yes. Thanks. :D