当前位置:编程学习 > C#/ASP.NET >>

XtraReport.ShowPreview()使用这个方法时报"The method or operation is not supported"的错误

我用的Devexpress 11.1.8的开发工具设计的repx文件,设计报表时没有绑定数据源,下面是我的代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default5.aspx.cs" Inherits="Web.Default5" %>

<%@ Register Assembly="DevExpress.XtraReports.v11.1.Web, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.XtraReports.Web" TagPrefix="dx" %>

<!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>
        <dx:ReportViewer ID="rvDemo" runat="server" onload="rvDemo_Load"></dx:ReportViewer>
    </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;
using DevExpress.XtraReports.UI;

namespace Web
{
    public partial class Default5 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void rvDemo_Load(object sender, EventArgs e)
        {
            XtraReport xr = new XtraReport();
            xr.LoadLayout(@"C:\Users\Default\Desktop\DXexpress Demo\DXexpress\Web\File\Report1.repx");
            xr.ShowPreview();
        }
    }
}


代码运行到xr.ShowPreview();时报"The method or operation is not supported"错误

这个错误本人纠结了很久,求高人指点,谢谢! --------------------编程问答-------------------- 帮顶 --------------------编程问答-------------------- 谢谢1楼的帮助。

刚刚本人做了个测试,在Winform中使用这个方法可以通过,而且报表也正常的显示出来了;还一个我要补充的是我的devexpress工具已经破解了

public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
             
        }

        private void printControl1_Load(object sender, EventArgs e)
        {
            XtraReport xr = new XtraReport();
            xr.LoadLayout(@"C:\Users\Default\Desktop\DXexpress Demo\DXexpress\Winform\File\Report1.repx");
            xr.ShowPreview();
        }
    }
--------------------编程问答-------------------- 怎么没人回答了呢,难道这种问题没人遇到过吗? --------------------编程问答-------------------- UP。。。。。。。。偶也是这个问题。。。请问你解决了嘛 --------------------编程问答-------------------- 此问题暂时还没解决,因为本人现在的任务不在这个方向了,以后是否还否还会继续这方面的研究还不知道
根据我一些朋友的回复和留言,我的repx文件是用winform的Designer设计器设计的,在winform程序中能够正常显示,但是在Web中是否能够解析repx文件并把报表显示出来,这个就有待研究了 --------------------编程问答-------------------- 已经解决,可以看官方网站的文档。。。有web相应的做法。。。

引用 5 楼 yhngjiol 的回复:
此问题暂时还没解决,因为本人现在的任务不在这个方向了,以后是否还否还会继续这方面的研究还不知道
根据我一些朋友的回复和留言,我的repx文件是用winform的Designer设计器设计的,在winform程序中能够正常显示,但是在Web中是否能够解析repx文件并把报表显示出来,这个就有待研究了
--------------------编程问答-------------------- DevExpress XrtaReport  报表用过吗?

XtraReport.ShowPreview()使用这个方法时报"The method or operation is not supported"的错误 --------------------编程问答-------------------- Web的程序是不能用@"C:\Users\Default\Desktop\DXexpressDemo\DXexpress\Winform\File\Report1.repx"
这样的绝对路径的,因为你的网站是挂到服务器上的,只能用服务器路径,不然就会报错
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,