Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Again Crystal Report

Again Crystal Report

Scheduled Pinned Locked Moved Database
helpdatabasetutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    simworld
    wrote on last edited by
    #1

    again I am sending the same problem but this time I searched in google for the code,and use the code that I got from this forum what I have found i am sending, --------------------------------------- CrystalReport1 report=new CrystalReport1(); report.ReportOptions.EnableSaveDataWithReport = false; CrystalDecisions.Shared.TableLogOnInfo myLogin; CrystalDecisions.Shared.ConnectionInfo oCRConnectionInfo = new CrystalDecisions.Shared.ConnectionInfo(); foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in report.Database.Tables) { myLogin = myTable.LogOnInfo ; //myLogin.ConnectionInfo.ServerName="(local)"; myLogin.ConnectionInfo.ServerName="."; myLogin.ConnectionInfo.UserID = "sa" ; myLogin.ConnectionInfo.Password = "123456" ; myLogin.ConnectionInfo.DatabaseName="temp"; myTable.ApplyLogOnInfo(myLogin) ; myTable.Location.Substring(myTable.Location.LastIndexOf(".") + 1); } OleDbConnection oleConn = new OleDbConnection("Provider=sqloledb; data source = .; initial catalog = inventory; user id = sa; password = 123456"); oleConn.Open(); OleDbDataAdapter da = new OleDbDataAdapter("select * from student",oleConn); DataSet ds=new DataSet(); da.Fill(ds); CrystalDecisions.CrystalReports.Engine.ReportDocument myReportDocument; myReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); myReportDocument.Load(@"C:\Inetpub\wwwroot\temp\CrystalReport1.rpt",CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy); myReportDocument.SetDataSource(ds); this.CrystalReportViewer1.ReportSource =myReportDocument; CrystalReportViewer1.DataBind(); CrystalReportViewer1.RefreshReport(); CrystalReportViewer1.DisplayToolbar = true; CrystalReportViewer1.DisplayGroupTree = false; oleConn.Close(); I did not got any error but my crystal Report Viewer contains no data i.e. it contains only Crystal Report Toolbar ,no data(Blank Report) If I use F11 to run step by step ,I found the execution did not enter in the following Code. foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in report.Database.Tables) { myLogin = myTable.LogOnInfo ; //myLogin.ConnectionInfo.ServerName="(local)"; myLogin.ConnectionInfo.ServerName="."; myLogin.ConnectionInfo.UserID = "sa" ; myLogin.ConnectionInfo.Password = "123456" ; myLogin.ConnectionInfo.DatabaseName="temp"; myTable.ApplyLogOnInfo(myLogin) ; myTable.Location.Substring(myTable.Locatio

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups