Exemplo n.º 1
0
 private void btnWord_Click(object sender, EventArgs e)
 {
     try
     {
         WordDoc doc = new WordDoc(MainClass.dirTemplates + "\\Form2.dot", true);
         doc.SetFields("", tbKCP_1kurs.Text);
     }
     catch
     {
     }
 }
Exemplo n.º 2
0
        private void btnWord_Click(object sender, EventArgs e)
        {
            try
            {
                //MessageBox.Show("NotRealizedYet");
                WordDoc doc = new WordDoc(MainClass.dirTemplates + "\\FormA.dot", true);

                doc.SetFields("VUZNAME", "");
                doc.SetFields("KCP", tbKC.Text);

                //First part
                doc.SetFields("CNT1", tb1_FullCount.Text);
                doc.SetFields("CNT1_B", tb1_Budzh.Text);
                doc.SetFields("CNT1_P", tb1_Platn.Text);
                doc.SetFields("CNT1_SPB_B", tb1_SpbBudzh.Text);
                doc.SetFields("CNT1_SPB_P", tb1_SpbPlatn.Text);
                doc.SetFields("CNT1_MALE_B", tb1_MaleBudzh.Text);
                doc.SetFields("CNT1_MALE_P", tb1_MalePlatn.Text);
                doc.SetFields("CNT1_SCHOOL_B", tb1_SchoolBudzh.Text);
                doc.SetFields("CNT1_SCHOOL_P", tb1_SchoolPlatn.Text);
                doc.SetFields("CNT1_PROF_B", tb1_ProfBudzh.Text);
                doc.SetFields("CNT1_PROF_P", tb1_ProfPlatn.Text);
                doc.SetFields("CNT1_NPO_B", tb1_NPOBudzh.Text);
                doc.SetFields("CNT1_NPO_P", tb1_NPOPlatn.Text);
                doc.SetFields("CNT1_OLYMP_B", tb1_OlympBudzh.Text);
                doc.SetFields("CNT1_OLYMP_P", tb1_OlympPlatn.Text);
                doc.SetFields("CNT1_VK_B", tb1_VKBudzh.Text);
                doc.SetFields("CNT1_VK_P", tb1_VKPlatn.Text);
                doc.SetFields("CNT1_FOREIGN_B", tb1_ForeignBudzh.Text);
                doc.SetFields("CNT1_FOREIGN_P", tb1_ForeignPlatn.Text);
                doc.SetFields("CNT1_USSR_B", tb1_USSRBudzh.Text);
                doc.SetFields("CNT1_USSR_P", tb1_USSRPlatn.Text);
                doc.SetFields("CNT1_MAX_CONCURS", tb1_MaxConcurs.Text);

                //Second part
                doc.SetFields("CNT2", tb2_FullCount.Text);
                doc.SetFields("CNT2_B", tb2_Budzh.Text);
                doc.SetFields("CNT2_P", tb2_Platn.Text);
                doc.SetFields("CNT2_SPB_B", tb2_SpbBudzh.Text);
                doc.SetFields("CNT2_SPB_P", tb2_SpbPlatn.Text);
                doc.SetFields("CNT2_MALE_B", tb2_MaleBudzh.Text);
                doc.SetFields("CNT2_MALE_P", tb2_MalePlatn.Text);
                doc.SetFields("CNT2_SCHOOL_B", tb2_SchoolBudzh.Text);
                doc.SetFields("CNT2_SCHOOL_P", tb2_SchoolPlatn.Text);
                doc.SetFields("CNT2_PROF_B", tb2_ProfBudzh.Text);
                doc.SetFields("CNT2_PROF_P", tb2_ProfPlatn.Text);
                doc.SetFields("CNT2_NPO_B", tb2_NPOBudzh.Text);
                doc.SetFields("CNT2_NPO_P", tb2_NPOPlatn.Text);
                doc.SetFields("CNT2_OLYMP_B", tb2_OlympBudzh.Text);
                doc.SetFields("CNT2_OLYMP_P", tb2_OlympPlatn.Text);
                doc.SetFields("CNT2_VK_B", tb2_VKBudzh.Text);
                doc.SetFields("CNT2_VK_P", tb2_VKPlatn.Text);
                doc.SetFields("CNT2_FOREIGN_B", tb2_ForeignBudzh.Text);
                doc.SetFields("CNT2_FOREIGN_P", tb2_ForeignPlatn.Text);
                doc.SetFields("CNT2_USSR_B", tb2_USSRBudzh.Text);
                doc.SetFields("CNT2_USSR_P", tb2_USSRPlatn.Text);
                doc.SetFields("CNT2_MAX_CONCURS", tb2_MaxConcurs.Text);

                //Third part
                doc.SetFields("CNT3", tb3_FullCount.Text);
                doc.SetFields("CNT3_B", tb3_Budzh.Text);
                doc.SetFields("CNT3_P", tb3_Platn.Text);
                doc.SetFields("CNT3_SPB_B", tb3_SpbBudzh.Text);
                doc.SetFields("CNT3_SPB_P", tb3_SpbPlatn.Text);
                doc.SetFields("CNT3_MALE_B", tb3_MaleBudzh.Text);
                doc.SetFields("CNT3_MALE_P", tb3_MalePlatn.Text);
                doc.SetFields("CNT3_SCHOOL_B", tb3_SchoolBudzh.Text);
                doc.SetFields("CNT3_SCHOOL_P", tb3_SchoolPlatn.Text);
                doc.SetFields("CNT3_PROF_B", tb3_ProfBudzh.Text);
                doc.SetFields("CNT3_PROF_P", tb3_ProfPlatn.Text);
                doc.SetFields("CNT3_NPO_B", tb3_NPOBudzh.Text);
                doc.SetFields("CNT3_NPO_P", tb3_NPOPlatn.Text);
                doc.SetFields("CNT3_OLYMP_B", tb3_OlympBudzh.Text);
                doc.SetFields("CNT3_OLYMP_P", tb3_OlympPlatn.Text);
                doc.SetFields("CNT3_VK_B", tb3_VKBudzh.Text);
                doc.SetFields("CNT3_VK_P", tb3_VKPlatn.Text);
                doc.SetFields("CNT3_FOREIGN_B", tb3_ForeignBudzh.Text);
                doc.SetFields("CNT3_FOREIGN_P", tb3_ForeignPlatn.Text);
                doc.SetFields("CNT3_USSR_B", tb3_USSRBudzh.Text);
                doc.SetFields("CNT3_USSR_P", tb3_USSRPlatn.Text);
                doc.SetFields("CNT3_MAX_CONCURS", tb3_MaxConcurs.Text);
            }
            catch (WordException we)
            {
                WinFormsServ.Error(we.Message);
            }
            catch (Exception exc)
            {
                WinFormsServ.Error(exc.Message);
            }
        }