EMITIR ETIQUETA ACTIVE REPORT

WILSONJOSE 16/04/2016 19:21:54
#461030
Alguém teria um exemplo de como imprimir etiqueta pelo active report? Eu fiz, mas está pulando uma etiqueta em branco. Desde já agradeço
FABRICIOWEB 19/05/2016 08:14:26
#462262
[txt-color=#007100]Option Explicit
Private cnBd As ADODB.Connection
Private rs As ADODB.Recordset
Private sql As String
Dim i As Integer
Private Sub cbo_City_Click()
ListaCliente
End Sub
Private Sub cbo_uf_Click()
ListaCliente
End Sub
Private Sub Combo1_Click()
ListaCliente
End Sub
Private Sub Command1_Click()
End
End Sub

Private Sub Command3_Click()
Command3.Enabled = False
Command4.Enabled = True
For i = 1 To ListView1.ListItems.count
ListView1.ListItems.Item(i).Checked = True
Next
contagem
End Sub
Private Sub Command4_Click()
Command3.Enabled = True
Command4.Enabled = False
For i = 1 To ListView1.ListItems.count
ListView1.ListItems.Item(i).Checked = False
Next
contagem
End Sub
Private Sub Form_Load()
[ô]este codigo abaixo gera um um icone na barra de titulo
LBLICONE.Caption = 1
[ô]End If
Me.Icon = ImageList2.ListImages(CInt(LBLICONE.Caption)).ExtractIcon
Connect
ListaCliente
encheCombo
lbl_total = ListView1.ListItems.count
End Sub


Sub ListaCliente()
Dim aCampo As Variant
Dim lstPesq As ListItem

ListView1.ColumnHeaders(1).Text = [Ô]Código[Ô]
ListView1.ColumnHeaders(2).Text = [Ô]Nome[Ô]
ListView1.ColumnHeaders(3).Text = [Ô]Numero[Ô]
ListView1.ColumnHeaders(4).Text = [Ô] Estado[Ô]
ListView1.ColumnHeaders(5).Text = [Ô] Bairro[Ô]
ListView1.ColumnHeaders(6).Text = [Ô]Cidade[Ô]
ListView1.ColumnHeaders(7).Text = [Ô] Cep[Ô]
ListView1.ColumnHeaders(8).Text = [Ô] Rua[Ô]
Connect
sql = [Ô]SELECT Código, Nome, Numero, uf, Bairro,Cidade,Cep,Rua FROM clientes WHERE nome IN (0)[Ô]
[ô]sql = [Ô]SELECT Codig, Nome, Numero, Estado, Bairro,Cidade,Cep,Rua FROM clientes WHERE nome IN (0)[Ô], CON, adOpenStatic, adLockOptimistic
If Combo1.ListIndex > 0 Then
sql = sql & [Ô] AND nome LIKE [ô][Ô] & Combo1.Text & [Ô]%[ô][Ô]
End If

If cbo_City.ListIndex > 0 Then
sql = sql & [Ô] AND Cidade LIKE [ô][Ô] & cbo_City.Text & [Ô]%[ô][Ô]
End If


If cbo_uf.ListIndex > 0 Then
sql = sql & [Ô] AND uf LIKE [ô][Ô] & cbo_uf.Text & [Ô][ô][Ô]
End If
sql = sql & [Ô] ORDER BY código[Ô]

ListView1.ListItems.Clear
Set rs = CON.Execute(sql)
If Not rs.eof Then
aCampo = rs.GetRows
rs.Close

For i = LBound(aCampo, 2) To UBound(aCampo, 2)

Set lstPesq = ListView1.ListItems.Add(, , (aCampo(0, i)), 1, 1)
lstPesq.SubItems(1) = Nvl((aCampo(1, i)), [Ô][Ô])
lstPesq.SubItems(2) = Nvl((aCampo(2, i)), [Ô][Ô])
lstPesq.SubItems(3) = Nvl((aCampo(3, i)), [Ô][Ô])
lstPesq.SubItems(4) = Nvl((aCampo(4, i)), [Ô][Ô])
lstPesq.SubItems(5) = Nvl((aCampo(5, i)), [Ô][Ô])
lstPesq.SubItems(6) = Nvl((aCampo(6, i)), [Ô][Ô])

lstPesq.SubItems(7) = Nvl((aCampo(7, i)), [Ô][Ô])
Next
End If
End Sub
Public Function Nvl(afldNome, astrValor)
On Error Resume Next
Dim lbolNull
If IsNull(afldNome) Or afldNome = [Ô][Ô] Then
lbolNull = True
ElseIf Len(Trim(afldNome)) = 0 Then
lbolNull = True
Else
lbolNull = False
End If

If lbolNull Then
Nvl = Trim(astrValor)
Else
Nvl = Trim(afldNome)
End If
End Function
Private Sub imgGerar_Click()
With ficha_etiquetas
For i = 1 To ListView1.ListItems.count
If ListView1.ListItems(i).Checked = True Then
.cont = .cont + 1
End If
Next
If .cont = 0 Then: MsgBox [Ô]Selecione os Cliente[Ô], vbInformation: Exit Sub
.InitArray
.show vbModal
Exit Sub
End With
End Sub
Private Sub imgsair_Click()
Unload Me
End Sub
Private Sub ListView1_ItemCheck(ByVal Item As MSComctlLib.ListItem)
contagem
End Sub
Sub contagem()
lbl_total1 = 0
For i = 1 To ListView1.ListItems.count
If ListView1.ListItems(i).Checked = True Then
lbl_total1 = CCur(Nvl(lbl_total1, 0) + 1)
End If
Next
End Sub
Sub encheCombo()
[ô] combo que que pega todos os nomes de clientes com determinada
[ô]letra
Combo1.AddItem [Ô] [Ô]
Combo1.AddItem [Ô]A[Ô]
Combo1.AddItem [Ô]B[Ô]
Combo1.AddItem [Ô]C[Ô]
Combo1.AddItem [Ô]D[Ô]
Combo1.AddItem [Ô]E[Ô]
Combo1.AddItem [Ô]F[Ô]
Combo1.AddItem [Ô]G[Ô]
Combo1.AddItem [Ô]H[Ô]
Combo1.AddItem [Ô]I[Ô]
Combo1.AddItem [Ô]J[Ô]
Combo1.AddItem [Ô]K[Ô]
Combo1.AddItem [Ô]L[Ô]
Combo1.AddItem [Ô]M[Ô]
Combo1.AddItem [Ô]N[Ô]
Combo1.AddItem [Ô]O[Ô]
Combo1.AddItem [Ô]P[Ô]
Combo1.AddItem [Ô]Q[Ô]
Combo1.AddItem [Ô]R[Ô]
Combo1.AddItem [Ô]S[Ô]
Combo1.AddItem [Ô]T[Ô]
Combo1.AddItem [Ô]U[Ô]
Combo1.AddItem [Ô]V[Ô]
Combo1.AddItem [Ô]W[Ô]
Combo1.AddItem [Ô]X[Ô]
Combo1.AddItem [Ô]y[Ô]
Combo1.AddItem [Ô]Z[Ô]


[ô] com bo que todos os nomes de cidade começados com determinada
[ô]letra
cbo_City.AddItem [Ô] [Ô]
cbo_City.AddItem [Ô]A[Ô]
cbo_City.AddItem [Ô]B[Ô]
cbo_City.AddItem [Ô]C[Ô]
cbo_City.AddItem [Ô]D[Ô]
cbo_City.AddItem [Ô]E[Ô]
cbo_City.AddItem [Ô]F[Ô]
cbo_City.AddItem [Ô]G[Ô]
cbo_City.AddItem [Ô]H[Ô]
cbo_City.AddItem [Ô]I[Ô]
cbo_City.AddItem [Ô]J[Ô]
cbo_City.AddItem [Ô]K[Ô]
cbo_City.AddItem [Ô]L[Ô]
cbo_City.AddItem [Ô]M[Ô]
cbo_City.AddItem [Ô]N[Ô]
cbo_City.AddItem [Ô]O[Ô]
cbo_City.AddItem [Ô]P[Ô]
cbo_City.AddItem [Ô]Q[Ô]
cbo_City.AddItem [Ô]R[Ô]
cbo_City.AddItem [Ô]S[Ô]
cbo_City.AddItem [Ô]T[Ô]
cbo_City.AddItem [Ô]U[Ô]
cbo_City.AddItem [Ô]V[Ô]
cbo_City.AddItem [Ô]W[Ô]
cbo_City.AddItem [Ô]X[Ô]
cbo_City.AddItem [Ô]y[Ô]
cbo_City.AddItem [Ô]Z[Ô]

[ô] combo q pega todos os estados
cbo_uf.AddItem [Ô][Ô]
cbo_uf.AddItem [Ô]AC[Ô]
cbo_uf.AddItem [Ô]AL[Ô]
cbo_uf.AddItem [Ô]AM[Ô]
cbo_uf.AddItem [Ô]AP[Ô]
cbo_uf.AddItem [Ô]BA[Ô]
cbo_uf.AddItem [Ô]CE[Ô]
cbo_uf.AddItem [Ô]ES[Ô]
cbo_uf.AddItem [Ô]GO[Ô]
cbo_uf.AddItem [Ô]MA[Ô]
cbo_uf.AddItem [Ô]CE[Ô]
cbo_uf.AddItem [Ô]MG[Ô]
cbo_uf.AddItem [Ô]MS[Ô]
cbo_uf.AddItem [Ô]MT[Ô]
cbo_uf.AddItem [Ô]PA[Ô]
cbo_uf.AddItem [Ô]PB[Ô]
cbo_uf.AddItem [Ô]PE[Ô]
cbo_uf.AddItem [Ô]PI[Ô]
cbo_uf.AddItem [Ô]PR[Ô]
cbo_uf.AddItem [Ô]RJ[Ô]
cbo_uf.AddItem [Ô]RN[Ô]
cbo_uf.AddItem [Ô]RO[Ô]
cbo_uf.AddItem [Ô]RR[Ô]
cbo_uf.AddItem [Ô]RS[Ô]
cbo_uf.AddItem [Ô]SC[Ô]
cbo_uf.AddItem [Ô]SE[Ô]
cbo_uf.AddItem [Ô]SP[Ô]
cbo_uf.AddItem [Ô]TO[Ô]

End Sub[/txt-color]

[txt-color=#e80000]
ISSO DENTRO DO ACTIVE REPÓRTER[/txt-color]
[txt-color=#0000f0]

Option Explicit
Public cont As Integer
Public bLastIsSingle As Boolean
Private arr(1 To 100) As OrderItem
Dim i As Integer
Private iRow As Integer
Private tmpAmount As Currency
Private bNewGroup As Boolean
Private Type OrderItem
codigo As String
nome As String
Numeronoti As String
Estado As String
BairroNoti As String
CidadeNoti As String
CepNoti As String
RuaNoti As String
End Type
Private bLastPage As Boolean
Private Sub ActiveReport_DataInitialize()
Fields.Add [Ô]codigo[Ô]
Fields.Add [Ô]nome[Ô]
Fields.Add [Ô]Numeronoti[Ô]
Fields.Add [Ô]Estado[Ô]
Fields.Add [Ô]BairroNoti[Ô]
Fields.Add [Ô]CidadeNoti[Ô]
Fields.Add [Ô]CepNoti[Ô]
Fields.Add [Ô]RuaNoti[Ô]
iRow = LBound(arr)
End Sub
Private Sub ActiveReport_FetchData(eof As Boolean)
If iRow > cont Then
eof = True
Exit Sub
End If

If arr(iRow).codigo <> [Ô][Ô] Then
Fields([Ô]codigo[Ô]) = arr(iRow).codigo
Fields([Ô]nome[Ô]) = arr(iRow).nome
Fields([Ô]Numeronoti[Ô]) = arr(iRow).Numeronoti
Fields([Ô]Estado[Ô]) = arr(iRow).Estado
Fields([Ô]BairroNoti[Ô]) = arr(iRow).BairroNoti
Fields([Ô]CidadeNoti[Ô]) = arr(iRow).CidadeNoti
Fields([Ô]CepNoti[Ô]) = arr(iRow).CepNoti
Fields([Ô]RuaNoti[Ô]) = arr(iRow).RuaNoti
End If
eof = False
iRow = iRow + 1
bLastPage = eof
End Sub
Public Sub InitArray()
Dim X As Integer
With Form1uuuu
For i = 1 To .ListView1.ListItems.count
If .ListView1.ListItems(i).Checked = True Then
X = X + 1
arr(X).codigo = .ListView1.ListItems(i)
arr(X).nome = .ListView1.ListItems(i).ListSubItems(1)
arr(X).Numeronoti = .ListView1.ListItems(i).ListSubItems(2)
arr(X).Estado = .ListView1.ListItems(i).ListSubItems(3)
arr(X).BairroNoti = .ListView1.ListItems(i).ListSubItems(4)
arr(X).CidadeNoti = .ListView1.ListItems(i).ListSubItems(5)
arr(X).CepNoti = .ListView1.ListItems(i).ListSubItems(6)
arr(X).RuaNoti = .ListView1.ListItems(i).ListSubItems(7)
End If
Next
End With
End Sub
Private Sub ActiveReport_PageStart() [ô]muda para portugues o tooltips do menu do active
With ficha_etiquetas
.ToolBar.Tools.Item(0).Visible = False
.ToolBar.Tools.Item(2).ToolTip = [Ô]Imprimir[Ô]
.ToolBar.Tools.Item(2).Caption = [Ô][Ô]
.ToolBar.Tools.Item(4).ToolTip = [Ô]Copiar[Ô]
.ToolBar.Tools.Item(6).Visible = False
.ToolBar.Tools.Item(8).ToolTip = [Ô]Somente uma página[Ô]
.ToolBar.Tools.Item(9).ToolTip = [Ô]Múltiplas páginas[Ô]
.ToolBar.Tools.Item(9).ToolTip = [Ô]Múltiplas páginas[Ô]
.ToolBar.Tools.Item(15).ToolTip = [Ô]Página Anterior[Ô]
.ToolBar.Tools.Item(16).ToolTip = [Ô]Página Seguinte[Ô]
.ToolBar.Tools.Item(17).ToolTip = [Ô]Página[Ô]
End With
End Sub
Private Sub PageFooter_Format()
If bLastPage Then
lblContinued.Caption = [Ô]Continua..[Ô]
Else
lblContinued.Caption = [Ô]Ficha Completa[Ô]
End If
End Sub



[/txt-color]










FABRICIOWEB 19/05/2016 08:16:27
#462263
ACTIVE REPORTER
Faça seu login para responder