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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. CrystalReports

CrystalReports

Scheduled Pinned Locked Moved C#
databasedesignalgorithmsregex
4 Posts 2 Posters 1 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.
  • C Offline
    C Offline
    CodingYoshi
    wrote on last edited by
    #1

    I have written an application where a user can select some parameters using a windows form. The app grabs data from various tables and amalgamates them into a single table. I have also created a dataset with the same columns as the amalgamated table. I created a new crystal report and added the table in the dataset as its datasource. I dragged the columns onto the report. At runtime, I fill the table, then set the report's datasource to the amalgamated table like below: EmployeeReport rpt = new EmployeeReport();// This is the crystal report rpt.Database.Tables(0).SetDataSource(data); // data is the amalgamated table filled at runtime Then I set the CrystalReportViewer control's source as below CrystalReportViewer viewer = new CrystalReportViewer(); viewer.ReportSource = rpt; However, none of the fields are shown in the report except for the layout which I created at design time using boxes and labels etc. I have been searching and googling but no luck :(

    CodingYoshi Artificial Intelligence is no match for Human Stupidity.

    C L 2 Replies Last reply
    0
    • C CodingYoshi

      I have written an application where a user can select some parameters using a windows form. The app grabs data from various tables and amalgamates them into a single table. I have also created a dataset with the same columns as the amalgamated table. I created a new crystal report and added the table in the dataset as its datasource. I dragged the columns onto the report. At runtime, I fill the table, then set the report's datasource to the amalgamated table like below: EmployeeReport rpt = new EmployeeReport();// This is the crystal report rpt.Database.Tables(0).SetDataSource(data); // data is the amalgamated table filled at runtime Then I set the CrystalReportViewer control's source as below CrystalReportViewer viewer = new CrystalReportViewer(); viewer.ReportSource = rpt; However, none of the fields are shown in the report except for the layout which I created at design time using boxes and labels etc. I have been searching and googling but no luck :(

      CodingYoshi Artificial Intelligence is no match for Human Stupidity.

      C Offline
      C Offline
      CodingYoshi
      wrote on last edited by
      #2

      I don't believe it! No one here has an answer! Come on I need some help!

      CodingYoshi Artificial Intelligence is no match for Human Stupidity.

      1 Reply Last reply
      0
      • C CodingYoshi

        I have written an application where a user can select some parameters using a windows form. The app grabs data from various tables and amalgamates them into a single table. I have also created a dataset with the same columns as the amalgamated table. I created a new crystal report and added the table in the dataset as its datasource. I dragged the columns onto the report. At runtime, I fill the table, then set the report's datasource to the amalgamated table like below: EmployeeReport rpt = new EmployeeReport();// This is the crystal report rpt.Database.Tables(0).SetDataSource(data); // data is the amalgamated table filled at runtime Then I set the CrystalReportViewer control's source as below CrystalReportViewer viewer = new CrystalReportViewer(); viewer.ReportSource = rpt; However, none of the fields are shown in the report except for the layout which I created at design time using boxes and labels etc. I have been searching and googling but no luck :(

        CodingYoshi Artificial Intelligence is no match for Human Stupidity.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        are you saying that the fields you dragged onto the report aren't showing at runtime? Have you done a viewer.DataBind(); after setting the reportsource?

        ___________________________________________ .\\axxx (That's an 'M')

        C 1 Reply Last reply
        0
        • L Lost User

          are you saying that the fields you dragged onto the report aren't showing at runtime? Have you done a viewer.DataBind(); after setting the reportsource?

          ___________________________________________ .\\axxx (That's an 'M')

          C Offline
          C Offline
          CodingYoshi
          wrote on last edited by
          #4

          viewer.DataBind() is not an available method on CrystalReportViewer control. This is a desktop application, not a web application. Basically what I am trying to do is as following, for example: I have created the layout of the form for customer orders. Each order should be on a separate page but the layout will be consistent. I grab the data using many stored procedures and then put them into one table (TableAll for example). I have also created one dataset with one table (TableDataSet for example), at design time, which has exactly the same structure as TableAll. I set the crystal report's datasource to   the TableDataSet by using Database Expert (Right click the Database field). I drag the fields from the Database fields onto my report. At run time, my app populate DataAll and I set the report's table (TableDataSet) source to DataAll as below: OrderReport report = new OrderReport(); // Crystal report // The first table of the report gets its data from DataAll, they have same structure report.Database.Tables(0).SetDataSource(DataAll); // Create the viewer CrystalReportViewer viewer = new CrystalReportViewer(); viewer.ReportSource = report; viewer.Visible = true; The report however only contains the layout but no data. Why do you think?

          CodingYoshi Artificial Intelligence is no match for Human Stupidity.

          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