Impresion de entradas/salidas en stimulsoft

This commit is contained in:
2022-10-18 22:57:02 -07:00
parent dcfd309769
commit c3f6d1aea2
4 changed files with 131 additions and 71 deletions

View File

@@ -5910,6 +5910,16 @@ Public Class ClsPaginas
lrds.Add(rds) lrds.Add(rds)
ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR, Content_Disposition) ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR, Content_Disposition)
End Sub End Sub
Public Sub ImprimirPDFStimulsoft(RutaReporte As String, DtDatos As DataTable, Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "Datos", Optional Content_Disposition As String = "attachment")
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource
rds.Name = RDSName
rds.Value = DtDatos
lrds.Add(rds)
ImprimirbytesPDF(StreamBytesStimulsoft("Facturas", RutaReporte, lrds, Parametros, NombreArchivo:=NombreArchivo, Formato:="PDF"), NombreArchivo, Formato, Content_Disposition:=Content_Disposition)
End Sub
Public Sub ImprimirPDFMultiDS(RutaReporte As String, lrds As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing) Public Sub ImprimirPDFMultiDS(RutaReporte As String, lrds As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing)
ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR) ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR)
End Sub End Sub
@@ -8081,7 +8091,7 @@ Public Class ClsPaginas
Return retorno Return retorno
End Function End Function
Protected Function StreamBytesStimulsoft(Opcion As String, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF") As Byte() Protected Function StreamBytesStimulsoft(Opcion As String, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional NombreDataSource As String = "Datos") As Byte()
'limpio ReportViwer 'limpio ReportViwer
Dim sw As New System.Diagnostics.Stopwatch() Dim sw As New System.Diagnostics.Stopwatch()
sw.Start() sw.Start()
@@ -8150,6 +8160,7 @@ Public Class ClsPaginas
Dim payload As New JObject( Dim payload As New JObject(
New JProperty("formato", Formato), New JProperty("formato", Formato),
New JProperty("ruta", RutaReporte), New JProperty("ruta", RutaReporte),
New JProperty("nombreDataSource", NombreDataSource),
New JProperty("UsarFormatoCompilado", False), New JProperty("UsarFormatoCompilado", False),
New JProperty("parametros", paramsArray), New JProperty("parametros", paramsArray),
New JProperty("dataSource", dataSourceArray) New JProperty("dataSource", dataSourceArray)

View File

@@ -216,7 +216,7 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaVenta() Private Sub CargaVenta()
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetMesas Then Application("GlobalDTMesas") = ObjVentas.DtResultados Else Application("GlobalDTMesas") = Nothing 'If ObjVentas.GetMesas Then Application("GlobalDTMesas") = ObjVentas.DtResultados Else Application("GlobalDTMesas") = Nothing
If ObjVentas.GetPrecioListas Then Application("GlobalDTPrecioListas") = ObjVentas.DtResultados Else Application("GlobalDTPrecioListas") = Nothing If ObjVentas.GetPrecioListas Then Application("GlobalDTPrecioListas") = ObjVentas.DtResultados Else Application("GlobalDTPrecioListas") = Nothing
If ObjVentas.GetCondicionesEntrega(-1) Then Application("GlobalDTVtaCondicionesEntrega") = ObjVentas.DtResultados Else Application("GlobalDTVtaCondicionesEntrega") = Nothing If ObjVentas.GetCondicionesEntrega(-1) Then Application("GlobalDTVtaCondicionesEntrega") = ObjVentas.DtResultados Else Application("GlobalDTVtaCondicionesEntrega") = Nothing

View File

@@ -5,7 +5,7 @@
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Listado de reportes de Stimulsoft Listado de formatos de impresión
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
@@ -21,7 +21,7 @@
<div class="portlet light smmallpadding traspasorow bordered"> <div class="portlet light smmallpadding traspasorow bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<span class="caption-subject bold uppercase" style="line-height: 1;">Listado de formatos</span> <span class="caption-subject bold uppercase" style="line-height: 1;">Listado de formatos de la empresa</span>
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
@@ -51,6 +51,40 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4" id="DivGenerales" runat="server" visible="false">
<div class="portlet light smmallpadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<span class="caption-subject bold uppercase" style="line-height: 1;">Listado de formatos generales</span>
</div>
<div class="actions">
<div class="btn-group">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<asp:GridView ID="GvGenerales" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron formatos" DataKeyNames="RutaReporte"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="100%">
<Columns>
<asp:BoundField HeaderText="Formato" DataField="Reporte" ItemStyle-Width="80%" />
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton runat="server" ID="BtnEditar" OnClick="BtnEditar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea editar el formato?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
</div>
</div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -21,12 +21,27 @@ public partial class Sistemas_ListadoReportes : ClsPaginas
{ {
string RutaReportes = string.Format("{0}/Formatos", UsuarioActual.Empresa.Ruta); string RutaReportes = string.Format("{0}/Formatos", UsuarioActual.Empresa.Ruta);
string[] allfiles = Directory.GetFiles(RutaReportes, "*.mrt", SearchOption.AllDirectories); string[] allfiles = Directory.GetFiles(RutaReportes, "*.mrt", SearchOption.TopDirectoryOnly);
GvDatos.DataSource = (from Reporte in allfiles GvDatos.DataSource = (from Reporte in allfiles
let file = new FileInfo(Reporte) let file = new FileInfo(Reporte)
select new { RutaReporte = file.FullName, Reporte = file.Name.Replace(".mrt","") }).QueryToDataTable(true); select new { RutaReporte = file.FullName, Reporte = file.Name.Replace(".mrt","") }).QueryToDataTable(true);
GvDatos.DataBind(); GvDatos.DataBind();
//EN LA EMPRESA DE JULIAN SE PUEDEN EDITAR LOS GENERALES
if (UsuarioActual.CveEmpresa == 2 )
{
DivGenerales.Visible = true;
string RutaGenerales = string.Format("{0}/Grales/Formatos", Extensiones.ModExtensiones.DirectorioEmpresas);
string[] allFormatosGenerales = Directory.GetFiles(RutaGenerales, "*.mrt", SearchOption.TopDirectoryOnly);
GvGenerales.DataSource = (from Reporte in allFormatosGenerales
let file = new FileInfo(Reporte)
select new { RutaReporte = file.FullName, Reporte = file.Name.Replace(".mrt", "") }).QueryToDataTable(true);
GvGenerales.DataBind();
}
UPDatos.Update(); UPDatos.Update();
} }
@@ -34,8 +49,8 @@ public partial class Sistemas_ListadoReportes : ClsPaginas
{ {
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
var RutaReporteEncriptada = Encripta(GvRow.DataKey("RutaReporte")); var RutaReporteEncriptada = Encripta(GvRow.DataKey("RutaReporte"));
var hostURL = "https://localhost:7162"; var hostURL = "http://localhost:2202";
if (UsuarioActual.Empresa.FacturaProduccion) if (EsProduccion)
{ {
hostURL = "http://sig.adssistemas.mx:6599"; hostURL = "http://sig.adssistemas.mx:6599";
} }