本文整理汇总了C#中Callback.getWorkbookForSwf方法的典型用法代码示例。如果您正苦于以下问题:C# Callback.getWorkbookForSwf方法的具体用法?C# Callback.getWorkbookForSwf怎么用?C# Callback.getWorkbookForSwf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Callback
的用法示例。
在下文中一共展示了Callback.getWorkbookForSwf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//Bitmap map;
if (Request["chartImg"] != null && Request["chartType"] != null && Request["tableData"] != null && Request["source"] != null && Request["keywords"] != null && Request["title"] != null && Request["subtitle"] != null && Request["filename"] != null)
{
string imageBitString = Request["chartImg"].ToString();
string imageType = Request["chartType"].ToString();
string tTableData = Request["tableData"].ToString();
string tSource = Request["source"].ToString();
string tKeywords = Request["keywords"].ToString();
string tTitle = Request["title"].ToString();
string tSubtitle = Request["subtitle"].ToString();
string tfilename = Request["filename"].ToString();
if (String.IsNullOrEmpty(tfilename))
tfilename = "radar";
string extenstion =string.Empty;
string contentType = string.Empty;
MemoryStream tData = null;
switch(imageType.ToLower())
{
case "image/png":
tData = new MemoryStream();
MemoryStream picStream = new MemoryStream(Convert.FromBase64String(imageBitString));
extenstion = ".png";
contentType = "image/png";
tData = picStream;
picStream.Close();
picStream.Dispose();
break;
case "application/vnd.xls":
tData = new MemoryStream();
Callback callbackObj = new Callback(this.Page);
IWorkbook workbook = callbackObj.getWorkbookForSwf(tTitle, tSubtitle, tSource, tKeywords, tTableData, imageBitString);
if (workbook!=null)
workbook.SaveToStream(tData, FileFormat.XLS97);
else
workbook.SaveToStream(tData, FileFormat.XLS97);
workbook.Close();
extenstion = ".xls";
contentType = "application/vnd.xls";
break;
}
tData.Close();
tData.Dispose();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = contentType;
Response.AppendHeader("Content-Disposition", "attachment; filename=" + tfilename + extenstion +"");
Response.BinaryWrite(tData.ToArray());
Response.End();
}
}
示例2: SaveGalleryItem
//.........这里部分代码省略.........
Param1.DbType = DbType.String;
Param1.Value = SelAreaInQds;
DbParams.Add(Param1);
DataTable dtAreaNames = ObjDIConnection.ExecuteDataTable("sp_get_AreaNames_" + dbLngCode, CommandType.StoredProcedure, DbParams);
if (dtAreaNames != null && dtAreaNames.Rows.Count > 0)
{
Areas += "{@@}" + dtAreaNames.Rows[0][0].ToString();
}
}
// Insert records into database
KeyWordNIds = this.InsertIntoKeywordsTable(Indicators, Areas, UDK);
//RetVal = this.InsertIntoPresentationsTable(DateTime.Now.ToShortDateString(), DateTime.Now.ToShortDateString(), CategoryNId, Name, Type,
// ChartType, Desc, UDK, DBNId, LngCode, UserNId, KeyWordNIds);
RetVal = this.InsertIntoPresentationsTable(DateTime.Now.ToString(), DateTime.Now.ToString(), CategoryNId, Name, Type,
ChartType, Desc, UDK, DBNId, LngCode, UserNId, KeyWordNIds);
// Created Folder if not exists
this.Create_Directory_If_Not_Exists(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal));
#region Save details for radar
if (ChartType == "radar" || ChartType == "scatter3d")
{
MemoryStream picStream = new MemoryStream(Convert.FromBase64String(imgInText));
System.Drawing.Image chartImage = System.Drawing.Image.FromStream(picStream);
Bitmap bmp = new Bitmap(chartImage, 269, 150);
bmp.Save(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal + "\\" + RetVal + "_t.png"), System.Drawing.Imaging.ImageFormat.Png);
bmp.Dispose();
bmp = new Bitmap(chartImage, 584, 326);
bmp.Save(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal + "\\" + RetVal + ".png"), System.Drawing.Imaging.ImageFormat.Png);
bmp.Dispose();
chartImage.Dispose();
this.Create_File(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "stock\\templates\\swfvisualizer.html"), Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal + "\\" + RetVal + ".html"));
this.Save_Settings_File(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal + "\\" + RetVal + ".xml"), SettingData);
Callback callbackObj = new Callback(this.Page);
IWorkbook workbook = callbackObj.getWorkbookForSwf(title, subtitle, source, keywords, tableData, imgInText);
workbook.SaveAs(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal + "\\" + RetVal + ".xls"), SpreadsheetGear.FileFormat.XLS97);
workbook.Close();
}
#endregion
#region Save details for Map
else if (ChartType == "map")
{
SaveKMLMap(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal), RetVal);
SavePngMap(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal), RetVal + "_t", false, false, 150, 269);
SavePngMap(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal), RetVal, true, true, 326, 584);
SaveExcelMap(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal), RetVal);
//SaveMap(string FolderNameWPath, string FileName)
}
#endregion
#region Save details for table
else if (ChartType == "table")
{
this.Create_File(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "stock\\templates\\table.png"), Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal + "\\" + RetVal + ".png"));
this.Create_File(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "stock\\templates\\table_t.png"), Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal + "\\" + RetVal + "_t.png"));
Callback callbackObj = new Callback(this.Page);
IWorkbook workbook = callbackObj.getWorkbookXLS(title, subtitle, source, keywords, tableData, imgInText);
workbook.SaveAs(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal + "\\" + RetVal + ".xls"), FileFormat.XLS97);
workbook.Close();
SettingData = SettingData.Replace("[******]", "[****]");
WriteHTMLtoFile(SettingData, Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, folderStructure + RetVal + "\\" + RetVal + ".html"));
}
#endregion
#region Save details for treemap
else if (ChartType == "treemap" || ChartType == "cloud")
{
string thumbImage = string.Empty;