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. Web Development
  3. ASP.NET
  4. i think its easy too solve u guys...

i think its easy too solve u guys...

Scheduled Pinned Locked Moved ASP.NET
questiondatabasehelp
2 Posts 2 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.
  • R Offline
    R Offline
    rs_net
    wrote on last edited by
    #1

    hi all, i am using crystal report in my project. when i am passing the following code then only i can view the values through viewer,otherwise it displaying crystal report engine failed error. my question is --- How can i display the values in viewer without using this lines(thts mean without passing this connection). crConnectionInfo.ServerName = "server1" crConnectionInfo.DatabaseName = "DevReg" crConnectionInfo.UserID = "sa" crConnectionInfo.Password = "sa" crDatabase = CRYRpt1.Database crTables = crDatabase.Tables For Each crtable In crTables crTableLogOnInfo = crtable.LogOnInfo crTableLogOnInfo.ConnectionInfo = crConnectionInfo crtable.ApplyLogOnInfo(crTableLogOnInfo) Next any answers are welcome. regards rs_net

    _ 1 Reply Last reply
    0
    • R rs_net

      hi all, i am using crystal report in my project. when i am passing the following code then only i can view the values through viewer,otherwise it displaying crystal report engine failed error. my question is --- How can i display the values in viewer without using this lines(thts mean without passing this connection). crConnectionInfo.ServerName = "server1" crConnectionInfo.DatabaseName = "DevReg" crConnectionInfo.UserID = "sa" crConnectionInfo.Password = "sa" crDatabase = CRYRpt1.Database crTables = crDatabase.Tables For Each crtable In crTables crTableLogOnInfo = crtable.LogOnInfo crTableLogOnInfo.ConnectionInfo = crConnectionInfo crtable.ApplyLogOnInfo(crTableLogOnInfo) Next any answers are welcome. regards rs_net

      _ Offline
      _ Offline
      __Manoj
      wrote on last edited by
      #2

      hi Try this piece of code!

      ReportDocument rptDoc = new ReportDocument();
      TableLogOnInfo tblLogInf = new TableLogOnInfo();
      rptDoc.Load( <Report Path> );
      					
      foreach( Table tbl in rptDoc.Database.Tables )
      {					
       tblLogInf = tbl.LogOnInfo;
       
       tblLogInf.ConnectionInfo.ServerName = <Database Server Name>
       tblLogInf.ConnectionInfo.DatabaseName = <Database Name>
       tblLogInf.ConnectionInfo.UserID = <User ID>
       tblLogInf.ConnectionInfo.Password = < Password>
      					
       rptDoc.Database.Tables[tbl.Name].ApplyLogOnInfo(tblLogInf);
       rptDoc.Database.Tables[tbl.Name].Location = <Database Name> + .dbo. +       tbl.Name; 
      }
      

      Manoj 'Doing what u like is Freedom, Liking what u do is Happiness'

      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