This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-05-12 14:15:04 -07:00
6 changed files with 210 additions and 34 deletions

View File

@@ -5175,7 +5175,7 @@ Public Class ClsPaginas
sw.Start() sw.Start()
Dim Bytes As Byte() = Nothing Dim Bytes As Byte() = Nothing
Dim bdir As String = ModExtensiones.DirectorioBaseEmpresas Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory)
RutaReporte.Replace("/", "\") RutaReporte.Replace("/", "\")
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)

View File

@@ -140,7 +140,7 @@ Namespace Extensiones
Dim MensajeFormato = $"{Chr(13)}{Chr(10)}Log: {Mensaje} | Fecha:{Now.ToString("dd/MM/yyyy HH:mm")}" Dim MensajeFormato = $"{Chr(13)}{Chr(10)}Log: {Mensaje} | Fecha:{Now.ToString("dd/MM/yyyy HH:mm")}"
Try Try
ArchivoW = New StreamWriter($"{ModExtensiones.DirectorioBaseEmpresas}\Log\{Archivo}.txt", True, System.Text.Encoding.UTF8) ArchivoW = New StreamWriter($"{AppDomain.CurrentDomain.BaseDirectory}\Log\{Archivo}.txt", True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException Catch ex As UnauthorizedAccessException
'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError)
Exit Sub Exit Sub
@@ -185,7 +185,7 @@ Namespace Extensiones
Dim strLineaTMP As String Dim strLineaTMP As String
strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto) strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto)
Try Try
ArchivoW = New StreamWriter(String.Format("{0}\LogMail.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8) ArchivoW = New StreamWriter(String.Format("{0}\LogMail.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As Exception Catch ex As Exception
Exit Sub Exit Sub
End Try End Try
@@ -205,7 +205,7 @@ Namespace Extensiones
' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10) ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
strLineaTMP = String.Format("{0}{1} .. PAC: {2} - Modulo: {3} ..{4}:{5}", Chr(13), Chr(10), CvePAC, Modulo, Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString) strLineaTMP = String.Format("{0}{1} .. PAC: {2} - Modulo: {3} ..{4}:{5}", Chr(13), Chr(10), CvePAC, Modulo, Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
Try Try
ArchivoW = New StreamWriter(String.Format("{0}\LogTimbrado.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8) ArchivoW = New StreamWriter(String.Format("{0}\LogTimbrado.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException Catch ex As UnauthorizedAccessException
'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError)
Exit Sub Exit Sub
@@ -228,7 +228,7 @@ Namespace Extensiones
strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto) strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto)
Try Try
ArchivoW = New StreamWriter(String.Format("{0}\LogCancelacionSAT.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8) ArchivoW = New StreamWriter(String.Format("{0}\LogCancelacionSAT.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As Exception Catch ex As Exception
Exit Sub Exit Sub
End Try End Try
@@ -1962,7 +1962,7 @@ Namespace Extensiones
RecursivoLimpiaControlesExcel(GridView.Controls) RecursivoLimpiaControlesExcel(GridView.Controls)
style.Append("<style> ") style.Append("<style> ")
style.Append(File.ReadAllText(String.Format("{0}/Styles/EstilosExcel.css", ModExtensiones.DirectorioBaseEmpresas))) style.Append(File.ReadAllText(String.Format("{0}/Styles/EstilosExcel.css", AppDomain.CurrentDomain.BaseDirectory)))
style.Append(" </style> ") style.Append(" </style> ")
page.EnableEventValidation = False page.EnableEventValidation = False
@@ -2002,7 +2002,7 @@ Namespace Extensiones
Dim Form As HtmlForm = New HtmlForm() Dim Form As HtmlForm = New HtmlForm()
style.Append(" <style> ") style.Append(" <style> ")
style.Append(File.ReadAllText(String.Format("{0}/Styles/EstilosExcel.css", ModExtensiones.DirectorioBaseEmpresas))) style.Append(File.ReadAllText(String.Format("{0}/Styles/EstilosExcel.css", AppDomain.CurrentDomain.BaseDirectory)))
style.Append(" </style> ") style.Append(" </style> ")
RecursivoLimpiaControlesExcel(GridView.Controls) RecursivoLimpiaControlesExcel(GridView.Controls)
@@ -2183,16 +2183,15 @@ Namespace Extensiones
worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión" worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión"
worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy") worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
If Imagen.Exists Then If Imagen.Exists Then
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Usuario.CveEmpresa) Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)
Using webClient As New Net.WebClient() Using sr As New StreamReader(Ruta)
Dim imageBytes = webClient.DownloadData(logouri) Dim ms As New MemoryStream()
Dim stream As New MemoryStream(imageBytes) sr.BaseStream.CopyTo(ms)
worksheet.Pictures.Add(stream, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel) worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel)
'worksheet.Pictures.Add(stream, GemBox.Spreadsheet.ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, GemBox.Document.LengthUnit.Pixel) End Using
End Using
End If End If
End If End If
@@ -2210,7 +2209,7 @@ Namespace Extensiones
Dim style As StringBuilder = New StringBuilder() Dim style As StringBuilder = New StringBuilder()
style.Append("<style> ") style.Append("<style> ")
style.Append(File.ReadAllText(String.Format("{0}/Styles/EstilosExcel.css", ModExtensiones.DirectorioBaseEmpresas))) style.Append(File.ReadAllText(String.Format("{0}/Styles/EstilosExcel.css", AppDomain.CurrentDomain.BaseDirectory)))
style.Append(" </style> ") style.Append(" </style> ")
'To Export all pages 'To Export all pages
'Gv.AllowPaging = False 'Gv.AllowPaging = False
@@ -3182,7 +3181,7 @@ Namespace Extensiones
Public Property descripcion As String Public Property descripcion As String
Public ReadOnly Property Extencion As String Public ReadOnly Property Extencion As String
Get Get
Return IO.Path.GetExtension(String.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, patch, filename)).Replace(".", "") Return IO.Path.GetExtension(String.Format("{0}{1}{2}", If(patch.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), patch, filename)).Replace(".", "")
End Get End Get
End Property End Property
Public ReadOnly Property filenameO As String Public ReadOnly Property filenameO As String
@@ -3192,7 +3191,7 @@ Namespace Extensiones
End Property End Property
Public ReadOnly Property FileUrl As String Public ReadOnly Property FileUrl As String
Get Get
Return String.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, patch, filename) Return String.Format("{0}{1}{2}", If(patch.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), patch, filename)
End Get End Get
End Property End Property
End Class End Class

View File

@@ -930,7 +930,7 @@ Partial Class Bancos_IE
If ObjIE.Comprobante <> "" Then If ObjIE.Comprobante <> "" Then
HplComprobante.Visible = True HplComprobante.Visible = True
HplComprobante.NavigateUrl = String.Format("/Empresas/{0}/IE/{1}", UsuarioActual.CveEmpresa, ObjIE.Comprobante) HplComprobante.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta($"OP=IEComprobante&Comprobante={ObjIE.Comprobante}"))
End If End If
If CveIEDeposito > 0 Then If CveIEDeposito > 0 Then

View File

@@ -186,9 +186,10 @@ Partial Class PopUpVerFactura
If Request("REPORTE") IsNot Nothing Then If Request("REPORTE") IsNot Nothing Then
CType(Session("DTPDF"), HtmlTable).ExportToPDF("Reporte") CType(Session("DTPDF"), HtmlTable).ExportToPDF("Reporte")
End If End If
'OPCIONES 'OPCIONES
If Request("P") IsNot Nothing AndAlso Decripta((Request("P").ToString)) <> "" Then If Request("P") IsNot Nothing AndAlso Decripta((Request("P").ToString)) <> "" Then
Dim UrlParametros As Hashtable = Parametros(Decripta((Request("P").ToString))) Dim UrlParametros As Hashtable = Parametros(Decripta((Request("P").ToString)))
If UrlParametros("OP") IsNot Nothing AndAlso UrlParametros("OP").ToString <> "" Then If UrlParametros("OP") IsNot Nothing AndAlso UrlParametros("OP").ToString <> "" Then
@@ -235,10 +236,16 @@ Partial Class PopUpVerFactura
UsuarioToken.Empresa = ObjEmpresa.Empresa UsuarioToken.Empresa = ObjEmpresa.Empresa
End If End If
ObjEmpresa.Dispose() ObjEmpresa.Dispose()
End Sub End Sub
#End Region #End Region
Private Sub SeleccionaReporte(UrlParametros As Hashtable)
'DESCARGA COMPROBANTE
If UrlParametros("OP").ToString = "IEComprobante" Then
DescargaComprobante(UrlParametros)
End If
Private Sub SeleccionaReporte(UrlParametros As Hashtable)
'DESCARGA DOCUMENTO XML O PDF DE LA FACTURA COMPRA 'DESCARGA DOCUMENTO XML O PDF DE LA FACTURA COMPRA
If UrlParametros("OP").ToString = "Fact" Then If UrlParametros("OP").ToString = "Fact" Then
DescargaFactura(UrlParametros) DescargaFactura(UrlParametros)
@@ -518,11 +525,30 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/RepCortes.rdlc", lrds, params, "ReporteCortes", Formato) ImprimirPDF("Empresas/Grales/Formatos/RepCortes.rdlc", lrds, params, "ReporteCortes", Formato)
End If End If
End Sub End Sub
#End Region #End Region
#Region " OP = FACTURA - IMPRIME COMPRA" #Region " OP = FACTURA - IMPRIME COMPRA"
Private Sub DescargaComprobante(Parametros As Hashtable)
If Parametros("COMPROBANTE") IsNot Nothing Then
Dim Path As String = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, Parametros("COMPROBANTE"))
Dim Archivo As New System.IO.FileInfo(Path)
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "application/octet-stream"
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
'HttpContext.Current.Response.Flush()
HttpContext.Current.Response.End()
End If
Archivo = Nothing
End If
End Sub
Private Sub DescargaFactura(Parametros As Hashtable) Private Sub DescargaFactura(Parametros As Hashtable)
If Parametros("CVEFACTURA") IsNot Nothing AndAlso Parametros("CVEFACTURA").ToString.ToEntero > 0 Then If Parametros("CVEFACTURA") IsNot Nothing AndAlso Parametros("CVEFACTURA").ToString.ToEntero > 0 Then
Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf") Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf")

View File

@@ -2603,17 +2603,50 @@ Partial Class Compras_eFacturas
End Set End Set
End Property End Property
Property DT_ComprasSinIE As DataTable
Get
If ViewState("DT_ComprasSinIE") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("DT_ComprasSinIE"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DT_ComprasSinIE") = value
End Set
End Property
'Property ComplementoComprasSinIE As String
' Get
' If ViewState("ComplementoComprasSinIE") Is Nothing Then
' Return ""
' Else
' Return ViewState("ComplementoComprasSinIE").ToString
' End If
' End Get
' Set(value As String)
' ViewState("ComplementoComprasSinIE") = value
' End Set
'End Property
#Region "V I N C U L A R P A G O" #Region "V I N C U L A R P A G O"
Protected Sub LnkAgregarPago_Click(sender As Object, e As EventArgs) Protected Sub LnkAgregarPago_Click(sender As Object, e As EventArgs)
Dim sbSinIE As New StringBuilder
HdnCveIE.Value = ""
MSGComplemento = "" MSGComplemento = ""
ViculacionConPUE = False ViculacionConPUE = False
ListaComprasPUE.Clear() ListaComprasPUE.Clear()
ComplementoConPUE = "" ComplementoConPUE = ""
DT_ComprasSinIE = New DataTable
Dim ListaComprasPUEInterna As New List(Of Integer) Dim ListaComprasPUEInterna As New List(Of Integer)
@@ -2809,6 +2842,26 @@ Partial Class Compras_eFacturas
End If End If
Next Next
DT_ComprasSinIE.Columns.Add("CveCompra", GetType(Integer))
DT_ComprasSinIE.Columns.Add("CveFactura", GetType(Integer))
DT_ComprasSinIE.Columns.Add("SerieFolioPago")
DT_ComprasSinIE.Columns.Add("SerieFolioCompra")
For Each dRow As DataRow In DTDocumentosRelacionados.Rows
Dim nRow As DataRow = DT_ComprasSinIE.NewRow
nRow("CveCompra") = dRow("CveCompra").ToString.ToEntero
' nRow("CveFactura") = dRow("CveFactura").ToString.ToEntero
nRow("SerieFolioPago") = $"{SeriePago}-{FolioPago}"
nRow("SerieFolioCompra") = dRow("SerieFolioCompra").ToString
DT_ComprasSinIE.Rows.Add(nRow)
Next
Else Else
Alert("Ocurrió un error al cargar los archivos de complementos pago", TipoMensaje.MsgError) Alert("Ocurrió un error al cargar los archivos de complementos pago", TipoMensaje.MsgError)
End If End If
@@ -2876,6 +2929,12 @@ Partial Class Compras_eFacturas
ImporteIES = ObjCompras.DtResultados.FiltraParametros("CveIE > 0").SUM("Importe") ImporteIES = ObjCompras.DtResultados.FiltraParametros("CveIE > 0").SUM("Importe")
DiferenciaImportes = Monto - ImporteIES DiferenciaImportes = Monto - ImporteIES
ObjCompras.Dispose() ObjCompras.Dispose()
@@ -2962,19 +3021,25 @@ Partial Class Compras_eFacturas
If ViculacionConPUE Then If ViculacionConPUE Then
For Each CveCompraVinculada In ListaComprasPUE For Each CveCompraVinculada In ListaComprasPUE
objEventos.AddEventoBitacora($"Complemento { ComplementoConPUE } vinculado manualmente (Compra PUE) ", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompraVinculada) objEventos.AddEventoBitacora($"Complemento { ComplementoConPUE } vinculado manualmente (Compra PUE) ", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompraVinculada)
Next Next
End If
If HdnCveIE.Value.ToEntero > 0 Then
For Each dRow As DataRow In DT_ComprasSinIE.Rows
objEventos.AddEventoBitacora($"Complemento { dRow("SerieFolioPago").ToString } vinculado manualmente a compra {dRow("SerieFolioCompra").ToString}", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=dRow("CveCompra").ToString.ToEntero)
Next
End If End If
ObjCompra.Commit() ObjCompra.Commit()
Alert("El pago fue vinculado correctamente", TipoMensaje.MsgInformacion) Alert("El pago fue vinculado correctamente", TipoMensaje.MsgInformacion)

View File

@@ -246,10 +246,96 @@ Partial Class Inventarios_KardexAlmacen
If DdlProveedor.SelectedValue.ToEntero > 0 Then StrFiltro.AppendFormat("Proveedor: {0},", DdlProveedor.SelectedText) If DdlProveedor.SelectedValue.ToEntero > 0 Then StrFiltro.AppendFormat("Proveedor: {0},", DdlProveedor.SelectedText)
If ddlProducto2.SelectedValue.ToEntero > 0 Then StrFiltro.AppendFormat(" Producto/Servicio: {0},", ddlProducto2.SelectedText) If ddlProducto2.SelectedValue.ToEntero > 0 Then StrFiltro.AppendFormat(" Producto/Servicio: {0},", ddlProducto2.SelectedText)
If TxtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin: {0}", TxtFechaF.Text) If TxtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin: {0}", TxtFechaF.Text)
GvDatos.ExportToExcelG("ExistenciasHorizontal.xlsx", "Existencias Almacen", UsuarioActual, StrFiltro.ToString, 100, 200) ExportToExcelG(GvDatos, "ExistenciasHorizontal.xlsx", "Existencias Almacen", UsuarioActual, StrFiltro.ToString, 100, 200)
Else Else
Alert("Debe consultar para generar un excel", TipoMensaje.MsgAdvertencia) Alert("Debe consultar para generar un excel", TipoMensaje.MsgAdvertencia)
End If End If
End Sub
Public Sub ExportToExcelG(Gv As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing, Optional Filtros As String = "", Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100)
Dim sw As New StringWriter()
Dim htw As New HtmlTextWriter(sw)
Gv.RenderControl(htw)
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense("ESWN-4QFD-26JF-1SZ8")
Dim excel As GemBox.Spreadsheet.ExcelFile
Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
Using htmlStream = New MemoryStream(options.Encoding.GetBytes(sw.ToString()))
excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream, options)
If Usuario IsNot Nothing Then
Dim TotalRowHeader As Integer = 8
Dim TotalRowFooter As Integer = 2
Dim worksheet = excel.Worksheets(0)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
celdasConTexto.Style.Font.Name = "Calibri Light"
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
RangoNombreEmpresa.Style.Font.Size = 18 * 20
RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
RangoFiltros.Merged = True
RangoFiltros.Value = Filtros
RangoFiltros.Style.Font.Size = 15 * 20
RangoFiltros.Style.Font.Name = "Calibri Light"
RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 20 * 20
RangoTitulo.Style.Font.Name = "Calibri Light"
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20
worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
If i > 0 Then
Try
worksheet.Columns(i).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
Dim IndexEndTable As Integer = Gv.Rows.Count + TotalRowHeader + TotalRowFooter
worksheet.Rows(IndexEndTable).Cells(2).Value = "Usuario Imprimió"
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión"
worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
If Imagen.Exists Then
Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)
Using sr As New StreamReader(Ruta)
Dim ms As New MemoryStream()
sr.BaseStream.CopyTo(ms)
worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel)
End Using
End If
End If
End Using
htw.Dispose()
excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx")
End Sub End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub End Sub