' 14/05/2027 V 5.0.6 Correcciones en ienumerableaexel
This commit is contained in:
24
App.config
24
App.config
@@ -49,34 +49,14 @@
|
|||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
|
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-10.0.0.7" newVersion="10.0.0.7" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
|
|
||||||
</dependentAssembly>
|
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||||
</startup>
|
</startup>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="IronOcr.Spanish" publicKeyToken="5f366048dc436899" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.20747" newVersion="4.0.0.20747" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<package >
|
<package >
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>tsWPF</id>
|
<id>tsWPF</id>
|
||||||
<version>5.0.5.0</version>
|
<version>5.0.6.0</version>
|
||||||
<authors>Tecnosis</authors>
|
<authors>Tecnosis</authors>
|
||||||
<owners>Tecnosis</owners>
|
<owners>Tecnosis</owners>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
|||||||
@@ -55,11 +55,12 @@ Imports System.Windows
|
|||||||
' mediante el asterisco ('*'), como se muestra a continuación:
|
' mediante el asterisco ('*'), como se muestra a continuación:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("5.0.5.0")>
|
<Assembly: AssemblyVersion("5.0.6.0")>
|
||||||
<Assembly: AssemblyFileVersion("5.0.5.0")>
|
<Assembly: AssemblyFileVersion("5.0.6.0")>
|
||||||
|
|
||||||
|
|
||||||
' Cambios en la versión 5.0.5.0
|
' Cambios en la versión 5.0.6.0
|
||||||
|
|
||||||
|
' 14/05/2027 V 5.0.6 Correcciones en ienumerableaexel
|
||||||
' 14/05/2026 V 5.0.5 Correcciones de dependencias
|
' 14/05/2026 V 5.0.5 Correcciones de dependencias
|
||||||
|
|
||||||
|
|||||||
@@ -273,36 +273,60 @@ Namespace Utilidades
|
|||||||
Public Shared Sub IEnumerableAExcel(Of t)(Datos As IEnumerable(Of t), Fichero As String)
|
Public Shared Sub IEnumerableAExcel(Of t)(Datos As IEnumerable(Of t), Fichero As String)
|
||||||
Dim wb As New ClosedXML.Excel.XLWorkbook
|
Dim wb As New ClosedXML.Excel.XLWorkbook
|
||||||
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(Datos)
|
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(Datos)
|
||||||
wb.AddWorksheet(dt)
|
Dim ws = wb.AddWorksheet(dt)
|
||||||
|
ws.Columns().AdjustToContents()
|
||||||
wb.SaveAs(Fichero)
|
wb.SaveAs(Fichero)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Shared Sub IEnumerableAExcel(Of t)(Datos As List(Of t), Fichero As String)
|
Public Shared Sub IEnumerableAExcel(Of t)(Datos As List(Of t), Fichero As String)
|
||||||
Dim wb As New ClosedXML.Excel.XLWorkbook
|
Dim wb As New ClosedXML.Excel.XLWorkbook
|
||||||
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(Datos)
|
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(Datos)
|
||||||
wb.AddWorksheet(dt)
|
Dim ws = wb.AddWorksheet(dt)
|
||||||
|
ws.Columns().AdjustToContents()
|
||||||
wb.SaveAs(Fichero)
|
wb.SaveAs(Fichero)
|
||||||
End Sub
|
End Sub
|
||||||
Public Shared Function IEnumerableAExcel(Of t)(Datos As List(Of t)) As Byte()
|
Public Shared Function IEnumerableAExcel(Of t)(Datos As List(Of t)) As Byte()
|
||||||
Dim wb As New ClosedXML.Excel.XLWorkbook
|
Dim wb As New ClosedXML.Excel.XLWorkbook
|
||||||
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(Datos)
|
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(Datos)
|
||||||
wb.AddWorksheet(dt)
|
Dim ws = wb.AddWorksheet(dt)
|
||||||
|
ws.Columns().AdjustToContents()
|
||||||
Dim ms As New MemoryStream
|
Dim ms As New MemoryStream
|
||||||
wb.SaveAs(ms)
|
wb.SaveAs(ms)
|
||||||
ms.Position = 0
|
ms.Position = 0
|
||||||
Return ms.ToArray
|
Return ms.ToArray
|
||||||
End Function
|
End Function
|
||||||
Public Shared Function ListaIEnumerableAExcel(Of t)(Datos As List(Of List(Of t)), NombreTablas As List(Of String)) As Byte()
|
Public Shared Function ListaIEnumerableAExcel(Of T)(Datos As List(Of List(Of T)), NombreTablas As List(Of String)) As Byte()
|
||||||
|
If Datos Is Nothing OrElse NombreTablas Is Nothing Then
|
||||||
|
Throw New ArgumentNullException("Los parámetros no pueden ser Nothing.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Datos.Count <> NombreTablas.Count Then
|
||||||
|
Throw New ArgumentException("La cantidad de listas y nombres de tablas no coincide.")
|
||||||
|
End If
|
||||||
|
|
||||||
Dim wb As New ClosedXML.Excel.XLWorkbook
|
Dim wb As New ClosedXML.Excel.XLWorkbook
|
||||||
|
|
||||||
For i = 0 To Datos.Count - 1
|
For i = 0 To Datos.Count - 1
|
||||||
Dim tabla = Datos(i)
|
Dim tabla = Datos(i)
|
||||||
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(tabla)
|
|
||||||
wb.AddWorksheet(dt, NombreTablas(i))
|
' Evitar error si la lista está vacía
|
||||||
|
If tabla Is Nothing OrElse tabla.Count = 0 Then
|
||||||
|
Dim wsVacio = wb.AddWorksheet(NombreTablas(i))
|
||||||
|
Continue For
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of T)(tabla)
|
||||||
|
Dim ws = wb.AddWorksheet(dt, NombreTablas(i))
|
||||||
|
|
||||||
|
' Autoajuste de columnas
|
||||||
|
ws.Columns().AdjustToContents()
|
||||||
Next
|
Next
|
||||||
Dim ms As New MemoryStream
|
|
||||||
wb.SaveAs(ms)
|
Using ms As New MemoryStream
|
||||||
ms.Position = 0
|
wb.SaveAs(ms)
|
||||||
Return ms.ToArray
|
Return ms.ToArray()
|
||||||
|
End Using
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -576,7 +576,7 @@
|
|||||||
<Version>10.0.5</Version>
|
<Version>10.0.5</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="tsl5">
|
<PackageReference Include="tsl5">
|
||||||
<Version>3.0.3</Version>
|
<Version>3.0.4</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="TSpdf.commons">
|
<PackageReference Include="TSpdf.commons">
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
|
|||||||
Reference in New Issue
Block a user