c690da2e12af1de877ff7b38f6e411c2f0275e61
FAQ/SaveThumbail.md
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +#SaveThumbnail() |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +Allows customization of the process that saves the form attached to a report |
|
| 8 | + |
|
| 9 | +##Global.asax (C♯) |
|
| 10 | + |
|
| 11 | +```csharp |
|
| 12 | + static Dictionary<string, byte[]> thumbnails = new Dictionary<string, byte[]>(); |
|
| 13 | + |
|
| 14 | + public override void SaveThumbnail(ReportInfo reportInfo, System.Drawing.Bitmap thumbnail) |
|
| 15 | + { |
|
| 16 | + byte[] thd; |
|
| 17 | + using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { |
|
| 18 | + thumbnail.Save(ms, System.Drawing.Imaging.ImageFormat.Png); |
|
| 19 | + thd = ms.ToArray(); |
|
| 20 | + } |
|
| 21 | + thumbnails.Add((reportInfo.Category ?? "") + "#" + (reportInfo.Name ?? ""), thd); |
|
| 22 | + } |
|
| 23 | +``` |
|
| 24 | + |
|
| 25 | +##Global.asax (VB.NET) |
|
| 26 | + |
|
| 27 | +```visualbasic |
|
| 28 | + |
|
| 29 | +``` |
|
| 30 | + |
|
| 31 | +_**Note:** The overriden SaveThumbnail method must NOT contain anything which can trigger HttpContext.Current getter call, including reportInfo.FullName. |
|
| ... | ... | \ No newline at end of file |