public partial class Delivery_Print : System.Web.UI.Page
{
GrapeCity.ActiveReports.PageReport Print_Temp = new GrapeCity.ActiveReports.PageReport();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
CustomizeToolbar();
//创建自定义工具条按钮
ToolButton btnPDF = Tool.CreateButton("DF");
btnPDF.ToolTip = "导出到 PDF";
btnPDF.Caption = "导出到 PDF";
//设置点击按钮执行的服务
string PDF_Url = "\\ExportControl\\ARExport.ashx?exporttype=PDF&ReportName=Delivery_Report.rdlx&";
PDF_Url = PDF_Url + "arameter_Name=Delivery_SerialNumber|Company_Name&";
PDF_Url = PDF_Url + "arameter_Value=" + Request.QueryString["Delivery_SerialNumber"] + "|" + HttpUtility.UrlEncode(Session.Contents["User_Department"].ToString()) + "&";
PDF_Url = PDF_Url + "File_Name=" + Request.QueryString["Delivery_SerialNumber"] + ".pdf";
btnPDF.ClickNavigateTo = PDF_Url;
//添加按钮到 FlashViewer 中
this.WV_Delivery_View.FlashViewerToolBar.Tools.Add(btnPDF);
//////////////////////////////////////////////////
Print_Temp.Load(new System.IO.FileInfo(Server.MapPath("\\Reports") + "\\Delivery_Report.rdlx"));
Print_Temp.Report.ReportParameters[0].DefaultValue.Values.Add(Request.QueryString["Delivery_SerialNumber"]);
Print_Temp.Report.ReportParameters[1].DefaultValue.Values.Add(Session.Contents["User_Department"].ToString());
Print_Temp.Document.PrintOptions.PageScaling = GrapeCity.ActiveReports.Extensibility.Printing.PageScaling.ShrinkToPrintableArea;
Print_Temp.Run();
//////////////////////////////////////
this.WV_Delivery_View.FlashViewerOptions.ResourceLocale = "zh_CN";
this.WV_Delivery_View.Report = Print_Temp;
///////////////////////////////
this.WV_Delivery_Print.FlashViewerOptions.ResourceLocale = "zh_CN";
this.WV_Delivery_Print.Report = Print_Temp;
}
}
private void CustomizeToolbar()
{
// 隐藏打印范围按钮
ToolBase btnRang = WV_Delivery_View.FlashViewerToolBar.Tools["ageRangeButton"];
btnRang.Visible = false;
// 隐藏打印按钮
ToolBase btnPrint = WV_Delivery_View.FlashViewerToolBar.Tools["rintButton"];
btnPrint.Visible = false;
ToolButton btnCPrint = Tool.CreateButton("套打");
btnCPrint.Caption = "套打";
btnCPrint.ToolTip = "套打";
WV_Delivery_View.FlashViewerToolBar.Tools.Insert(0, btnCPrint);
}
} |