简体   繁体   English

ASP.NET(C#)水晶报表导出失败,并显示“找不到方法。”

[英]ASP.NET (C#) crystal reports export fails with “Method not found..”

as I said in title I have issue when I try to export crystal report to PDF, or anything like that, also when I try to print it I am having same issue, before anything I will post you screenshot to explain it more detailed: 正如我在标题中所说的,当我尝试将Crystal Report导出为PDF或类似的东西时,我也遇到了问题,当我尝试打印它时,我也遇到了同样的问题,在发布任何内容之前,我先将您的屏幕截图详细解释一下:

在此处输入图片说明

I loaded report with my data from database and everything looks fine, reports is opened I can see my data, but when I try to export it to pdf or to print it I am seeing that Error, I've been trying for few hours to solve it, but unfortunately I couldn't make it working.. 我从数据库中加载了我的数据的报告,并且一切看起来都很好,报告已打开,我可以看到我的数据,但是当我尝试将其导出为pdf或进行打印时,我看到了Error,我已经尝试了几个小时才能解决它,但不幸的是我无法使它工作。

I have to mention, that I did next thing before this: 我不得不提到,在此之前我做了下一件事情: 在此处输入图片说明

I set EnableDatabaseLogonPromt to False because before I did that, everytime I tried to do print or export I received this popup (so should I leave it setted to false to avoid this popup?) 我将EnableDatabaseLogonPromt设置为False,因为在执行此操作之前,每次尝试打印或导出时,都会收到此弹出窗口(所以应该将其设置为false以避免此弹出窗口吗?)

在此处输入图片说明

HERE IS MY CODE: 这是我的代码:

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            var x = Server.MapPath("~");

            int playerId = Convert.ToInt32(Request.QueryString["playerID"]);
            PlayersDataSet players= new PlayersDataSet ();
            PlayersDataSet.PlayersTableDataTable playersDT = new PlayersDataSet.PlayersTableDataTable ();
            var player= Players.Data.Services.DAPlayers.GetByPlayerId(playerId);
            string clubname= Players.Data.Services.DAPlayers.GetClubNameByClubID(Convert.ToInt32(player.ClubID));
            playersDT.AddPlayersTableRow(player.FirstName, player.LastName, player.IDNUMBER, clubname, player.Photo, player.IDSerialNumber.ToString());

            players.Tables["PlayersTable"].Merge(playersDT);

            rpt_Players RPT = new rpt_Players ();
            RPT.SetDataSource(players);
            CrystalReportViewer1.ReportSource = RPT;

          }

Any kind of help would be great! 任何形式的帮助都将非常有用! Thank you guys, Cheers 谢谢你们,干杯

回答我自己的问题很愚蠢,但是经过数小时的搜索和尝试许多不同的事情,我发现这是一个解决方案:删除此条件:if(!ispostback){},导出等都可以了。 ::)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM