Imprimir Sin Vista Previa Crystal Reports
Imports System Imports Program.IO Imports System.Data Imports System.Text message Imports Program.Drawing Imports System.Drawing.Imaging Imports System.Drawing.Printing Imports Program.Collections.Universal Imports System.Windows.Forms Imports Microsoft.Reporting.WinForms General public Class Demo Implements IDisposable Private mcurrentPageIndex As Integer Private mstreams As IList(Of Stream) Private Functionality LoadSalesData As DataTable ' Produce a new DataSet and go through sales information document ' data.xml into the 1st DataTable. Dim dataSét As New DataSét dataSet.ReadXml( '. Data.xml') Return dataSet.Dining tables(0) End Function ' Routine to provide to the review renderer, in order to ' save an picture for each page of the statement.
Mar 11, 2016 Buen dia, estoy tratando de imprimir un informe con Crystal Report sin necesidad de una vista previa, he logrado que no me lo. Tengo un proyecto en c sharp2008,y lo que desea es imprimir sin necesidad de pasar por la vista previa del crystal report. Tengo un grid que cuando seleccione una fila y le doy imprimir, me trae ciertos datos de ls BD (sql 2008), y quisiera mandarlos a imprimir.
Private Function CreateStream( ByVal title As Line, ByVal fileNameExtension As Chain, ByVal encoding As Encoding, ByVal mimeType As Chain, ByVal wiIlSeek As BooIean) As Flow Dim stream As Flow = New MemoryStream mstreams.Combine(stream) Return stream End Function ' Move the given document as an EMF (Improved Metafile) file. Singer handy stitch manual download. Private Bass speaker Export( ByVal survey As LocaIReport) Dim devicelnfo As Thread = ' 'EMF' '8.5in' '11in' '0.25in' '0.25in' '0.25in' '0.25id' ' Dim warnings As Caution mstreams = New List(Of Stream) statement.Make( 'Image', deviceInfo, AddressOf CreateStream, alerts) For Each flow As Stream In mstreams flow.Placement = 0 Next End Subwoofer ' Handler for PrintPageEvents Private Sub PrintPage( ByVal sender As Item, ByVal év As PrintPagéEventArgs) Dim pagelmage As New MetafiIe(mstreams(mcurrentPageIndex)) ' Adapt rectangular region with printer margins. Dim adjustédRect As New RectangIe(ev.PageBounds.Left - CInt(ev.PageSettings.HardMarginX)ev.PageBounds.Top - CInt(ev.PagéSettings.HardMarginY)ev.PagéBounds.Widthev.PageBounds.Elevation) ' Draw a white background for the document ev.Images.FillRectangle(Brushes.Light, adjustedRect) ' Draw the statement content ev.Images.DrawImage(pageImage, adjustédRect) ' Prepare for thé following page. Create certain we haven't strike the end. McurrentPageIndex += 1 ev.HasMorePages = (mcurrentPageIndex.