Page 1 of 1

Grid with Table

Posted: Wed Feb 17, 2010 10:02 am
by sudip
Hello All,

I found some problem using grid with array table. Sometimes I found blank records coming in the grid. But this works fine when using old BROWSE control.

I don't have a small sample right now. So I am giving my codes where I found problems.

Code: Select all

#include <hmg.ch>

Function dbf_menu(mAlias, aHeader, aWidth, aFieldnm, abDynamicDisplay, aJustify)
   local mOldRecno, lRecChanged := .f.
   
   mOldRecno := if((mAlias)->(eof()), 0, (mAlias)->(recno()))
   
	DEFINE WINDOW frmDbf_menu ;
		AT 0,0 ;
		WIDTH 640 ;
		HEIGHT 480 ;
		TITLE 'Find' ;
		MODAL
      
 		@ 10,10 GRID Grid_1 ;
 			WIDTH 610 ;
 			HEIGHT 380 ;
 			HEADERS aHeader ;
 			WIDTHS aWidth;
 			ROWSOURCE mAlias ;
 			COLUMNFIELDS aFieldNm ;
 			DYNAMICDISPLAY	 abDynamicDisplay ;
 			JUSTIFY aJustify ;
 			value {(mAlias)->(recno()), 1}  
			
      @ 400, 150 button cmdOk caption "&Ok" action {|| lRecChanged := .t., frmDbf_menu.release()}
      
      @ 400, 390 button cmdCancel caption "&Cancel" action frmDbf_menu.release()			
			

	END WINDOW

   on key ESCAPE of frmDbf_menu action frmDbf_menu.release()	

	CENTER WINDOW frmDbf_menu

	ACTIVATE WINDOW frmDbf_menu
	
	if !lRecChanged
	  if mOldRecno > 0
	     (mAlias)->(dbgoto(mOldRecno))
	  endif
	endif
Return
I am calling DBF_Menu() function as follows:

Code: Select all

Static Function FindSale()
   dbf_menu("tempsale", {"Inv Dt", "Inv No", "Amount"}, {100, 100, 100}, {"invdt", "invno", "netamt"}, ;
      {{|| this.cellvalue}, {|| this.cellvalue}, {|| transform(this.cellvalue, '99,99,99,999.99')}},;
      {0, 0, 1})
   thiswindow.setfocus()
   RefreshData()	  
	return nil
Here "tempsale" is the array RDD alias name.

Thanks in advance.

With best reagrds.

Sudip

Re: Grid with Table

Posted: Wed Feb 17, 2010 11:45 am
by Roberto Lopez
sudip wrote:Hello All,

I found some problem using grid with array table. Sometimes I found blank records coming in the grid. But this works fine when using old BROWSE control.

I don't have a small sample right now. So I am giving my codes where I found problems.
The problems I've found with SQLMIX and POSTGRE RDDs is that these RDDs does not perform exactly the same as standard ones.

Please, if you could post a complete working sample showing the problem, I'll could check it and try to find a solution.

Re: Grid with Table

Posted: Wed Feb 17, 2010 11:59 am
by Roberto Lopez
Roberto Lopez wrote: Please, if you could post a complete working sample showing the problem, I'll could check it and try to find a solution.
Since the sample \samples\rdd.sql\array works fine, I need that you post a complete sample describing the problem to work with it.

TIA.

Re: Grid with Table

Posted: Thu Feb 18, 2010 4:14 am
by sudip
Hello Roberto,
Thanks a lot :)
Right now I don't have a small sample. I shall create one. :)
With best regards.
Sudip

Re: Grid with Table

Posted: Thu Feb 18, 2010 12:43 pm
by Roberto Lopez
sudip wrote:Hello Roberto,
Thanks a lot :)
Right now I don't have a small sample. I shall create one. :)
With best regards.
Sudip
Ok. I'll wait for it.