回复 4楼frank.zhang的帖子
HtmlViewer这样写
前台代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="交互式报表.aspx.cs" Inherits="WebApplication1.页面报表.交互式报表" %>
<%@ Register Assembly="GrapeCity.ActiveReports.Web.v9, Version=9.0.1678.0, Culture=neutral, PublicKeyToken=096a9279a87304f1"
Namespace="GrapeCity.ActiveReports.Web" TagPrefix="ActiveReportsWeb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ActiveReportsWeb:WebViewer ID="WebViewer1" runat="server" Height="100%" Width="100%"
ViewerType="HtmlViewer">
</ActiveReportsWeb:WebViewer>
</div>
</form>
</body>
</html>
后台代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1.页面报表
{
public partial class 交互式报表 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
setReport();
}
public void setReport()
{
string url = "rptOrderDetails.rdlx";
GrapeCity.ActiveReports.PageReport report1 = null;
WebViewer1.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.HtmlViewer;
report1 = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath("页面报表/" + url)));
WebViewer1.Report = report1; ;
}
}
}
但是这样写报表就出不来了,把HtmlViewer改成FlashViewer报表能出来,但是侧边栏不是我想要的HtmlViewer的那个效果,怎么解决 |