Beispiel #1
0
 void Load()
 {
     fast_zip = new FastZip();
     xml_shared_strings = new XmlFun();
     xml_sheets = new List<XmlFun>();
     xml_workbook = new XmlFun();
     xml_wb_rels = new XmlFun();
     shared_strings = new Dictionary<int, string>();
     Worksheets = new List<Worksheet>();
 }
Beispiel #2
0
 private void SaveSharedStrings()
 {
     string inner_xml_header = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"+
         "<sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"100000\" uniqueCount=\"99000\">";
     string inner_xml_footer = "</sst>";
     string strgs = String.Empty;
     foreach ( KeyValuePair<int,string> sh_str in shared_strings ) {
         strgs += "<si><t>"+sh_str.Value+"</t></si>";
     }
     if ( xml_shared_strings == null )
         xml_shared_strings = new AmusingXml.XmlFun();
     xml_shared_strings.Document.InnerXml = inner_xml_header + strgs + inner_xml_footer;
     xml_shared_strings.SaveDocument(temp_path+"\\xl\\sharedStrings.xml");
 }
Beispiel #3
0
        private void CloseDC()
        {
            try {
                Worksheets.Clear();
                xml_sheets.Clear();
                shared_strings.Clear();

                xml_workbook = null;
                xml_wb_rels = null;
                xml_shared_strings = null;

                GC.Collect();
                GC.WaitForPendingFinalizers();

            } catch ( Exception ex ) {
                throw new FastXcelException( "Error closing a document", ex );
            }
        }