Topic: Copying tGrid footer values with conditions

I couldn't get my head around to do this...


Attached sample project is based on one of Derek's kind help project.
Transactions items uses combobox  filter. Default displays all transactions, sales and refunds.
I wanted copy and display totals of filtered tGrid Total column footer value to respective edit boxes below the tGrid at all times but couldn't do it. Any help please?
https://s29.postimg.org/qr4f44ehj/zzzzz_Temp28.png

Post's attachments

Attachment icon InvRefund.zip 18.56 kb, 345 downloads since 2017-04-29 

Adam
God... please help me become the person my dog thinks I am.

2 (edited by derek 2017-04-30 19:31:34)

Re: Copying tGrid footer values with conditions

Hi Adam,
Probably a couple of ways to do this but I'd suggest using calculated fields on the saleinv table and then displaying the total sales and total refunds values on form1.tgmaincustomerstrans (I've also added an invoice line count just to add a bit of extra info). 
This way, you see not only the total of the sales and refund values for each invoice (but without having to click on it), and you also get a grand total of sales and refund values for ALL invoices for that particular customer (see attached).  Just a thought.
Regards,
Derek.

Post's attachments

Attachment icon InvRefund.zip 352.63 kb, 352 downloads since 2017-04-30 

3 (edited by AD1408 2017-05-01 15:11:22)

Re: Copying tGrid footer values with conditions

Hi Derek,


Great stuff as usual.... Thank you very much.......
Nice touch on adding line count.


I have added label name display above transaction tGrids. i.e. Instead of static label saying "Transactions History of selected product" it says "Transaction History of product: [product name]" by adding another label and fetching product name into second label. All good but two issues I couldn't solve:


1. Focus on tGrid rows works fine thanks to you. I wanted apply same focus - update on label that displays item name. When navigated product tab, it focuses on first row of the main and sub table and updates accordingly, which is great. I wanted update focused row record label name also automatically?
Currently label is only updated on click or keyboard up and down.

2. Fetching single field into label done, but I couldn't do it with two field. i.e. Displaying customer name and surname in single label?


ps/. Just noticed, when browsing records i.e. from customer tGrid, inv and inv items tGrids vertical scroll bar briefly appears and disappears over tGrids footer?


Sample project attached.

Post's attachments

Attachment icon InvRefund 3.zip 19.22 kb, 353 downloads since 2017-05-01 

Adam
God... please help me become the person my dog thinks I am.

Re: Copying tGrid footer values with conditions

Most pressing issue on previous post is horizontal scroll bar flash. I have been trying to find the issue causing this strange behavior but so far no luck.

1. Click on a record from customer tgrid
2. Horizontal scroll bar briefly appears and disappears (flashes) over tGrid transactions and transaction items tGrids if transactions and transaction items tGrids contain records.


Is it a tGrid bug or I'm doing something wrong?
please see the sample project  InvRefund 3.zip on my previous post #3

Adam
God... please help me become the person my dog thinks I am.

Re: Copying tGrid footer values with conditions

Adam, See attached for customer and product label fix. You do not need to fetch the names from the database. Since the names are already in the main tablegrids, I just pulled them from the grids instead. It eliminates an extra read to the database.


I'm not sure what causes the horizontal scroll bar flash. I have noticed that in my own projects too. Maybe Dimitry can provide an explanation.

Post's attachments

Attachment icon InvRefund 4.zip 597.94 kb, 403 downloads since 2017-05-02 

6 (edited by AD1408 2017-05-02 20:57:12)

Re: Copying tGrid footer values with conditions

ehwagner wrote:

Adam, See attached for customer and product label fix. You do not need to fetch the names from the database. Since the names are already in the main tablegrids, I just pulled them from the grids instead. It eliminates an extra read to the database.


Hi EHW,
Thank you very much......................
Nice and clean solution!!!

Adam
God... please help me become the person my dog thinks I am.