Search code examples
c#crystal-reports

Crystal Reports login error


I created a report via crystal report. It works on my pc. Database field is null . But when I tried to run on another pc then a window opens. The window has 4 textbox (2 readonly 2 editable)

Server*     192.168.1.2
Database* 
UserName   myusername  +
Password   mypassword  +

(*) places are read only and + places are editable. But i can't change database name . I think the problem is it but i can't understand how can I solve this. I haven't got any problem on my pc. Problem is only on other computers. I setted up crystal reports runtime editions on these computers.


Solution

  • The problem is Datasource settings on your report. Not sure how you are setting those in your code. Refer these links that display how to set it:

    // Create a new customer orders report.
    CustomerOrdersReport report = new CustomerOrdersReport();
    
    // Get the report data.
    DataTable customersTable = getCustomersData();
    DataTable ordersTable = getOrdersData();
    
    // Set datasources.
    report.Database.Tables["Customers"].SetDataSource(customersTable);
    report.Database.Tables["Orders"].SetDataSource(ordersTable ); // Don't forget this line like I did!!
    

    There are other examples available:

    Web Crystal reports produce Database logon failed

    [Failed in Production]

    If you still have a problem, post your code of how you are setting datasource for your report.