コード例 #1
0
        static void GeraPDFAll()
        {
            ClassWebBI.Dados.ClassExcel clExcel = new ClassWebBI.Dados.ClassExcel();

            DataTable tblAnexos = new DataTable();

            SqlCommand sCommand = new SqlCommand("SELECT COD_TITULO, ATIVO FROM EXCEL_TITULOS WHERE ATIVO = 1 ORDER BY COD_TITULO");

            tblAnexos = new ClassWebBI.ClassFuncoes().ExecReader(sCommand);

            for (int i = 0; i <= tblAnexos.Rows.Count - 1; i++)
            {
                clExcel.gerarPDF(Convert.ToInt32(tblAnexos.Rows[i]["COD_TITULO"].ToString()), true);
            }
        }
コード例 #2
0
        private void btnGerar_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 0)
            {
                MessageBox.Show("Selecione um registro !", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            ClassWebBI.Dados.ClassExcel clExcel = new ClassWebBI.Dados.ClassExcel();

            string sArquivo = clExcel.gerarPDF(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["COD_TITULO"].Value.ToString()), false);

            if (File.Exists(sArquivo))
            {
                new ClassWebBI.ClassFuncoes().ExecProcess(sArquivo, false);
            }
        }
コード例 #3
0
        private void btnArmazenar_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 0)
            {
                MessageBox.Show("Selecione um registro !", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (MessageBox.Show("Deseja realmente gerar e armazenar o PDF do registro selecionado ?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
            {
                return;
            }

            ClassWebBI.Dados.ClassExcel clExcel = new ClassWebBI.Dados.ClassExcel();

            string sArquivo = clExcel.gerarPDF(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["COD_TITULO"].Value.ToString()), true);

            GeraTemp();

            MessageBox.Show("Geração e Armazenagem concluídas !", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }