Click here to Skip to main content
15,916,846 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Hello
I have a crystal report which is not getting displayed instead it is asking for logon information whenever i run the project. I have taken datatable instead of dataset that too wont work.
Please help. Here is the code...
C#
protected void Button1_Click(object sender, EventArgs e)
    {

        public OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Currently_Working\Chequedatabase.mdb;Persist Security Info=False");
        conn.Open();
        OleDbDataAdapter da = new OleDbDataAdapter("select * from tbl_cheque_data;", conn);
        DataSet ds = new DataSet();
        da.Fill(ds, "tbl_cheque_data");
        ReportDocument myReport = new ReportDocument();
        myReport.Load(Server.MapPath("Cr_online_cheque.rpt"));
        myReport.SetDataSource(ds.Tables[0]);///Take index in [] for C#
        this.CrystalReportViewer1.Visible = true;
        
        foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in myReport.Database.Tables)
        {
            myLogin = myTable.LogOnInfo;
            myLogin.ConnectionInfo.ServerName = "param"; //name of PC
            myLogin.ConnectionInfo.DatabaseName = "Chequedatabase.mdb"; //name of Database
            myLogin.ConnectionInfo.Password = "";
            myLogin.ConnectionInfo.UserID = "";
            myTable.ApplyLogOnInfo(myLogin);
        } 
        CrystalReportViewer1.ReportSource = myReport;
        CrystalReportViewer1.DataBind(); 
        conn.Close(); 
        
    }
Posted
Updated 1-Mar-11 18:25pm
v2
Comments
MR.FIROZ KHAN 14-Jun-12 7:07am    
have a problem while developing some webpages.The Problem is that:-
How We Can Disable The Controls Of One Web Form From Other Web Form In
Asp.net?

Explanation:-
There Should Be Two Web Form,Web Form1.aspx and Web Form2.aspx,Now From Web
Form1.aspx When I Click One Button (Disable), Then Web Form2.aspx Buttons
And Other Text Boxes Etc
Should Be Disable. Means Now After Clicking The Button(Disable) From Web
form1.aspx If I click any Button on Web Form2.aspx then That
Button Should not Clicked Means The Buttons Should be Disable OR Doesn¡¦t Do
Any Work On Web Form2.aspx as The Whole Form Should Now
Be Disable For Any Working.
Remember One Thing That The Both Forms,Web Form1.aspx
and Web Form2.aspx Will Open In Browser and When the Both are running Then I
Would Click on Web Form1.aspx¡¦s Disable Button to
Disable Web Form2.aspx And After Disabled The Web Form2.aspx Should be There
In Its Browser Means It Should not Closed But Remained Open. And In Same Way
When I Click Alive Button On
Web Form1.aspx Then The Disabled Form Web Form2.aspx Should be
Alive.

1 solution

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