Пример #1
0
    public static void imprimirEtiqueta(int _cod_ficha_be, string _nome_impressora, int qtdEtiquetas)
    {
        impressora_etiqueta = _nome_impressora;

        // Imprimir o BE
        if (_cod_ficha_be > 0)
        {
            using (var etiqueta = new Microsoft.Reporting.WebForms.LocalReport())
            {
                etiqueta.ReportPath = "Etiqueta/etiqueta.rdlc";
                FichaDAO     sr = new FichaDAO();
                List <Ficha> sc = new List <Ficha>();
                //Ficha sc = new Ficha();
                sc = sr.GetFicha(_cod_ficha_be);

                IEnumerable <Ficha> ie;
                ie = sc.AsQueryable();


                ReportDataSource datasource = new ReportDataSource("Ficha", ie);
                etiqueta.DataSources.Add(datasource);

                ExportarEtiq(etiqueta);
                for (int x = 0; x < qtdEtiquetas; x++)
                {
                    ImprimirEtiq(etiqueta);
                }
            }
        }
    }
Пример #2
0
    public static void imprimirFicha(int _cod_ficha_be, string _nome_impressora)
    {
        nome_impressora = _nome_impressora;
        // Imprimir o BE
        if (_cod_ficha_be > 0)
        {
            using (var relatorio = new Microsoft.Reporting.WebForms.LocalReport())
            {
                relatorio.ReportPath = "Relatorios/Ficha.rdlc";
                FichaDAO     sr = new FichaDAO();
                List <Ficha> sc = new List <Ficha>();
                //Ficha sc = new Ficha();
                sc = sr.GetFicha(_cod_ficha_be);

                IEnumerable <Ficha> ie;
                ie = sc.AsQueryable();


                ReportDataSource datasource = new ReportDataSource("Ficha", ie);
                relatorio.DataSources.Add(datasource);

                Exportar(relatorio);
                Imprimir(relatorio);
            }
        }
    }
Пример #3
0
    // Ficha sc = new Ficha();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ReportViewer1.ProcessingMode         = ProcessingMode.Local;
            ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Relatorios/Ficha.rdlc");

            sc = sr.GetFicha(1); // ficha teste nº 1
            IEnumerable <Ficha> ie;
            ie = sc.AsQueryable();
            ReportDataSource datasource = new ReportDataSource("Ficha", ie);

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(datasource);
        }
    }
Пример #4
0
    protected void Button1_Click1(object sender, EventArgs e)
    {
        //using (var ds = CriarDataSet())
        using (var relatorio = new Microsoft.Reporting.WebForms.LocalReport())
        {
            relatorio.ReportPath = "Relatorios/Ficha.rdlc";
            //relatorio.ReportPath = "Relatorios/Report.rdlc";
            //relatorio.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("hspmPsDataSet", (DataTable)ds.Item));

            FichaDAO     sr = new FichaDAO();
            List <Ficha> sc = new List <Ficha>();
            //Ficha sc = new Ficha();

            sc = sr.GetFicha(1);// ficha teste nº 1

            IEnumerable <Ficha> ie;
            ie = sc.AsQueryable();
            ReportDataSource datasource = new ReportDataSource("Ficha", ie);
            relatorio.DataSources.Add(datasource);

            Exportar(relatorio);
            Imprimir(relatorio);
        }
    }
Пример #5
0
    protected void btnGravar_Click(object sender, EventArgs e)
    {
        string mensagem = "";
        int    _pront   = 0;

        if (txbProntuario.Text != "")
        {
            _pront = Convert.ToInt32(txbProntuario.Text);
        }

        Ficha be = new Ficha();

        be.prontuario    = _pront;
        be.documento     = txbDocumento.Text;
        be.tipo_paciente = rbTipoPaciente.SelectedValue;
        be.nome_paciente = txbNomePaciente.Text;

        if (txbNascimento.Text == "")
        {
            DateTime seData = new DateTime(1800, 1, 1);
            be.dt_nascimento = seData;
        }
        else
        {
            be.dt_nascimento = Convert.ToDateTime(txbNascimento.Text);
        }

        be.idade        = txbIdade.Text;
        be.sexo         = ddlSexo.SelectedValue;
        be.raca         = ddlRaca.SelectedValue;
        be.endereco_rua = txbEndereco.Text;
        be.numero_casa  = txbNumero.Text;
        be.complemento  = txbComplemento.Text;
        be.bairro       = txbBairro.Text;
        be.municipio    = txbMunicipio.Text;
        be.uf           = txbUF.Text;
        be.cep          = txbCEP.Text;
        be.nome_pai_mae = txbPais.Text;
        be.responsavel  = txbResponsavel.Text;
        be.telefone     = txbTelefone.Text;
        be.procedencia  = txbProcedencia.Text;
        be.queixa       = txbQueixa.Text;

        be.setor   = ddlSetor.SelectedValue;
        be.usuario = System.Web.HttpContext.Current.User.Identity.Name;

        int _cod_ficha_be = FichaDAO.GravaFicha(be.dt_rh_be
                                                , be.prontuario
                                                , be.documento
                                                , be.tipo_paciente
                                                , be.nome_paciente
                                                , be.dt_nascimento
                                                , be.idade
                                                , be.sexo
                                                , be.raca
                                                , be.endereco_rua
                                                , be.numero_casa
                                                , be.complemento
                                                , be.bairro
                                                , be.municipio
                                                , be.uf
                                                , be.cep
                                                , be.nome_pai_mae
                                                , be.responsavel
                                                , be.telefone
                                                , be.procedencia
                                                , be.queixa
                                                , be.setor
                                                , be.usuario
                                                );

        mensagem = "Ficha: " + Convert.ToString(_cod_ficha_be);

        ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + mensagem + "');", true);

        ClearInputs(Page.Controls);// limpa os textbox

        // Imprimir o BE
        if (_cod_ficha_be > 0)
        {
            using (var relatorio = new Microsoft.Reporting.WebForms.LocalReport())
            {
                relatorio.ReportPath = "Relatorios/Ficha.rdlc";
                FichaDAO     sr = new FichaDAO();
                List <Ficha> sc = new List <Ficha>();
                //Ficha sc = new Ficha();
                sc = sr.GetFicha(_cod_ficha_be);

                IEnumerable <Ficha> ie;
                ie = sc.AsQueryable();


                ReportDataSource datasource = new ReportDataSource("Ficha", ie);
                relatorio.DataSources.Add(datasource);

                Exportar(relatorio);
                Imprimir(relatorio);
            }
        }
    }