Login Problem with CrystalReports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vajrala Narendra
    New Member
    • Jun 2007
    • 73

    Login Problem with CrystalReports

    Hi Experts,

    In my VisulaStudio200 8 c#.net windows Apllication i have a crystalReport(M ain) it have 5 subreports.
    i did this report in my local machine so i gave datasource, database name and other credentials i set as local only
    but from coding i set database login details dynamically to get data from required source
    my code is like this

    Code:
    ShiftSummaryReport  report = new ShiftSummaryReport(); 
    ReportDocument crSubreportDoc; 
    Sections crSections; 
    ReportObjects crReportObjects; 
    SubreportObject crSubreportObject; 
    
    report.SetDataSource(shiftSummaryDataset.Tables[0]);
    report.SetDatabaseLogon(user, password, server, database);
    crSections = report.ReportDefinition.Sections;
    foreach (Section crsection in crSections) 
    {
    crReportObjects = crsection.ReportObjects;
    foreach (ReportObject crreportobject in crReportObjects) 
    {
    if (crreportobject.Kind == ReportObjectKind.SubreportObject) 
    {
    crSubreportObject = (SubreportObject)crreportobject; 
    crSubreportDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
    crSubreportDoc.SetDatabaseLogon(user, password, server, database);
    }
    }
    }
    i kept debug and checked, values coming to those variables and executing fine.
    but still it is asking for database login.
    how can i solve this?
    please help me out


    Thanks In Advance
    --Naren
Working...