Visual Basic - MSHFlexGrid - combinar celdas

Life is soft - evento anual de software empresarial
 
Vista:

MSHFlexGrid - combinar celdas

Publicado por Sergio (13 intervenciones) el 17/09/2004 17:56:55
no hay caso, no puedo hacer que en el MSHFlexGrid se combinen las celdas, les paso el codigo que escribi

SelFilPro = "Select * From .......

Set rsHistorico = New ADODB.Recordset
rsHistorico.Open SelFilPro, cnHistorico, adOpenDynamic, adLockOptimistic

Fila = 1
While Not (rsHistorico.EOF)
With MSHFlexGrid1
.TextMatrix(Fila, 0) = Fila
.TextMatrix(Fila, 1) = Format(rsHistorico!Fecha, TempFormatoFecha)
.TextMatrix(Fila, 2) = rsHistorico!VidrioPet
.TextMatrix(Fila, 3) = rsHistorico!Linea
.TextMatrix(Fila, 4) = rsHistorico!Producto
rsHistorico.MoveNext
Fila = Fila + 1
.Rows = Fila + 1
End With
Wend
MSHFlexGrid1.Rows = Fila

'combinacion de celdas
MSHFlexGrid1.MergeCells
MSHFlexGrid1.MergeRow(0) = False
MSHFlexGrid1.MergeRow(1) = True
MSHFlexGrid1.MergeRow(2) = True
MSHFlexGrid1.MergeRow(3) = False
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:MSHFlexGrid - combinar celdas

Publicado por Ariel (94 intervenciones) el 20/09/2004 03:54:21
Hola espero que esto te sirva.

MSHFlexGrid1.MergeCells = flexMergeRestrictRows

coloca esta instruccion al final.

Si tienes duda consulta la MSDN.

Suerte...

Ariel.......
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:MSHFlexGrid - combinar celdas

Publicado por Sergio (13 intervenciones) el 21/09/2004 11:30:19
No hay caso, la MSDN ya la habia consultado, incluso en la ayuda dice de escribie el codigo al principio, pero no funciona ni al principio ni al final, otra sugerencia mas. Los datos si son los mismos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:MSHFlexGrid - combinar celdas

Publicado por Ariel (94 intervenciones) el 21/09/2004 17:12:43
Hola
Aqui tengo una rutina, que realice.
Solo Agrega en un Formulario un MSHFlexGrid1.
y Copia este Procedimiento.

'--------------------------
Sub FormatoGrilla()
Dim i As Integer

With MSHFlexGrid1
.Cols = 5 'indico cuantas columas tengo
.Rows = 10 'indico cuantas filas
.FixedRows = 2
.FixedCols = 0

'Asigno valores al encabezado
.TextMatrix(0, 0) = "CLIENTE"
.TextMatrix(0, 1) = "CLIENTE"
.TextMatrix(0, 2) = "CLIENTE"
.TextMatrix(0, 3) = "NOTAS"
.TextMatrix(0, 4) = "NOTAS"

.TextMatrix(1, 0) = "NOMBRE"
.TextMatrix(1, 1) = "APELLIDO"
.TextMatrix(1, 2) = "FONO"

.TextMatrix(1, 3) = "P1"
.TextMatrix(1, 4) = "PAIS"

.ColAlignmentFixed(0) = flexAlignCenterCenter ' Alineacion al Centro
.ColAlignmentFixed(3) = flexAlignCenterCenter ' Alineacion al Centro

'Fuciono Filas y Columnas, Segun se necesitan.
.MergeRow(0) = True '<-- Esto Fuciona las Filas Indicado por el Indice
.MergeCol(3) = True '<-- Esto Fuciona las Columnas P1
.MergeCol(4) = True '<-- Esto Fuciona las Columnas PAIS
.MergeCells = flexMergeRestrictColumns '<---Permite Fusionar Columnas

For i = 2 To .Rows - 1
.TextMatrix(i, 0) = "Nombre " & i
.TextMatrix(i, 1) = "Apellido " & i
.TextMatrix(i, 2) = Format(i, "690-0000")
Next i

.TextMatrix(2, 3) = "UNO"
.TextMatrix(3, 3) = "UNO"

.TextMatrix(4, 3) = "DOS"
.TextMatrix(5, 3) = "DOS"

.TextMatrix(6, 3) = "TRES"
.TextMatrix(7, 3) = "TRES"
.TextMatrix(8, 3) = "TRES"
.TextMatrix(9, 3) = "TRES"

.TextMatrix(2, 4) = "BRAZIL"
.TextMatrix(3, 4) = "EEUU"
.TextMatrix(4, 4) = "EEUU"
.TextMatrix(5, 4) = "MEXICO"
.TextMatrix(6, 4) = "CHILE"
.TextMatrix(7, 4) = "CHILE"
.TextMatrix(8, 4) = "CHILE"
.TextMatrix(9, 4) = "PERU"

End With

End Sub

y en el Evento Form Load

Private Sub Form_Load()
FormatoGrilla
End Sub

PD: te envie el ejemplo a tu correo.

Suerte, espero que te sirva

Ariel.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:MSHFlexGrid - combinar celdas

Publicado por Jordi (2 intervenciones) el 08/08/2023 15:56:39
A mi, me ha servido.

Yo he hecho esto

.MergeCells = flexMergeRestrictRows
.MergeRow(0) = True

Saludos y Muchas gracias.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar