Пример #1
0
 public void ExportChordFileConstructorTest()
 {
     ExportChordFile target = new ExportChordFile();
     target.ExportFilePath = @"C:\Users\wangji\Desktop\手簿 Data for Test\chord_result.xls";
     target.TemplateFilePath = @"C:\Users\wangji\Desktop\手簿 Data for Test\Chord_Template.xls";
     string path = @"C:\Users\wangji\Desktop\手簿 Data for Test\收敛手簿 2013-10-10.txt";
     ChordSheet sheet =new ChordSheet();
     ChordSheet.PrjName = "test for chord sheet report";
     sheet.Lines.Add(new ReadChordFile().ReadTxt(path));
     sheet.Lines.Add(new ReadChordFile().ReadTxt(path));
     target.Export(sheet);
 }
Пример #2
0
        public static string ReadChord(string[] files, string prjName, int RecNo)
        {
            ReadChordFile read = new ReadChordFile();
            ChordSheet sheet = new ChordSheet();
            ChordSheet.PrjName = prjName;
            ChordSheet.RecordNo = RecNo;
            sheet.Lines = read.ReadTxtList(files);

            string exportname = string.Format("{0}工程全站仪收敛观测记录{1}次", prjName, RecNo);
            string templateUrl = HttpContext.Current.Request.ApplicationPath + "/Template/Chord_Template.xls";
            string exportUrl = HttpContext.Current.Request.ApplicationPath + "/Export/" + exportname + ".xls";
            string templetepath = HttpContext.Current.Server.MapPath(templateUrl);
            string exportpath = HttpContext.Current.Server.MapPath(exportUrl);

            ExportChordFile ex = new ExportChordFile();
            ex.TemplateFilePath = templetepath;
            ex.ExportFilePath = exportpath;
            ex.Export(sheet);
            return exportname + ".xls";
        }