Ejemplo n.º 1
0
    protected void SetandoRel()
    {
        //Report da stimulsoft

        Stimulsoft.Report.StiReport Report = new Stimulsoft.Report.StiReport();

        //Stimulsoft.Report.Web.StiWebDesigner st1 = new Stimulsoft.Report.Web.StiWebDesigner();

        if (Convert.ToString(Request.QueryString["Rel"]) == "frmZuxa")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/EspelhoPonto.mrt"));
            Report.Compile();
            Report["DiasMes"]        = TotalDiasMes.ToString();
            Report["DiasCumpridos"]  = TotalDiasCumprido.ToString();
            Report["TotalHorasMes"]  = TotalHoraMes.ToString();
            Report["HorasCumpridas"] = HorasCumpridas.ToString();
        }

        Report.RegData("DatasetPontoFrequencia", ds);

        Report.Render();

        System.IO.MemoryStream memStream = new System.IO.MemoryStream();

        HttpContext.Current.Response.ClearContent();
        HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.ContentType = "application/pdf";

        HttpContext.Current.Response.AddHeader("Pontoweb.pdf", "");

        Stimulsoft.Report.Export.StiPdfExportService Export = new Stimulsoft.Report.Export.StiPdfExportService();

        Export.ExportPdf(Report, memStream, Stimulsoft.Report.StiPagesRange.All, 100, 100, false, false, true, true,
                         "", "", Stimulsoft.Report.Export.StiUserAccessPrivileges.All, Stimulsoft.Report.Export.StiPdfEncryptionKeyLength.Bit40, false);

        Response.ContentType = "application/pdf";

        Response.AddHeader("content-disposition", "inline; filename=Pontoweb.pdf");

        Response.BinaryWrite(memStream.ToArray());
    }
Ejemplo n.º 2
0
    protected void SetandoRel()
    {
        //Report da stimulsoft

        Stimulsoft.Report.StiReport Report = new Stimulsoft.Report.StiReport();

        //Stimulsoft.Report.Web.StiWebDesigner st1 = new Stimulsoft.Report.Web.StiWebDesigner();

        if (Convert.ToString(Request.QueryString["Rel"]) == "frmZurel")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/folhafrequencia.mrt"));
            Report.Compile();
            Report["DiasMes"]         = TotalDiasMes.ToString();
            Report["DiasCumpridos"]   = TotalDiasCumprido.ToString();
            Report["TotalHorasMes"]   = TotalHoraMes.ToString();
            Report["HorasCumpridas"]  = HorasCumpridas;
            Report["HorasRealizadas"] = HorasRealizadas;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmZuxa")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/EspelhoPonto.mrt"));
            Report.Compile();
            Report["DiasMes"]        = TotalDiasMes.ToString();
            Report["DiasCumpridos"]  = TotalDiasCumprido.ToString();
            Report["TotalHorasMes"]  = TotalHoraMes.ToString();
            Report["HorasCumpridas"] = HorasCumpridas.ToString();
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmsitu")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/situacaousuario.mrt"));
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmbco")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/totalhorasdiarias.mrt"));
            Report.Compile();
            //Report["Teste"] = 932;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmbcoHoraMes")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/bancoHoraMes.mrt"));
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmRelacDia")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/relacaopontoDia.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmLocalRegistro")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/LocalRegistro.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmMotivoFalta")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/RelacaoMotivoFalta.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmfca")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/FichaCadastral.mrt"));
            Report.Compile();
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmfi")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/FichaCadastral.mrt"));
            Report.Compile();
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmdesc")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/RelRelacaoRegistroPeriodo.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmfaltaInjust")
        {
            if (RelUtilizado == 0)
            {
                Report.Load(Server.MapPath(@"~/Relatorio/STF/RelDataInjustificada.mrt"));
            }
            else
            {
                Report.Load(Server.MapPath(@"~/Relatorio/STF/RelRegistroAusente.mrt"));
            }
            //o Outro Aqui
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmAuditRel")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/RelatorioAuditoriaJustificativa.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmLogMaqRel")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/AuditoriaGeralDasConexoes.mrt"));
            Report.Compile();
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmInfoMaqRel")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/InformacoesMaquinasColetorLocal.mrt"));
            Report.Compile();
        }

        Report.RegData("DatasetPontoFrequencia", ds);

        Report.Render();

        System.IO.MemoryStream memStream = new System.IO.MemoryStream();

        HttpContext.Current.Response.ClearContent();
        HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.ContentType = "application/pdf";

        HttpContext.Current.Response.AddHeader("Pontoweb.pdf", "");

        Stimulsoft.Report.Export.StiPdfExportService Export = new Stimulsoft.Report.Export.StiPdfExportService();

        Export.ExportPdf(Report, memStream, Stimulsoft.Report.StiPagesRange.All, 100, 100, false, false, true, true,
                         "", "", Stimulsoft.Report.Export.StiUserAccessPrivileges.All, Stimulsoft.Report.Export.StiPdfEncryptionKeyLength.Bit40, false);

        Response.ContentType = "application/pdf";

        Response.AddHeader("content-disposition", "inline; filename=Pontoweb.pdf");

        Response.BinaryWrite(memStream.ToArray());
    }