Editar formatos de stimulsoft
This commit is contained in:
@@ -4324,6 +4324,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/OC/OCPendientes.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Sistemas/Registro.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Sistemas/WizardRegistro.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Sistemas/ListadoReportes.aspx".ToUpper(), 702)
|
||||
PaginaDict.Add("/Ventas/VentasRene.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Contratos/Contrato2.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Flotillas/CatMantenimientos.aspx".ToUpper(), -1)
|
||||
@@ -6962,7 +6963,8 @@ Public Class ClsPaginas
|
||||
' GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||
' End Try
|
||||
'End Sub
|
||||
Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing) As Byte()
|
||||
|
||||
Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing, Optional UsarStimulsoft As Boolean = False) As Byte()
|
||||
Dim retorno As Byte() = Nothing
|
||||
|
||||
' Dim ObjVentas As New ClsVentas
|
||||
@@ -7789,46 +7791,52 @@ Public Class ClsPaginas
|
||||
Next
|
||||
End If
|
||||
|
||||
Dim Archivo As New System.IO.FileInfo(RutaFormato)
|
||||
If Archivo.Exists Then
|
||||
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
||||
' retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
||||
'Else
|
||||
' retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
|
||||
'End If
|
||||
retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
||||
If Not UsarStimulsoft Then
|
||||
Dim Archivo As New System.IO.FileInfo(RutaFormato)
|
||||
If Archivo.Exists Then
|
||||
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
||||
' retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
||||
'Else
|
||||
' retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
|
||||
'End If
|
||||
retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
||||
|
||||
Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
|
||||
If Guardar Then
|
||||
If Not ArchivoPDF.Exists Then
|
||||
Try
|
||||
DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
|
||||
DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
|
||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||
End Try
|
||||
Else
|
||||
Try
|
||||
ArchivoPDF.Delete()
|
||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||
End Try
|
||||
Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
|
||||
If Guardar Then
|
||||
If Not ArchivoPDF.Exists Then
|
||||
Try
|
||||
DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
|
||||
DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
|
||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||
End Try
|
||||
Else
|
||||
Try
|
||||
ArchivoPDF.Delete()
|
||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
|
||||
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
||||
' retorno = StreamBytesStimulsoft("Facturas", RutaFormatoDefault, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
||||
'Else
|
||||
' retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
|
||||
'End If
|
||||
retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
||||
End If
|
||||
Else
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
|
||||
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
||||
' retorno = StreamBytesStimulsoft("Facturas", RutaFormatoDefault, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
||||
'Else
|
||||
' retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
|
||||
'End If
|
||||
retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
||||
RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
||||
retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||
End Try
|
||||
@@ -7864,9 +7872,12 @@ Public Class ClsPaginas
|
||||
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
|
||||
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
|
||||
End If
|
||||
|
||||
Dim urlHost As String = "http://localhost:2202/"
|
||||
If EsProduccion Then
|
||||
urlHost = "http://sig.adssistemas.mx:6599/"
|
||||
End If
|
||||
'SITIO DE PRUEBA EN IIS
|
||||
Dim Url = New Uri(String.Format("{0}{1}", "http://localhost:2202/", Opcion))
|
||||
Dim Url = New Uri(String.Format("{0}{1}", urlHost, Opcion))
|
||||
|
||||
Try
|
||||
Dim dataSourceArray As New JArray()
|
||||
@@ -7883,6 +7894,7 @@ Public Class ClsPaginas
|
||||
Dim payload As New JObject(
|
||||
New JProperty("formato", Formato),
|
||||
New JProperty("ruta", RutaReporte),
|
||||
New JProperty("UsarFormatoCompilado", false),
|
||||
New JProperty("parametros", paramsArray),
|
||||
New JProperty("dataSource", dataSourceArray)
|
||||
)
|
||||
|
||||
81
Sistemas/ListadoReportes.aspx
Normal file
81
Sistemas/ListadoReportes.aspx
Normal file
@@ -0,0 +1,81 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ListadoReportes.aspx.cs" Inherits="Sistemas_ListadoReportes" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Listado de reportes de Stimulsoft
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<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</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="GvDatos" 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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
|
||||
function openWindow(url) {
|
||||
var form = document.createElement("form");
|
||||
form.target = "_blank";
|
||||
form.method = "POST";
|
||||
form.action = url;
|
||||
form.style.display = "none";
|
||||
|
||||
//for (var key in data) {
|
||||
// var input = document.createElement("input");
|
||||
// input.type = "hidden";
|
||||
// input.name = key;
|
||||
// input.value = data[key];
|
||||
// form.appendChild(input);
|
||||
//}
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
document.body.removeChild(form);
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
46
Sistemas/ListadoReportes.aspx.cs
Normal file
46
Sistemas/ListadoReportes.aspx.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using static Extensiones.ModExtensiones;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class Sistemas_ListadoReportes : ClsPaginas
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
string RutaReportes = string.Format("{0}/Formatos", UsuarioActual.Empresa.Ruta);
|
||||
|
||||
string[] allfiles = Directory.GetFiles(RutaReportes, "*.mrt", SearchOption.AllDirectories);
|
||||
|
||||
GvDatos.DataSource = (from Reporte in allfiles
|
||||
let file = new FileInfo(Reporte)
|
||||
select new { RutaReporte = file.FullName, Reporte = file.Name.Replace(".mrt","") }).QueryToDataTable(true);
|
||||
GvDatos.DataBind();
|
||||
UPDatos.Update();
|
||||
}
|
||||
|
||||
protected void BtnEditar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
var RutaReporteEncriptada = Encripta(GvRow.DataKey("RutaReporte"));
|
||||
var hostURL = "https://localhost:7162";
|
||||
if (UsuarioActual.Empresa.FacturaProduccion)
|
||||
{
|
||||
hostURL = "http://sig.adssistemas.mx:6599";
|
||||
}
|
||||
var strURL = $"{hostURL}/Designer/EditReport?P={RutaReporteEncriptada}";
|
||||
|
||||
RegistraScript($"openWindow('{strURL}');");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user