public string BuildIndex() { string tmp = Path.GetTempPath(); SingleFileAttachment sfa = new SingleFileAttachment(tmp); sfa.Name = "Workbook.html"; sfa.UseName = "Workbook.html"; string index = this.BuildAttachmentHeader(sfa); index += Environment.NewLine; //string links = string.Empty; string sheets = string.Empty; foreach (SingleFileAttachment att in this.Attachments) { if (att.UseName.StartsWith("Sheet")) { //links += att.GetWorksheetLink(); sheets += att.GetWorksheetXML(); } } index += string.Format(INDEX_TEMPLATE, sheets); index += Environment.NewLine; return(index); }
public string BuildFileList() { string tmp = Path.GetTempPath(); SingleFileAttachment sfa = new SingleFileAttachment(tmp); sfa.Name = "filelist.xml"; sfa.RelPath = "Worksheets"; sfa.UseName = "filelist.xml"; string fileList = this.BuildAttachmentHeader(sfa); fileList += Environment.NewLine; string files = string.Empty; foreach (SingleFileAttachment att in this.Attachments) { files += @" <o:File HRef=3D""" + Path.GetFileName(att.RelPath) + @"""/> "; } string fileListTmpl = @"<xml xmlns:o=3D""urn:schemas-microsoft-com:office:office""> <o:MainFile HRef=3D""../Workbook.html""/> {0}</xml>"; fileList += string.Format(fileListTmpl, files); return(fileList); }
public SingleFileAttachment AddAttachment(string path) { SingleFileAttachment sfa = new SingleFileAttachment(path); string ext = Path.GetExtension(path); if (!string.IsNullOrEmpty(ext)) { ext = ext.ToLower(); } sfa.RelPath = "Worksheets"; this.Attachments.Add(sfa); return(sfa); }
public SingleFileAttachment AddAttachment( string path ) { SingleFileAttachment sfa = new SingleFileAttachment( path ); string ext = Path.GetExtension( path ); if( !string.IsNullOrEmpty( ext ) ) ext = ext.ToLower(); sfa.RelPath = "Worksheets"; this.Attachments.Add( sfa ); return sfa; }
public string BuildIndex() { string tmp = Path.GetTempPath(); SingleFileAttachment sfa = new SingleFileAttachment( tmp ); sfa.Name = "Workbook.html"; sfa.UseName = "Workbook.html"; string index = this.BuildAttachmentHeader( sfa ); index += Environment.NewLine; //string links = string.Empty; string sheets = string.Empty; foreach( SingleFileAttachment att in this.Attachments ) { if( att.UseName.StartsWith( "Sheet" ) ) { //links += att.GetWorksheetLink(); sheets += att.GetWorksheetXML(); } } index += string.Format( INDEX_TEMPLATE, sheets ); index += Environment.NewLine; return index; }
public string BuildFileList() { string tmp = Path.GetTempPath(); SingleFileAttachment sfa = new SingleFileAttachment( tmp ); sfa.Name = "filelist.xml"; sfa.RelPath = "Worksheets"; sfa.UseName = "filelist.xml"; string fileList = this.BuildAttachmentHeader( sfa ); fileList += Environment.NewLine; string files = string.Empty; foreach( SingleFileAttachment att in this.Attachments ) { files += @" <o:File HRef=3D"""+ Path.GetFileName( att.RelPath ) +@"""/> "; } string fileListTmpl = @"<xml xmlns:o=3D""urn:schemas-microsoft-com:office:office""> <o:MainFile HRef=3D""../Workbook.html""/> {0}</xml>"; fileList += string.Format( fileListTmpl, files ); return fileList; }
public string BuildAttachmentHeader( SingleFileAttachment att ) { string header = att.GetAttachmentHeader( this.ContentLocationBase, this.MIMEBoundary ); return header; }
public string BuildAttachmentHeader(SingleFileAttachment att) { string header = att.GetAttachmentHeader(this.ContentLocationBase, this.MIMEBoundary); return(header); }