I have some Crystal Reports that were created using Crystal (external to Visual Studio) and are now loaded in the VS project. Before the report is previewed I set up the rep
If you have added the logon info as follows,
LogInfo.ConnectionInfo.ServerName = "mcqueen";
LogInfo.ConnectionInfo.Password = "abc123";
LogInfo.ConnectionInfo.UserID = "sa";
LogInfo.ConnectionInfo.DatabaseName = "tbboss";
crysViewer.LogOnInfo.Add(LogInfo);
simply put the crysViewer.LogOnInfo.Add(LogInfo); at the end of crystal Viewer parameter settings. Like follows.
LogInfo.ConnectionInfo.ServerName = "mcqueen";
LogInfo.ConnectionInfo.Password = "abc123";
LogInfo.ConnectionInfo.UserID = "sa";
LogInfo.ConnectionInfo.DatabaseName = "tbboss";
int exportFormatFlags =(int)(CrystalDecisions.Shared.ViewerExportFormats.PdfFormat | CrystalDecisions.Shared.ViewerExportFormats.ExcelFormat);
crysViewer.AllowedExportFormats = exportFormatFlags;
crysViewer.ReportSource = Server.MapPath("Reports/Report1.rpt");
crysViewer.ParameterFieldInfo = paramFields;
crysViewer.LogOnInfo.Add(LogInfo);