Page 2 of 5

Re: 3 databases 3 tabs 3 grids

Posted: Sat Nov 06, 2010 5:28 pm
by l3whmg
Hi Mexicanto,
"LoadDataintoGrid" I supposed a coding like this:

Code: Select all

FormName.GridName.AddItem( {invoices->inv_num, invoices->inv_dat, invoices->inv_total} )
You don't need any array, your array IS every item of the grid.
For example: to get "invoices->inv_num" on row 3 of the grid, you can use code like this (or other):

Code: Select all

LOCAL aTemp := FormName.GridName.Item( 3 )
cInvoiceNumber := aTemp[1]
and then get data of this record with:

Code: Select all

invoices->( DBSEEK( cInvoiceNumber, .F. ) )
Bye

Re: 3 databases 3 tabs 3 grids

Posted: Sat Nov 06, 2010 6:26 pm
by mrduck
l3whmg wrote:Hi Mrduck,
can you give me a little example? Because I have some troubles with ONCHANGE

Ciao
Ciao,
I never used HMG 3....

and I'm just starting to work on hmg.4, more on core source than "application side"...

Re: 3 databases 3 tabs 3 grids

Posted: Sat Nov 06, 2010 7:18 pm
by l3whmg
Hi Mrduck,
WOW I will be your user :mrgreen:

Bye

Re: 3 databases 3 tabs 3 grids

Posted: Sat Nov 06, 2010 11:39 pm
by mrduck
l3whmg wrote:Hi Mrduck,
WOW I will be your user :mrgreen:

Bye
I'd like to be user of myself... :-)

But Roberto, Rathinagiri, Sudip and I believe others are the authors of the library, I'm just trying to realize a GUI interface I have in mind and that I'd like would use HMG as basis...

So, when I see something I don't like, I tell in the main hmg 4 thread but lately I get no reply to my comments.... :-(

Re: 3 databases 3 tabs 3 grids

Posted: Sun Nov 07, 2010 1:41 pm
by l3whmg
Hi Mrduck,
don't worry be happy :lol:
I remember my first question/suggestion (it was rel 1)... The suggestion is to persevere :mrgreen:
Best regards

Re: 3 databases 3 tabs 3 grids

Posted: Mon Nov 08, 2010 3:43 am
by Rathinagiri
mrduck wrote:I get no reply to my comments.... :-(
Is it so? If it is, sorry for the same.

Usually I see all the posts here since each post might give some clue for our problems.

Re: 3 databases 3 tabs 3 grids

Posted: Tue Nov 09, 2010 4:34 am
by Czarny_Pijar
mexicanto wrote:a very beginner questions...
Here's my miserable attempt to help you, in vain :cry:

I've try to solve this problem using 'set filter to', alas...

The error was raised when I've moved the cursor over the grid_2 - suddenly the procedure for the double-click for the grid_1 has been triggered...

Because the major forces of the crowd from here are on the front of HMG4, I know the help in this particular problem is very unlikely - c'est la vie...

Re: 3 databases 3 tabs 3 grids

Posted: Tue Nov 09, 2010 4:38 am
by Rathinagiri
Because the major forces of the crowd from here are on the front of HMG4
May be true. But not by foregoing the base. :)

Re: 3 databases 3 tabs 3 grids

Posted: Tue Nov 09, 2010 5:52 am
by Rathinagiri
I had changed some code and now it is not giving a run time error.

The filter is set. But it is not properly refreshed. I don't know why!? Since I am not using data bound grid, I could not find out the problem. Let us probe and find out...

Code: Select all

#include <hmg.ch>

Function Main

*--------------------- 1 base
  if !file("b1cus.dbf")
    DBCREATE("b1cus"    ,  { {"CUS_NUM"    , "C",    6   , 0},;
                             {"CUS_NAME"   , "C",   30   , 0}     },, .T., "")
  endif

  sele a
	Use b1cus	
	if lastrec()<1
	  appe blank
	  repl CUS_NUM with 'cus 1', CUS_NAME with 'customer AAAAAA'
	  appe blank
	  repl CUS_NUM with 'cus 2', CUS_NAME with 'customer BBBBBB'
	  appe blank
	  repl CUS_NUM with 'cus 3', CUS_NAME with 'customer CCCCCC'	
	endif

*--------------------- 2 base

  if !file("b2inv.dbf")
    DBCREATE("b2inv"    ,  { {"INV_NUM"    , "C",    6   , 0},;
                             {"INV_CUS"    , "C",    6   , 0},;
                             {"INV_DATE"   , "N",    9   , 2}     },, .T., "")
  endif

  sele b
	Use b2inv	
	if lastrec()<1
	  appe blank
	  repl INV_NUM with 'inv 1', INV_CUS with 'cus 1', INV_DATE with 123456.89
	  appe blank
	  repl INV_NUM with 'inv 2', INV_CUS with 'cus 3', INV_DATE with 222222.22
	  appe blank
	  repl INV_NUM with 'inv 3', INV_CUS with 'cus 1', INV_DATE with 333333.33
	  appe blank
	  repl INV_NUM with 'inv 4', INV_CUS with 'cus 3', INV_DATE with 444444.44
	  appe blank
	  repl INV_NUM with 'inv 5', INV_CUS with 'cus 2', INV_DATE with 555555.55
	  appe blank
	  repl INV_NUM with 'inv 6', INV_CUS with 'cus 2', INV_DATE with 666666.66
	endif

*--------------------- 3 base

  if !file("b3det.dbf")
    DBCREATE("b3det"    ,  { {"DET_INV"    , "C",    6   , 0},;
                             {"DET_PRO"    , "C",   30   , 0},;
                             {"DET_QTY"    , "N",    3   , 0},;
                             {"DET_PRI"    , "N",    6   , 2}     },, .T., "")
  endif

  sele c
	Use b3det
	if lastrec()<1
	  appe blank
	  repl DET_INV with 'inv 1', DET_PRO with 'product AAAAAAAA', DET_QTY with 999, DET_PRI with 123.56
	  appe blank
	  repl DET_INV with 'inv 1', DET_PRO with 'product BBBBBBBB', DET_QTY with 111, DET_PRI with 987.54
	  appe blank
	  repl DET_INV with 'inv 1', DET_PRO with 'product CCCCCCCC', DET_QTY with 999, DET_PRI with 123.56
	  appe blank
	  repl DET_INV with 'inv 2', DET_PRO with 'product BBBBBBBB', DET_QTY with 111, DET_PRI with 987.54
	  appe blank
	  repl DET_INV with 'inv 2', DET_PRO with 'product CCCCCCCC', DET_QTY with 999, DET_PRI with 123.56
	  appe blank
	  repl DET_INV with 'inv 3', DET_PRO with 'product ZZZZZZZZ', DET_QTY with 111, DET_PRI with 987.54
	  appe blank
	  repl DET_INV with 'inv 3', DET_PRO with 'product XXXXXXXX', DET_QTY with 999, DET_PRI with 123.56
	  appe blank
	  repl DET_INV with 'inv 1', DET_PRO with 'product CCCCCCCC', DET_QTY with 999, DET_PRI with 123.56
	  appe blank
	  repl DET_INV with 'inv 4', DET_PRO with 'product BBBBBBBB', DET_QTY with 111, DET_PRI with 987.54
	  appe blank
	  repl DET_INV with 'inv 4', DET_PRO with 'product CCCCCCCC', DET_QTY with 999, DET_PRI with 123.56
	  appe blank
	  repl DET_INV with 'inv 5', DET_PRO with 'product ZZZZZZZZ', DET_QTY with 111, DET_PRI with 987.54
	  appe blank
	  repl DET_INV with 'inv 6', DET_PRO with 'product XXXXXXXX', DET_QTY with 999, DET_PRI with 123.56
	endif

*--------------------------------------	
	
	      Load Window Main
	      Load Window form_3grids
        Main.Center
        Activate Window All

Return

*--------------------------------------------
*--------------------------------------------
*--------------------------------------------

proc p_quit()
  quit  
retu


*--------------------------------------------
*--------------------------------------------
*--------------------------------------------

proc p_open_form_3grids()
   form_3grids.Grid_2.EnableUpdate()
   form_3grids.show
retu

*--------------------------------------------
*--------------------------------------------
*--------------------------------------------

proc p_close_form_3grids()
   sele b
   set filter to
   go bottom 
   go top   
   form_3grids.Grid_2.refresh 
   form_3grids.hide
retu


*--------------------------------------------
*--------------------------------------------
*--------------------------------------------
proc p_grid1_dbl_cli()

   *----  1 reading the value from the database
   n_row := form_3grids.Grid_1.Recno
   sele a
   goto n_row
   
   *----   2 Information aboth the selected customer
   form_3grids.Label_1.Caption := a->cus_num + ' selected...'
   
   sele b
   *----   3 Re-activatng the filter
   set filter to b->INV_CUS == a->cus_num
   go top   
   form_3grids.Grid_2.refresh


retu
                                                                              
*--------------------------------------------
*--------------------------------------------
*--------------------------------------------

Re: 3 databases 3 tabs 3 grids

Posted: Tue Nov 09, 2010 7:17 am
by mexicanto
looks like at the end, it is not a very beginning question :)

thank you for your help, i hope someone can find a solution

daniel gaitan