示例#1
0
 internal string GetOutputUrl(ReportFormat.ExportType outputFormat)
 {
     string strUrl = this.Page.AppRelativeVirtualPath.Substring(0, this.Page.AppRelativeVirtualPath.LastIndexOf("/") + 1);
     strUrl += outputFormat.ToString() + "Doc/";
     strUrl += Path.GetFileName(this.GetOutputPath(outputFormat));
     return strUrl;
 }
示例#2
0
        internal string GetOutputPath(ReportFormat.ExportType outputFormat)
        {
            string path = this.Page.MapPath(this.Page.AppRelativeVirtualPath);
            string directory = Path.GetDirectoryName(path);
            string filename = Path.GetFileNameWithoutExtension(path);
            string extension = String.Empty;
            string dir = String.Empty;
            if (outputFormat == ReportFormat.ExportType.Excel)
            {
                extension = "xls";
            }
            else
            {
                extension = "pdf";
            }

            dir = directory + "\\" + outputFormat.ToString() + "Doc";

            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }

            path = string.Format("{0}\\" + outputFormat.ToString() + "Doc\\{1}", directory, string.Format("{0}-{1:yyMMddHHmmss}", filename, DateTime.Now));
            path = Path.ChangeExtension(path, extension);
            return path;
        }