Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When i tried to run a report in one of my winform application i got this error

C#
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.


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]
C#
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();
            }
        }
Posted
Updated 13-Apr-16 6:24am
v2
Comments
an0ther1 11-Apr-16 17:37pm    
Have you installed the Crystal Reports run-times on the machine you are running the application on?
Refer http://scn.sap.com/docs/DOC-7824

Kind Regards
CHill60 11-Apr-16 18:55pm    
You could try sharing the code that you are using to load this report. Use the Improve question link
Member 12414126 12-Apr-16 6:25am    
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();
}
}

 
Share this answer
 
Comments
Member 12414126 12-Apr-16 8:39am    
i have tried adding the code but the problem still persist
CHill60 12-Apr-16 11:14am    
Member 12414126 12-Apr-16 11:30am    
i have and am still witnessing the same problem. send me your email let me zip the file for you and help me check my code if am doing something wrong. will be glad if you can. Thank you in advance
CHill60 12-Apr-16 11:35am    
I do not share my email on open forums. Nor do accept emails with zip files attached unless I know the sender personally.
Member 12414126 12-Apr-16 11:48am    
how can you help me then? should i send my own email address? or my facebook id?
XML
<?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>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900