GeoAvila (Geovanny G. Avila) Desarrollo.. de software.

6Jul/073

Textbox que permite sólo Letras en Vb.Net 05

Como en el ejemplo de solo números este código lo colocamos en el evento KeyPress de nuestras cajas de texto

VB.NET:
  1. If Char.IsLetter(e.KeyChar) Then
  2. e.Handled = False
  3. ElseIf Char.IsControl(e.KeyChar) Then
  4. e.Handled = False
  5. ElseIf Char.IsSeparator(e.KeyChar) Then
  6. e.Handled = False
  7. Else
  8. e.Handled = True
  9. End If

y así tenemos solo texto en nuestras cajas de texto

nos vemos

6Jul/074

Textbox que permite sólo Números en Vb.Net 05

Este código lo colocamos en el evento Keypress de nuestras cajas de texto que queremos que sean únicamente numéricas.

VB.NET:
  1. If Char.IsDigit(e.KeyChar) Then
  2. e.Handled = False
  3. ElseIf Char.IsControl(e.KeyChar) Then
  4. e.Handled = False
  5. Else
  6. e.Handled = True
  7. End If

y de esa manera es se omiten las letras y si deseamos que se admita el cero para decimales lo hacemos de la siguiente manera:

VB.NET:
  1. If e.KeyChar = "." Then
  2. e.Handled = False
  3. exit sub
  4. End If
  5. If Char.IsDigit(e.KeyChar) Then
  6. e.Handled = False
  7. ElseIf Char.IsControl(e.KeyChar) Then
  8. e.Handled = False
  9. Else
  10. e.Handled = True
  11. End If

listo un pequeño ejemplo

6Jul/079

Enviar parámetro a Reporting Services Vb.Net 05

Para enviar un parámetro  a Reporting Services primero hacemos un Imports  de Microsoft.Reporting.WebForms, agregamos un ReportViewer1 y  después de hacer esto  hacemos la llamada y también e incluímos los parámetros que vamos a enviar de la siguiente manera:

VB.NET:
  1. Private Sub Cargar()
  2. Dim instance As New Microsoft.Reporting.WinForms.ReportParameter("Oficina", "01")
  3. Dim instance1 As New Microsoft.Reporting.WinForms.ReportParameter("Fecha", "2004.01.01")
  4. Dim instance2 As New Microsoft.Reporting.WinForms.ReportParameter("Ordenadopor", "01")
  5. Dim prms(2) As Microsoft.Reporting.WinForms.ReportParameter
  6. prms(0) = instance
  7. prms(1) = instance1
  8. prms(2) = instance2
  9. ReportViewer1.ServerReport.ReportServerUrl = New Uri("https://www.geoavila.com/ReportServer/")
  10. ReportViewer1.ServerReport.ReportPath = "/Report Project2/rpt_balance_antiguedad"
  11. ReportViewer1.ServerReport.SetParameters(prms)
  12. ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote
  13. ReportViewer1.RefreshReport()
  14. End Sub
  15.  
  16. Private Sub CmdVer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdVer.Click
  17. Cargar()
  18. End Sub

De esta manera podremos visualizar un reporte en un Winforms.

nos vemos.

Sigueme en Twitter

Recent Posts

Amigos de Twitter

prsarahevans
evesosa
xabivargas
thomas_weller
albertomontt
J05uE
softcarlos
Blackstare
fayerwayer
guise
xisaac
orlandomgj
jazzandblue
daniellacayo
LibrosyMasgt
yoasumo
ChapinGeek
guilleybruno
TuFrac
Luckysilva
guatecham
Elultimodepaz
f0vela
tuxtor
andreimorales
xarquis
giopack
barcampgt
gjprensalibre
robertogt
Miguel_gt
emisorasunidas
jhony88
omarvelz
prensa_libre
tuiterasgt
Friends: Followers:

Categories

Sitios amigos

Algunos Derechos Reservados

Blog bajo licencia Creative Commons Attribution-ShareAlike 3.0 License
Creative Commons License