Imports System.Drawing
Imports System.Drawing.Printing
Imports System.Data
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Private WithEvents DocImp As New PrintDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Private Sub DocImp_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles DocImp.PrintPage
Dim Fuente As Font, Sql As String, Fila As DataRow, Adapter As SqlDataAdapter, NomEle As StringEnd Sub
Dim Formato As New StringFormat, Margen As New Margins(15, 0, 0, 10), Alto As Int16, Cont As Int16
Fuente = New Font("Arial", 10, FontStyle.Bold)
Formato.Alignment = StringAlignment.Center
e.Graphics.PageUnit = GraphicsUnit.Millimeter
e.PageSettings.Margins = Margen
e.Graphics.DrawString("TEXTO", Fuente, Brushes.Black, New System.Drawing.RectangleF(58, 5, 100, 4), Formato)
e.HasMorePages = False
Fuente.Dispose()
Protected Sub cmdImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdImprimir.Click
TryEnd SubDocImp.PrinterSettings.PrinterName = "\\10.0.0.113\hp LaserJet 1000"Catch ex As Exception
DocImp.Print()LblMsg.Text = ex.MessageEnd Try
End Class
No se si ya será cuestión de permisos o que pero pss todas las opciones debo probarlas, gracias de nuevo.