EdiSimoes Posted February 20, 2014 at 12:33 PM Report #545928 Posted February 20, 2014 at 12:33 PM (edited) Olá a todos, alguém poderia me dar uma ajudinha de como imprimir números em um relatório com alinhamento da direita para esquerda, para que fique vírgula em baixo de vírgula. O código que estou usando é esse abaixo: e.Graphics.DrawString(vQtdSacos.ToString, _ fonteNormal, Brushes.Black, margemEsq + 700, _ PosicaoDaLinha, New StringFormat()) Agradecido, att, Edited February 20, 2014 at 12:35 PM by ribeiro55 Edi Carlos Simões Estudante de Análise e Desenvolvimento de Sistemas edisimoes@bol.com.br http://www.desenvolvenetma.com.br http://analisedesistemas.bl.ee
vikcch Posted February 20, 2014 at 12:46 PM Report #545932 Posted February 20, 2014 at 12:46 PM olá, com este code ficas a saber a altura e a largura da string... depois é fazer as contas... Dim textSize As Size = TextRenderer.MeasureText(tua_string, tua_fonte) MsgBox(textSize.Width)
EdiSimoes Posted February 20, 2014 at 01:53 PM Author Report #545936 Posted February 20, 2014 at 01:53 PM Olá amigo vikcch, não usei o seu código, mais graças a ele minha mente abriu e consegui ver o que poderia ser feito, e foi resolvido da seguinte forma. Vou deixar o código, se alguém tiver a mesma dúvida. e.Graphics.DrawString(vQtdSacos.ToString.PadLeft(4, " "), _ fonteNormal, Brushes.Black, margemEsq + 700, PosicaoDaLinha, New StringFormat()) valeu obrigado, até mais... Edi Carlos Simões Estudante de Análise e Desenvolvimento de Sistemas edisimoes@bol.com.br http://www.desenvolvenetma.com.br http://analisedesistemas.bl.ee
vikcch Posted February 20, 2014 at 02:56 PM Report #545941 Posted February 20, 2014 at 02:56 PM o importante foi resolver o problema... o code podia-se usar assim: Dim myFont As New Font("Arial", 15) e.Graphics.DrawString("1200.00", myFont, Brushes.Black, 700 - TextRenderer.MeasureText("1200.00", myFont).Width, 10) e.Graphics.DrawString("1.00", myFont, Brushes.Black, 700 - TextRenderer.MeasureText("1.00", myFont).Width, 30)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now