Esempio n. 1
0
 public void ExportWithXSLTWindowsTest()
 {
     DataTableExport_Accessor target = new DataTableExport_Accessor(Arch.CFramework.Utility.DataTableExport.AppType.Win);
     DataSet dsExport = DS;
     string[] sHeaders = new string[] { "Name", "Age", "Account", "Birth" };
     string[] sFileds = new string[] { "Name", "Age", "Account", "Birth" };
     DataTableExport.ExportFormat FormatType = Arch.CFramework.Utility.DataTableExport.ExportFormat.Excel;
     string FileName = @"c:\3.xls"; 
     target.ExportWithXSLTWindows(dsExport, sHeaders, sFileds, FormatType, FileName); 
 }
Esempio n. 2
0
 public void ReplaceSpclCharsTest()
 {
     DataTableExport_Accessor target = new DataTableExport_Accessor(Arch.CFramework.Utility.DataTableExport.AppType.Win);
     string fieldName = @"c:/abc/ef/c%/3.xml";
     string expected = "c:_x002F_abc_x002F_ef_x002F_c_x0025__x002F_3.xml";  
     string actual;
     actual = target.ReplaceSpclChars(fieldName);
     Assert.AreEqual(expected, actual); 
 }
Esempio n. 3
0
        public void CreateStylesheetTest()
        { 
            //var array = new Tuple<int, string, string, int>[4];
            //array[0] = new Tuple<int, string, string, int>(1, "David", "Smith", 10000);
            //array[1] = new Tuple<int, string, string, int>(3, "Mark", "Drinkwater", 30000);
            //array[2] = new Tuple<int, string, string, int>(4, "Norah", "Miller", 20000);
            //array[3] = new Tuple<int, string, string, int>(12, "Cecil", "Walker", 120000); 

            DataTableExport_Accessor target = new DataTableExport_Accessor(Arch.CFramework.Utility.DataTableExport.AppType.Win);  
            
            using (StringWriter str = new StringWriter())
            using (XmlTextWriter writer = new XmlTextWriter(str))
            {
                string[] sHeaders = new string[] { "姓名", "年龄", "总计", "生日" };
                string[] sFileds = new string[] { "姓名", "年龄", "总计", "生日" };
                DataTableExport.ExportFormat FormatType = new DataTableExport.ExportFormat();
                target.CreateStylesheet(writer, sHeaders, sFileds, FormatType);
            }
        }