Grid with Table

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Grid with Table

Post 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
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Grid with Table

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Grid with Table

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Grid with Table

Post by sudip »

Hello Roberto,
Thanks a lot :)
Right now I don't have a small sample. I shall create one. :)
With best regards.
Sudip
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Grid with Table

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply