本文介绍了获取和错误的无效报告路径.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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??

推荐答案


这篇关于获取和错误的无效报告路径.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 21:41