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. General Programming
  3. C#
  4. Crystal reports -pushed data does not show

Crystal reports -pushed data does not show

Scheduled Pinned Locked Moved C#
databasexmlhelpquestion
2 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.
  • R Offline
    R Offline
    Reanalyse
    wrote on last edited by
    #1

    This is driving me mad, two almost identical code segments, one works the other does not. Trying to push data to a Crystal Report The code is ______________________________________________________________________________ private void accessrpt_Load(object sender, System.EventArgs e) { //pass the dataset to the report rpt_log rpt1=new rpt_log(); sqlstring="SELECT STATUS, SITE, START_OF_ROAD, DEPARTED, ARRIVED, END_OF_ROAD, NAME, REASON, ACTION, COMPANY, ROAD_CHECK_REQUIRED, COMMENTS, SITE FROM ARADMIN.TCC_SITE_ARRIVAL_LOG WHERE (NAME = '"+Class1.strVariable +"')"; System.Data.OracleClient.OracleConnection oconn= new System.Data.OracleClient.OracleConnection("user id=hidden;datasource=oracle1;password=hidden"); System.Data.OracleClient.OracleDataAdapter oda= new System.Data.OracleClient.OracleDataAdapter(sqlstring,oconn); oda.Fill(tcc_log1); tcc_log1.WriteXml("c:\\datadump.xml"); rpt1.SetDataSource(tcc_log1); log_rep.ReportSource=rpt1; } ______________________________________________________________________________ I know the dataset is correct - the XML dump is exacly what the SQL requests. But cystal reports pointing to the same dataset (as on the last two lines of the sample above) shows the correct headings, gives no error messages but shows no data. Can anybody suggest where I am going wrong ? Thanks

    R 1 Reply Last reply
    0
    • R Reanalyse

      This is driving me mad, two almost identical code segments, one works the other does not. Trying to push data to a Crystal Report The code is ______________________________________________________________________________ private void accessrpt_Load(object sender, System.EventArgs e) { //pass the dataset to the report rpt_log rpt1=new rpt_log(); sqlstring="SELECT STATUS, SITE, START_OF_ROAD, DEPARTED, ARRIVED, END_OF_ROAD, NAME, REASON, ACTION, COMPANY, ROAD_CHECK_REQUIRED, COMMENTS, SITE FROM ARADMIN.TCC_SITE_ARRIVAL_LOG WHERE (NAME = '"+Class1.strVariable +"')"; System.Data.OracleClient.OracleConnection oconn= new System.Data.OracleClient.OracleConnection("user id=hidden;datasource=oracle1;password=hidden"); System.Data.OracleClient.OracleDataAdapter oda= new System.Data.OracleClient.OracleDataAdapter(sqlstring,oconn); oda.Fill(tcc_log1); tcc_log1.WriteXml("c:\\datadump.xml"); rpt1.SetDataSource(tcc_log1); log_rep.ReportSource=rpt1; } ______________________________________________________________________________ I know the dataset is correct - the XML dump is exacly what the SQL requests. But cystal reports pointing to the same dataset (as on the last two lines of the sample above) shows the correct headings, gives no error messages but shows no data. Can anybody suggest where I am going wrong ? Thanks

      R Offline
      R Offline
      Reanalyse
      wrote on last edited by
      #2

      Solved the problem (oh for good error trapping reports) I needed to apps the table as well as the datatest to Crystal reports i.e. rpt1.SetDataSource(tcc_log1.Tables[1])not what was used.

      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