Click here to Skip to main content
15,888,212 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
public static string connectionString = "Data Source=FAROOQPC\\SQLEXPRESS; Initial Catalog=mydb; Integrated Security=True";

    private SqlDataAdapter  dataAdapter;
    private DataSet dataSet;
    private DataTable dataTable;

    // *** End ADO.NET objects ***
    private static string Name;
    private static string Cell;
    private static string Address;
    //private static string EmpId;
    protected void Page_Load(object sender, EventArgs e)
    {
        string commandstring = "select * from db";

        // The link between the sql command and the database connection
        dataAdapter = new SqlDataAdapter(commandstring, connectionString);

        // Define insert, update, and delete sql commands to use.
        //    BuildCommands();

        // Declare and fill the in-memory dataset from the database
        dataSet = new DataSet();
        dataSet.CaseSensitive = true;
        dataAdapter.Fill(dataSet, "Employee");


        //CrystalReport Report = new CrystalReport();
        ReportDocument Report = new ReportDocument();
            
        
        
             
        
        mydataset ds=new mydataset();
        mydataset.DataTable1DataTable t = (mydataset.DataTable1DataTable)ds.Tables[0];

        dataTable = dataSet.Tables[0];


        foreach (DataRow dataRow in dataTable.Rows)
        {
            // Load global strings from column values in the datarow
            //CustId = dataRow[""].ToString().Trim();
            Name = dataRow["Name"].ToString().Trim();
            Cell = dataRow["Cell"].ToString().Trim();
            Address = dataRow["Address"].ToString().Trim();


            t.AddDataTable1Row(Name, Cell, Address);
        }

       

        Report.SetDataSource(ds);
        //Report.Load("CrystalReport.rpt");
        crystalview.ReportSource = Report;
        //crystalview.DataBind();
     

        //crystalReportViewer1.ReportSource = Report;
            
 
    }
}


when i am debug this code i am getting invalid report path..?? any Idea??
Posted
Comments
Uday P.Singh 4-Oct-11 14:40pm    
In which line are you getting this error while debugging?

1 solution

Have a look at this link. I hope it helps you to figure out what you might have missed.http://www.ironspeed.com/designer/4.3.0/webhelp/Part_VI/Invalid_report_file_path.htm[^]
 
Share this answer
 
Comments
Simon Bang Terkildsen 4-Oct-11 13:06pm    
4 from me, would have been 5 if you had linked to some discussions about the error or a google search with links to such discussion.
Orcun Iyigun 4-Oct-11 14:32pm    
Thank you for the feedback, I will take that into consideration next time I reply to athread :)

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