2026-01-30 03
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
|
||||
Imports System.ComponentModel
|
||||
Imports System.Drawing.Printing
|
||||
Imports System.IO
|
||||
Imports bdGrupoSanchoToro
|
||||
Imports bdGrupoSanchoToro.db
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports DevExpress.Xpf.Docking
|
||||
Imports DevExpress.Xpf.Printing
|
||||
Imports DevExpress.XtraPrinting
|
||||
Imports DevExpress.XtraReports.UI
|
||||
Imports tsEFCore8.Extensiones
|
||||
Imports Microsoft.EntityFrameworkCore
|
||||
Imports System.Drawing.Printing
|
||||
Imports System.ComponentModel
|
||||
Imports DevExpress.Xpf.Printing
|
||||
Imports tsEFCore8.Extensiones
|
||||
Public Class Informes
|
||||
Private Shared NumeroCopias As Integer
|
||||
|
||||
@@ -132,5 +133,41 @@ Public Class Informes
|
||||
xr.ExportToPdf(st)
|
||||
Return st.ToArray
|
||||
End Function
|
||||
Friend Shared Sub MuestraImpresos(bd As tscGrupoSanchoToro, idPlantilla As Integer, Datasource As Object, GrupoDocumentos As DocumentGroup, dc As DockController)
|
||||
Try
|
||||
|
||||
If idPlantilla = 0 Then Throw New Exception("Seleccione primero la plantilla a imprimir")
|
||||
Dim xr As New XtraReport
|
||||
|
||||
Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.idPlantilla = idPlantilla).First
|
||||
Dim s As String = System.Text.Encoding.UTF8.GetString(pl.idFicheroNavigation.Fichero)
|
||||
Using sw As New StreamWriter(New MemoryStream())
|
||||
sw.Write(s)
|
||||
sw.Flush()
|
||||
xr = XtraReport.FromStream(sw.BaseStream, True)
|
||||
End Using
|
||||
Try
|
||||
Dim pr As DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").First
|
||||
pr.Value = Now
|
||||
pr.Visible = False
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
xr.DataSource = Datasource
|
||||
|
||||
Dim docpanel As New DevExpress.Xpf.Docking.DocumentPanel
|
||||
docpanel.Caption = pl.Descripcion
|
||||
|
||||
Dim vi As New tsWPFCore.ucVisualizadorInformes()
|
||||
vi.Visualizador.DocumentSource = xr
|
||||
xr.CreateDocument(True)
|
||||
|
||||
docpanel.Content = vi
|
||||
docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
|
||||
GrupoDocumentos.Items.Add(docpanel)
|
||||
dc.Activate(docpanel)
|
||||
Catch ex As Exception
|
||||
DXMessageBox.Show(ex.Message, "Atención", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user