我的winform桌面应用程序中没有加载我的水晶报告 [英] My crystal report is not loading in my winform desktop application

查看:157
本文介绍了我的winform桌面应用程序中没有加载我的水晶报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图在我的某个winform应用程序中运行报告时出现此错误



When i tried to run a report in one of my winform application i got this error

Could not load file or assembly 'file:///C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.





我尝试了什么:



我试图将我的应用程序更改为.Net framework 3.5但是4.0的某些程序集无法加载但是给了我错误

[来自评论的OP代码]



What I have tried:

I tried to change my application to .Net framework 3.5 but some assemblies with the 4.0 could not load but given me error
[OP code from comment]

private void button3_Click(object sender, EventArgs e)

        {
            MealTicket ticket = new MealTicket ();
            DataSet ds = new DataSet ();
            frmShowTicket ticketfrm = new frmShowTicket();
            rptTicket rpttik = new rptTicket ();
            string ticketno;
            ticketno = textBox4.Text;
            ds = ticket.GetTicket(ticketno);
            if (ds.Tables[0].Rows.Count > 0)
            {
                rpttik.SetDataSource(ds.Tables[0].DefaultView);
                ticketfrm.crv.ReportSource = rpttik;
                ticketfrm.Show();
            }
        }

推荐答案

请参阅此帖子的解决方案1 ​​ - 无法加载文件或程序集'file:/// C:\Program .NET Framework 4.0 \ Common \SAP BusinessObjects Enterprise XI的文件\ SAP BusinessObjects \ Crystal Reports ... [ ^ ]
See Solution 1 on this post - Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI...[^]


<?xml version="1.0"?>
<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="IhouseMealTicket.Properties.Settings.Setting" connectionString="Data Source=.\sqlexpress;Integrated Security=SSPI;Initial Catalog=MealTicket" providerName="System.Data.OleDb"/>
    </connectionStrings>

  <startup useLagacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>

</configuration>


这篇关于我的winform桌面应用程序中没有加载我的水晶报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆