找回密码
 立即注册

QQ登录

只需一步,快速开始

jlspslzxf

注册会员

2

主题

4

帖子

69

积分

注册会员

积分
69
  • 60

    金币

  • 主题

  • 帖子

最新发帖
jlspslzxf
注册会员   /  发表于:2014-5-26 15:58  /   查看:5425  /  回复:3
这里 aspx页面后边的.cs 里边找代码


protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            GrapeCity.ActiveReports.PageReport report1 = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath("../") + "Reports/1.rdlx"));
            report1.Document.LocateDataSource += new GrapeCity.ActiveReports.LocateDataSourceEventHandler(Document_LocateDataSource);
            
            //WebViewer1.PdfExportOptions.FitWindow = false;
            //WebViewer1.PdfExportOptions.DisplayMode = GrapeCity.ActiveReports.Export.Pdf.Section.DisplayMode.Outlines;
            this.WebViewer1.FlashViewerOptions.ResourceLocale = "zh_CN";
            this.WebViewer1.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.FlashViewer;
            
            WebViewer1.Report = report1;
        }
        void Document_LocateDataSource(object sender, GrapeCity.ActiveReports.LocateDataSourceEventArgs args)
        {
            if (args.DataSourceName == "DataSource1")
            {
                if (args.DataSetName == "DataSet1")
                {
                    args.Data = GetData();
                    
                }
            }
        }
        private DataTable GetData()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Col1");
            dt.Columns.Add("Col2");
            dt.Columns.Add("Col3");
            dt.Rows.Add(1, 1, 1);
            dt.Rows.Add(2, 1, 1);
            dt.Rows.Add(3, 1, 1);
            dt.Rows.Add(4, 1, 1);
            dt.Rows.Add(5, 1, 1);
            dt.Rows.Add(6, 1, 1);
        
            return dt;
        }

3 个回复

倒序浏览
roger.wang
社区贡献组   /  发表于:2014-5-26 16:51:00
沙发
回复 1楼jlspslzxf的帖子

1 打开1.rdlx文件
2 选择Table控件
3 在属性对话框,选择FixedSize,调整一下这个Table的Height、Width试试看。
回复 使用道具 举报
jlspslzxf
注册会员   /  发表于:2014-5-27 09:15:00
板凳
回复 2楼roger.wang的帖子

已经解决,非常感谢版主
回复 使用道具 举报
roger.wang
社区贡献组   /  发表于:2014-5-27 09:26:00
地板
回复 3楼jlspslzxf的帖子

客气了。

欢迎有问题开新帖沟通。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部