MaximoAccess

Caro Usuário, antes de postar pela primeira vez, leia as regras do fórum.

https://www.maximoaccess.com/t48-regras-do-forum

Obrigado

Administração


Participe do fórum, é rápido e fácil

MaximoAccess

Caro Usuário, antes de postar pela primeira vez, leia as regras do fórum.

https://www.maximoaccess.com/t48-regras-do-forum

Obrigado

Administração

MaximoAccess

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Dicas Ms Access, Exemplos Ms Access, Codigos VBA Ms Access, SQL Ms Access


2 participantes

    Texto JUSTIFICADO no Access 2000

    avatar
    FranChasing
    Novato
    Novato


    Respeito às regras : Respeito às Regras 100%

    Sexo : Masculino
    Localização : Brasil
    Mensagens : 28
    Registrado : 03/03/2010

    Texto JUSTIFICADO no Access 2000 Empty Texto JUSTIFICADO no Access 2000

    Mensagem  FranChasing 9/6/2013, 17:09

    Olá, Galera Maximo Access

    Me perdoem, mas antes de vir até aqui ao forum pedir ajuda de vocês, eu estou tentando, tentando e nada. Nada !!!
    Já li muitos tópicos que tratam do assunto, mas nenhum me fazem chegar onde eu quero que é JUSTIFICAR texto no relatório do ACCESS 2000.
    Baixei arquivos do LEBANS, não sei o que acontece mas aqui no meu preview não mostra nenhum texto justificado (ehehe...).
    Baixei exemplos prontos e nenhum funciona. Produzi arquivos de acordo com tutoriais e mesmo assim não está dando certo.
    Peguei dicas dos feras JPaulo, WSenna e muitos outros e não deu "nada misturada com coisa nenhuma"...
    Por ironia, o Máximo Access que consegui foi alterar a propriedades da caixa de texto no relatório de Geral para Distribuir, mas a última linha "espalha" e aí só fazendo uso da famosa "gambiarra" inserindo espaços em branco no final da linha para poder ajustar. Que "viagem" da Microsoft...
    Será que o problema está entre EU e o glorioso ACCESS ?

    Por favor, alguém me ajuda ! Grato.
    Fernando Bueno
    Fernando Bueno
    Developer
    Developer


    Respeito às regras : Respeito às Regras 100%

    Sexo : Masculino
    Localização : Brasil
    Mensagens : 2115
    Registrado : 13/04/2012

    Texto JUSTIFICADO no Access 2000 Empty Re: Texto JUSTIFICADO no Access 2000

    Mensagem  Fernando Bueno 10/6/2013, 01:45

    Boa noite Francisco.

    Certa vez precisei de algo parecido e resolvi com esse codigo do Lebans no evento

    ao imprimir no detalhe do relatorio, chegou a testar algo parecido?

    Código:
    Option Compare Database
    Option Explicit

    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

    ' Modified from code written by Stephen Lebans
    ' Stephen@lebans.com
    ' www.lebans.com

    Const TWIPS = 1

    Dim intFirstX As Integer
    Dim intFirstVar As Integer
    Dim intFirstSingleQuote As Integer
    Dim intLastSingleQuote As Integer

    Dim strX As String
    Dim strVar As String
    Dim strCultivar As String

    Dim intHorSize As Integer
    Dim intLabelWidth As Integer

    Dim CtlDetail As Control


    For Each CtlDetail In Me.Section(acDetail).Controls
    'Print Common Name
        If CtlDetail.Name = "txtCommonName" Then
        'Hide what would otherwise print
            With CtlDetail
                .Visible = False
            End With
           
        With Me
        'Grab current Font settings
            .FontName = CtlDetail.FontName
            .FontSize = CtlDetail.FontSize
        End With
       
        intLabelWidth = Me.Width
        intHorSize = TextWidth(txtCommonName)
        'Center text horizontially
        Me.CurrentX = (intLabelWidth / 2) - (intHorSize / 2)
        Me.CurrentY = 144          'Start 0.10" from the top

            With Me
                .ScaleMode = TWIPS      'Make sure units are in Twips
                .FontItalic = False    'Create desired Font settings
                .FontBold = True
                Print Trim(CommonName)
            End With
        End If

    'Print Botanical Name
        If CtlDetail.Name = "txtSpecies" Then
            With CtlDetail
                .Visible = False ' Hide what would otherwise print
            'Find location of first " x " in txtSpecies.
            'If present then place it in strX excluding its flanking spaces.
                intFirstX = InStr(1, .Value, " x ")
                If intFirstX > 0 Then
                    strX = "x"  'Mid(.Value, intFirstX, 3)
                Else
                    strX = ""
                End If
           
            'Find location of first " var. " in txtSpecies.
            'If it is there place it in strVar excluding its flanking spaces.
                intFirstVar = InStr(1, .Value, " var. ")
                If intFirstVar > 0 Then
                    strVar = "var."  'Mid(.Value, intFirstVar, 6)
                Else
                    strVar = ""
                End If
            'Find location of first " '" and last "'" in txtSpecies.
            'If they are there place them and the text between them in strCultivar.
                intFirstSingleQuote = InStr(1, .Value, " '")
                intLastSingleQuote = InStr(intFirstSingleQuote + 2, .Value, "'")
                If intFirstSingleQuote > 0 Then
                    strCultivar = Mid(.Value, intFirstSingleQuote, intLastSingleQuote + 1 - intFirstSingleQuote) & " "
                Else
                    strCultivar = ""
                End If
               
            End With
           
        With Me
        'Grab Controls current Font settings
            .FontName = CtlDetail.FontName
            .FontSize = CtlDetail.FontSize
        End With
       
        intLabelWidth = Me.Width
        intHorSize = TextWidth(txtSpecies)
        'Center text horizontially
        If IsNull(Variety) Then
            Me.CurrentX = (intLabelWidth / 2) - (intHorSize / 2)
        Else
            Me.CurrentX = (intLabelWidth / 2) - (intHorSize / 2) * 1.06
        End If
        Me.CurrentY = 576 'Start 0.40" from the top

            With Me
            ' Make sure we are in Twips
                .ScaleMode = TWIPS
                                   

            ' Create desired Font settings for the Genus & SpecificEpithet
                .FontItalic = True
                .FontBold = True
                Print Trim(Genus) & " " & Trim(SpecificEpithet) & " ";
               
            ' If plant a Hybrid then print Hybrid in proper syntax.
                If IsNull(Hybrid) Then
                    Print "";
                Else
                    .FontItalic = False
                    .FontBold = False
                    Print " " & strX & " ";
                    .FontItalic = True
                    .FontBold = True
                    Print Trim(Hybrid) & " ";
                End If
               
            ' If plant a Variety then print Variety in proper syntax.
                If IsNull(Variety) Then
                    Print "";
                Else
                    .FontItalic = False
                    .FontBold = False
                    Print " " & strVar & " ";
                    .FontItalic = True
                    .FontBold = True
                    Print Trim(Variety) & " ";
                End If
            ' If plant is a Cultivar print Cultivar in single quotes, else quit.
                .FontItalic = False
                .FontBold = True
                Print " " & Trim(strCultivar)
               
            End With
        End If
    Next

    ' Cleanup
    Set CtlDetail = Nothing
    End Sub


    .................................................................................
    Um abraço
    Fernando Bueno


    O aumento do conhecimento é como uma esfera dilatando-se no espaço
    quanto maior a nossa compreensão,
    maior o nosso contacto com o desconhecido
    Texto JUSTIFICADO no Access 2000 16rzeq
    avatar
    FranChasing
    Novato
    Novato


    Respeito às regras : Respeito às Regras 100%

    Sexo : Masculino
    Localização : Brasil
    Mensagens : 28
    Registrado : 03/03/2010

    Texto JUSTIFICADO no Access 2000 Empty Re: Texto JUSTIFICADO no Access 2000

    Mensagem  FranChasing 10/6/2013, 02:27

    Olá, Fernando Bueno

    Lamento, mas inseri o código no evento imprimir e não deu certo. Isto é, não formatou de modo JUSTIFICADO o texto do campo no relatório da tabela (memorando).
    Se coloco para DISTRIBUIR, a última linha "espalha"...

    Conteúdo patrocinado


    Texto JUSTIFICADO no Access 2000 Empty Re: Texto JUSTIFICADO no Access 2000

    Mensagem  Conteúdo patrocinado


      Data/hora atual: 27/4/2024, 05:39