3 databases 3 tabs 3 grids

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: 3 databases 3 tabs 3 grids

Post 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
Luigi from Italy
www.L3W.it
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: 3 databases 3 tabs 3 grids

Post 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"...
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: 3 databases 3 tabs 3 grids

Post by l3whmg »

Hi Mrduck,
WOW I will be your user :mrgreen:

Bye
Luigi from Italy
www.L3W.it
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: 3 databases 3 tabs 3 grids

Post 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.... :-(
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: 3 databases 3 tabs 3 grids

Post 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
Luigi from Italy
www.L3W.it
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: 3 databases 3 tabs 3 grids

Post 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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Re: 3 databases 3 tabs 3 grids

Post 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...
Attachments
The screen with the error - to raise this: 1) select the customer from the Grid_1, then  2) move the cursor over Grid_2...
The screen with the error - to raise this: 1) select the customer from the Grid_1, then 2) move the cursor over Grid_2...
3grids_err.PNG (33.73 KiB) Viewed 3442 times
3grids_customer_order_detail.zip
The project wih 3 grids on the one form
(3.32 KiB) Downloaded 230 times
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: 3 databases 3 tabs 3 grids

Post 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. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: 3 databases 3 tabs 3 grids

Post 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
                                                                              
*--------------------------------------------
*--------------------------------------------
*--------------------------------------------
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
mexicanto

Re: 3 databases 3 tabs 3 grids

Post 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
Post Reply