xBrowse and SQLRDD bug

MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

xBrowse and SQLRDD bug

Post by MOISES »

Hi,

I would like to ask the status of the fix, as I reported the wrong behaviour in december.

Thank you.
Last edited by MOISES on Fri Apr 10, 2020 4:06 pm, edited 1 time in total.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Post by MOISES »

Up!
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Post by MOISES »

Up
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Post by MOISES »

???
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Post by MOISES »

Any update please?
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: xBrowse and SQLRDD bug

Post by Antonio Linares »

Moises,

I just asked Rao, I am waiting for his answer

Also, please keep in mind that SQLRDD is a commercial product, that does not provide source code, and its not easy to support it in those circunstances,
anyhow we are doing out best to help you.

So, please, be patient. Changing the caption of your posts only provide a wrong sense to other users and its not a kind way to ask for help.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: xBrowse and SQLRDD bug

Post by karinha »

Hable con Marcelo Lombardo del Proyecto xHarbour.

Skype:

marcelolombardo

Saludos.
João Santos - São Paulo - Brasil
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Post by MOISES »

Olá,

Como não falo nem português nem brasileiro, poderia partilhar connosco a sua resposta?

Muito obrigado.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: xBrowse and SQLRDD bug

Post by karinha »

usted puede hablar en español con Marcelo Lombardo sin problemas, ó con Patrick Mast en ingléz. Saludos.

Mejor:

https://www.facebook.com/marcelombardo

https://www.facebook.com/patrickmast

https://www.facebook.com/luiz.guimaraes ... NMDOMiary0
João Santos - São Paulo - Brasil
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse and SQLRDD bug

Post by nageswaragunupudi »

The issue is about vertical scrollbar support to xbrowse for SQLRDD.
I have sent modified xbrowse.prg, restoring previous functionality.

Vertical scrollbar support for SQLRDD is very limited.
In order to provide better support we need to know some details about SQLRDD.

We will start explaining with a DBFCDX DBF.
In this example, states.dbf is used via DBFCDX and index order is set to field NAME and also a filter is set:

Code: Select all

function XbrVScroll

   field NAME
   local oDlg, oBrw, oFont

   USE STATES NEW VIA "DBFCDX"
   SET ORDER TO TAG NAME
   SET FILTER TO NAME >= "A" .AND. NAME <= "D"
   GO TOP

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

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "STATES" ;
      COLUMNS "RECNO()", "CODE", "NAME" ;
      PICTURES "999" ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
 
Image

In this case, xbrowse knows that the total number of visible records in the DBF are 9 (nine) with the help of the function OrdKeyCount().
Also xbrowse knows that the current record is 7th (seventh) from top using the function OrdKeyNo().
With this information, xbrowse is able to position the thumb of the scrollbar at 7/9 of the scrollbar.

Also if the user drags the scrollbar to say 3/9th position on the scrollbar, then xbrowse will move the record position to the 3rd record from the top using OrdKeyGoTo().

Using this example, please advise us how should xbrowse ascertain

1) The total number of records visible in the DBF
2) What is the serial number of the current record counting from the top.
3) How to go to a record at the nth position when counted from the top.

If you can provide us what functions to use to know the above three, then we will be able to provide full support for vertical scrollbar.

Please help us.
Regards

G. N. Rao.
Hyderabad, India
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Post by MOISES »

Thank you very much for your time and support.

With the changes you have sent me, it is possible to navigate in the xBrowse by moving the vertical scroll bar. The only remaining problem is if I perform a DbGoBottom() and then call xBrowse, the vertical scroll bar still appears on top.

OrdKeyCount() works perfect under SQLRDD, but OrdKeyNo() is not supported, it returns 0 always. They are not going to fix it, they say it is impossible.

In the past, you solved I think as follows:

Code: Select all

   
   DEFAULT ::bKeyNo     := ::bBookMark, ;
            ::bKeyCount  := { || ( ::cAlias )->( LastRec() ) }
http://forums.fivetechsupport.com/viewt ... 98#p138698
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse and SQLRDD bug

Post by nageswaragunupudi »

This code:

Code: Select all

 DEFAULT ::bKeyNo     := ::bBookMark, ;
::bBookMark is { |x| If( x == nil, RECNO(), DBGOTO( x ) ) }

This works well if the DBF is in natural order (with no index set) and when no filter is set.
If the DBF is set to an index or if a filter is set, this behaves very erratically.
Do you want this?

Please also let me know do these functions work reliably with SQLRDD?

Code: Select all

DBFILTER()
ORDSETFOCUS()
 
Can you also please confirm that when a filter is set, OrdKeyCount() returns the count of filtered records only?


In the post you referred, Mr. Kokoo suggested maintaining an array of RecNo()s outside the xbrowse. This works well but the programmer has to do an extra work of creating the array at the beginning and recreating whenever the index is changed, record is added or deleted of a keyvalue is edited and modified. This is upto you if you want to adopt this approach.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse and SQLRDD bug

Post by nageswaragunupudi »

To give the same effect as the code:

Code: Select all

::bKeyNo := ::bBookMark
 
we made these changes:

Code: Select all

      DEFAULT ::bKeyNo := { |n| ( ::cAlias )->( SqlRddKey( n ) ) }

...
...
static function SqlRddKey( x )

   if Empty( DBFILTER() ) .and. Empty( OrdSetFocus() )
      if x != nil
         DBGOTO( x )
      endif
      return RECNO()
   endif

return 0
 
We sent the modified xbrowse.prg to your email.
Please check.
Regards

G. N. Rao.
Hyderabad, India
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Post by MOISES »

Yes, I confirm that DBFILTER()/SET FILTER TO and ORDSETFOCUS() work under SQLRDD.

And yes, when a filter is set, OrdKeyCount() Works too.

But never OrdKeyNo()

I am going to test your new versión and share the results.

Thank you.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Post by MOISES »

Up!
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Post Reply