-
Notifications
You must be signed in to change notification settings - Fork 1
/
Default.aspx.vb
43 lines (34 loc) · 1.51 KB
/
Default.aspx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Imports System
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraCharts.Native
Imports DevExpress.XtraPrintingLinks
Imports System.IO
Namespace S130793
Partial Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim ps As New PrintingSystemBase()
ps.ExportOptions.Pdf.DocumentOptions.Author = "Test"
Dim link1 As New PrintableComponentLinkBase(ps)
link1.Component = ASPxPivotGridExporter1
Dim link2 As New PrintableComponentLinkBase(ps)
WebChartControl1.DataBind()
link2.Component = DirectCast(WebChartControl1, IChartContainer).Chart
Dim compositeLink As New CompositeLinkBase(ps)
compositeLink.Links.AddRange(New Object() { link1, link2 })
Using stream As New MemoryStream()
compositeLink.ExportToPdf(stream)
Response.Clear()
Response.Buffer = False
Response.AppendHeader("Content-Type", "application/pdf")
Response.AppendHeader("Content-Transfer-Encoding", "binary")
Response.AppendHeader("Content-Disposition", "attachment; filename=test.pdf")
Response.BinaryWrite(stream.ToArray())
Response.End()
End Using
ps.Dispose()
End Sub
End Class
End Namespace