-
Jun 17th, 2024, 08:50 AM
#1
Thread Starter
New Member
-
Jun 17th, 2024, 09:00 AM
#2
Thread Starter
New Member
Re: How can I shft the print of subTotal in the DataGrid/control VSFLEXGRID in a row?
This is my programmed button with click event which I can read data from the data base
Private Sub btnLeggi_Click()
If Op1 = True And optd = 0 Then
mysql = " SELECT ordct.ccl, cli.RAGSOC, ordcc.*,isnull(ordct.trasp,'') as trasp FROM ordcc " _
& " left outer join ordct on ordct.ndoc=ordcc.ndoc and ordct.ddoc=ordcc.ddoc right join CLI on CLI.ID = ORDCT.CCL" _
& " WHERE ordcc.DCONS BETWEEN '" & FNRD(datain) & "' AND '" & FNRD(datafi) & "' and ordcc.CARTIC between '" & Ss(cartin) & "' and '" & Ss(cartfi) & "'" _
& " AND ordcc.DDOC BETWEEN '" & FNRD(din) & "' AND '" & FNRD(dfi) & "'" _
& " and ordcc.ndoc BETWEEN '" & Ss(FNSPAZISX(ndocin, 10)) & "' AND '" & Ss(FNSPAZISX(ndocfi, 10)) & "'"
If Val(cli) <> 0 Then mysql = mysql & " AND ordcc.CCL = " & Val(cli) & ""
If chiusi = True Then mysql = mysql & " AND ordcc.qtres=0"
If aperti = True Then mysql = mysql & " AND ordcc.qtres<>0"
mysql = mysql & " ORDER BY ordcc.CCL,ordcc.dCONS"
End If
Dim KIM As String
With dgOrdini
dgOrdini.Rows = 1
If Not OpenRsDb Then MsgBox ("ERRORE")
If rsdb.EOF = True Then lblTrovati = "Non ci sono ordini.": 'Call TappoTabella: Exit Sub
Do While Not rsdb.EOF
riga = riga + 1
.Rows = riga + 1
'.TextMatrix(riga, 0) = 0
.TextMatrix(riga, 0) = rsdb!CCL 'codice cliente
.TextMatrix(riga, 1) = rsdb!ragsoc 'rag. soc.
.TextMatrix(riga, 2) = "NDOC" 'num. ord. interno
.TextMatrix(riga, 3) = rsdb!DDOC 'd. ord
.TextMatrix(riga, 4) = rsdb!CCL 'n. ord. cliente
.TextMatrix(riga, 5) = rsdb!CARTIC 'cod. articolo
.TextMatrix(riga, 6) = rsdb!da 'descrizione
.TextMatrix(riga, 7) = rsdb!qt 'quantita ordinata
.TextMatrix(riga, 8) = rsdb!qtc 'quantita consegnata
.TextMatrix(riga, 9) = rsdb!qtres 'residuo
.TextMatrix(riga, 10) = rsdb!dcons 'data consegnata
rsdb.MoveNext
Loop
.Subtotal flexSTSum, [/I][/I], 7, , vbGreen, , , " Tot", 0, True
End With
End Sub[/I]
-
Jun 17th, 2024, 09:28 AM
#3
Re: How can I shft the print of subTotal in the DataGrid/control VSFLEXGRID in a row?
Show us the code you use to fill the grid and to display the "tot" rows.
-
Jun 17th, 2024, 11:34 AM
#4
Thread Starter
New Member
Re: How can I shft the print of subTotal in the DataGrid/control VSFLEXGRID in a row?
Private Sub btnLeggi_Click()
If Op1 = True And optd = 0 Then
mysql = " SELECT ordct.ccl, cli.RAGSOC, ordcc.*,isnull(ordct.trasp,'') as trasp FROM ordcc " _
& " left outer join ordct on ordct.ndoc=ordcc.ndoc and ordct.ddoc=ordcc.ddoc right join CLI on CLI.ID = ORDCT.CCL" _
& " WHERE ordcc.DCONS BETWEEN '" & FNRD(datain) & "' AND '" & FNRD(datafi) & "' and ordcc.CARTIC between '" & Ss(cartin) & "' and '" & Ss(cartfi) & "'" _
& " AND ordcc.DDOC BETWEEN '" & FNRD(din) & "' AND '" & FNRD(dfi) & "'" _
& " and ordcc.ndoc BETWEEN '" & Ss(FNSPAZISX(ndocin, 10)) & "' AND '" & Ss(FNSPAZISX(ndocfi, 10)) & "'"
If Val(cli) <> 0 Then mysql = mysql & " AND ordcc.CCL = " & Val(cli) & ""
If chiusi = True Then mysql = mysql & " AND ordcc.qtres=0"
If aperti = True Then mysql = mysql & " AND ordcc.qtres<>0"
mysql = mysql & " ORDER BY ordcc.CCL,ordcc.dCONS"
End If
Dim KIM As String
With dgOrdini
dgOrdini.Rows = 1
If Not OpenRsDb Then MsgBox ("ERRORE")
If rsdb.EOF = True Then lblTrovati = "Non ci sono ordini.": 'Call TappoTabella: Exit Sub
Do While Not rsdb.EOF
riga = riga + 1
.Rows = riga + 1
'.TextMatrix(riga, 0) = 0
.TextMatrix(riga, 0) = rsdb!CCL 'codice cliente
.TextMatrix(riga, 1) = rsdb!ragsoc 'rag. soc.
.TextMatrix(riga, 2) = "NDOC" 'num. ord. interno
.TextMatrix(riga, 3) = rsdb!DDOC 'd. ord
.TextMatrix(riga, 4) = rsdb!CCL 'n. ord. cliente
.TextMatrix(riga, 5) = rsdb!CARTIC 'cod. articolo
.TextMatrix(riga, 6) = rsdb!da 'descrizione
.TextMatrix(riga, 7) = rsdb!qt 'quantita ordinata
.TextMatrix(riga, 8) = rsdb!qtc 'quantita consegnata
.TextMatrix(riga, 9) = rsdb!qtres 'residuo
.TextMatrix(riga, 10) = rsdb!dcons 'data consegnata
rsdb.MoveNext
Loop
.Subtotal flexSTSum, , 7, , vbGreen, , , " Tot", 0, True
End With
End Sub
-
Jun 17th, 2024, 11:40 AM
#5
Hyperactive Member
Re: How can I shft the print of subTotal in the DataGrid/control VSFLEXGRID in a row?
You just want to move the "Tot" text?
You can completely alter the rows after each call to .Subtotal, something like:
Code:
For lRow = 1 To .Rows - 1
If .IsSubtotal(lRow) Then
.TextMatrix(lRow, 0) = ""
.TextMatrix(lRow, 5) = "Tot"
End If
Next
-
Jun 17th, 2024, 01:00 PM
#6
Re: How can I shft the print of subTotal in the DataGrid/control VSFLEXGRID in a row?
Your description of what you want to accomplish is very confusing. AND, that tiny image is almost/really unreadable.
I don't see any "tot" letters in column 6 (which would be col(7)) in your little picture.
And I surely don't understand what you mean to make the first 6 columns (0 through 5) blank after you do whatever you want to do.
Try again (I don't need your code on filling the grid, more interested in what you have done in code to do whatever you want to do.)
ahenry might have your solution...but to WHAT? Why? To accomplish what?
Sam
Sam I am (as well as Confused at times).
-
Jun 17th, 2024, 02:37 PM
#7
Hyperactive Member
Re: How can I shft the print of subTotal in the DataGrid/control VSFLEXGRID in a row?
The thing to watch out for with VSFlexGrid is that the subtotal function can tie into a lot of different features. So if you're just filling in the data once and subtotalling you can customize without worries, but if you get fancy with the grid functions then customizing it might not be worth the effort.
-
Sep 4th, 2024, 09:24 AM
#8
Thread Starter
New Member
Re: How can I shft the print of subTotal in the DataGrid/control VSFLEXGRID in a row?
 Originally Posted by SamOscarBrown
Your description of what you want to accomplish is very confusing. AND, that tiny image is almost/really unreadable.
I don't see any "tot" letters in column 6 (which would be col(7)) in your little picture.
And I surely don't understand what you mean to make the first 6 columns (0 through 5) blank after you do whatever you want to do.
Try again (I don't need your code on filling the grid, more interested in what you have done in code to do whatever you want to do.)
ahenry might have your solution...but to WHAT? Why? To accomplish what?
Sam
Hi... I solved it with this code Thank you very much anyway!
Private Sub btnLeggi_Click()
If Op1 = True And optd = 0 Then
mysql = " SELECT ordct.ccl, cli.RAGSOC, ordcc.*,isnull(ordct.trasp,'') as trasp FROM ordcc " _
& " left outer join ordct on ordct.ndoc=ordcc.ndoc and ordct.ddoc=ordcc.ddoc right join CLI on CLI.ID = ORDCT.CCL" _
& " WHERE ordcc.DCONS BETWEEN '" & FNRD(datain) & "' AND '" & FNRD(datafi) & "' and ordcc.CARTIC between '" & Ss(cartin) & "' and '" & Ss(cartfi) & "'" _
& " AND ordcc.DDOC BETWEEN '" & FNRD(din) & "' AND '" & FNRD(dfi) & "'" _
& " and ordcc.ndoc BETWEEN '" & Ss(FNSPAZISX(ndocin, 10)) & "' AND '" & Ss(FNSPAZISX(ndocfi, 10)) & "'"
If Val(cli) <> 0 Then mysql = mysql & " AND ordcc.CCL = " & Val(cli) & ""
If chiusi = True Then mysql = mysql & " AND ordcc.qtres=0"
If aperti = True Then mysql = mysql & " AND ordcc.qtres<>0"
mysql = mysql & " ORDER BY ordcc.CCL,ordcc.dCONS"
End If
Dim KIM As String
With dgOrdini
dgOrdini.Rows = 1
If Not OpenRsDb Then MsgBox ("ERRORE")
If rsdb.EOF = True Then lblTrovati = "Non ci sono ordini."
Dim riga As Integer
Do While Not rsdb.EOF
riga = riga + 1
.Rows = riga + 1
'.TextMatrix(riga, 0) = 0
'da qua incolla
.TextMatrix(riga, 0) = rsdb!CCL 'codice cliente
.TextMatrix(riga, 1) = rsdb!ragsoc 'rag. soc.
.TextMatrix(riga, 2) = rsdb!ndoc 'num. ord. interno
.TextMatrix(riga, 3) = rsdb!DDOC 'd. ord
.TextMatrix(riga, 4) = rsdb!CCL 'n. ord. cliente
.TextMatrix(riga, 5) = rsdb!CARTIC 'cod. articolo
.TextMatrix(riga, 6) = rsdb!da 'descrizione
.TextMatrix(riga, 7) = rsdb!qt 'quantita ordinata
.TextMatrix(riga, 8) = rsdb!qtc 'quantita consegnata
.TextMatrix(riga, 9) = rsdb!qtres 'residuo
.TextMatrix(riga, 10) = rsdb!dcons 'data consegnata
rsdb.MoveNext
Loop
.Subtotal flexSTSum, , 7, , , vbRed, , " ", 0, False:
For i = 1 To dgOrdini.Rows - 1 Step 1
If .TextMatrix(i, 0) = " " Then
.TextMatrix(i, 6) = "tot"
End If
Next i
End With
End Sub
-
Sep 4th, 2024, 09:25 AM
#9
Thread Starter
New Member
Re: How can I shft the print of subTotal in the DataGrid/control VSFLEXGRID in a row?
 Originally Posted by ahenry
The thing to watch out for with VSFlexGrid is that the subtotal function can tie into a lot of different features. So if you're just filling in the data once and subtotalling you can customize without worries, but if you get fancy with the grid functions then customizing it might not be worth the effort.
Hi... I solved it with this code Thank you very much anyway!
Private Sub btnLeggi_Click()
If Op1 = True And optd = 0 Then
mysql = " SELECT ordct.ccl, cli.RAGSOC, ordcc.*,isnull(ordct.trasp,'') as trasp FROM ordcc " _
& " left outer join ordct on ordct.ndoc=ordcc.ndoc and ordct.ddoc=ordcc.ddoc right join CLI on CLI.ID = ORDCT.CCL" _
& " WHERE ordcc.DCONS BETWEEN '" & FNRD(datain) & "' AND '" & FNRD(datafi) & "' and ordcc.CARTIC between '" & Ss(cartin) & "' and '" & Ss(cartfi) & "'" _
& " AND ordcc.DDOC BETWEEN '" & FNRD(din) & "' AND '" & FNRD(dfi) & "'" _
& " and ordcc.ndoc BETWEEN '" & Ss(FNSPAZISX(ndocin, 10)) & "' AND '" & Ss(FNSPAZISX(ndocfi, 10)) & "'"
If Val(cli) <> 0 Then mysql = mysql & " AND ordcc.CCL = " & Val(cli) & ""
If chiusi = True Then mysql = mysql & " AND ordcc.qtres=0"
If aperti = True Then mysql = mysql & " AND ordcc.qtres<>0"
mysql = mysql & " ORDER BY ordcc.CCL,ordcc.dCONS"
End If
Dim KIM As String
With dgOrdini
dgOrdini.Rows = 1
If Not OpenRsDb Then MsgBox ("ERRORE")
If rsdb.EOF = True Then lblTrovati = "Non ci sono ordini."
Dim riga As Integer
Do While Not rsdb.EOF
riga = riga + 1
.Rows = riga + 1
'.TextMatrix(riga, 0) = 0
'da qua incolla
.TextMatrix(riga, 0) = rsdb!CCL 'codice cliente
.TextMatrix(riga, 1) = rsdb!ragsoc 'rag. soc.
.TextMatrix(riga, 2) = rsdb!ndoc 'num. ord. interno
.TextMatrix(riga, 3) = rsdb!DDOC 'd. ord
.TextMatrix(riga, 4) = rsdb!CCL 'n. ord. cliente
.TextMatrix(riga, 5) = rsdb!CARTIC 'cod. articolo
.TextMatrix(riga, 6) = rsdb!da 'descrizione
.TextMatrix(riga, 7) = rsdb!qt 'quantita ordinata
.TextMatrix(riga, 8) = rsdb!qtc 'quantita consegnata
.TextMatrix(riga, 9) = rsdb!qtres 'residuo
.TextMatrix(riga, 10) = rsdb!dcons 'data consegnata
rsdb.MoveNext
Loop
.Subtotal flexSTSum, , 7, , , vbRed, , " ", 0, False:
For i = 1 To dgOrdini.Rows - 1 Step 1
If .TextMatrix(i, 0) = " " Then
.TextMatrix(i, 6) = "tot"
End If
Next i
End With
End Sub
-
Sep 4th, 2024, 09:25 AM
#10
Thread Starter
New Member
Re: How can I shft the print of subTotal in the DataGrid/control VSFLEXGRID in a row?
 Originally Posted by Arnoutdv
Show us the code you use to fill the grid and to display the "tot" rows.
Hi... I solved it with this code Thank you very much anyway!
Private Sub btnLeggi_Click()
If Op1 = True And optd = 0 Then
mysql = " SELECT ordct.ccl, cli.RAGSOC, ordcc.*,isnull(ordct.trasp,'') as trasp FROM ordcc " _
& " left outer join ordct on ordct.ndoc=ordcc.ndoc and ordct.ddoc=ordcc.ddoc right join CLI on CLI.ID = ORDCT.CCL" _
& " WHERE ordcc.DCONS BETWEEN '" & FNRD(datain) & "' AND '" & FNRD(datafi) & "' and ordcc.CARTIC between '" & Ss(cartin) & "' and '" & Ss(cartfi) & "'" _
& " AND ordcc.DDOC BETWEEN '" & FNRD(din) & "' AND '" & FNRD(dfi) & "'" _
& " and ordcc.ndoc BETWEEN '" & Ss(FNSPAZISX(ndocin, 10)) & "' AND '" & Ss(FNSPAZISX(ndocfi, 10)) & "'"
If Val(cli) <> 0 Then mysql = mysql & " AND ordcc.CCL = " & Val(cli) & ""
If chiusi = True Then mysql = mysql & " AND ordcc.qtres=0"
If aperti = True Then mysql = mysql & " AND ordcc.qtres<>0"
mysql = mysql & " ORDER BY ordcc.CCL,ordcc.dCONS"
End If
Dim KIM As String
With dgOrdini
dgOrdini.Rows = 1
If Not OpenRsDb Then MsgBox ("ERRORE")
If rsdb.EOF = True Then lblTrovati = "Non ci sono ordini."
Dim riga As Integer
Do While Not rsdb.EOF
riga = riga + 1
.Rows = riga + 1
'.TextMatrix(riga, 0) = 0
'da qua incolla
.TextMatrix(riga, 0) = rsdb!CCL 'codice cliente
.TextMatrix(riga, 1) = rsdb!ragsoc 'rag. soc.
.TextMatrix(riga, 2) = rsdb!ndoc 'num. ord. interno
.TextMatrix(riga, 3) = rsdb!DDOC 'd. ord
.TextMatrix(riga, 4) = rsdb!CCL 'n. ord. cliente
.TextMatrix(riga, 5) = rsdb!CARTIC 'cod. articolo
.TextMatrix(riga, 6) = rsdb!da 'descrizione
.TextMatrix(riga, 7) = rsdb!qt 'quantita ordinata
.TextMatrix(riga, 8) = rsdb!qtc 'quantita consegnata
.TextMatrix(riga, 9) = rsdb!qtres 'residuo
.TextMatrix(riga, 10) = rsdb!dcons 'data consegnata
rsdb.MoveNext
Loop
.Subtotal flexSTSum, , 7, , , vbRed, , " ", 0, False:
For i = 1 To dgOrdini.Rows - 1 Step 1
If .TextMatrix(i, 0) = " " Then
.TextMatrix(i, 6) = "tot"
End If
Next i
End With
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|