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#
questionsalesregextutorial
4 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.
  • C Offline
    C Offline
    CodingYoshi
    wrote on last edited by
    #1

    1. I have all the data in a DataTable. I have created the CrystalReport document using VS2005 by using labels, boxes etc. Now do I   have to use formula fields to set the values in the document. 2. When I have all the documents created how can I send them all to the CrystalReportViewer at once for viewing? For example, if I wanted to show all the orders of a customer and I have created a custom CrystalReport document for the orders.

    CodingYoshi Artificial Intelligence is no match for Human Stupidity.

    A 1 Reply Last reply
    0
    • C CodingYoshi

      1. I have all the data in a DataTable. I have created the CrystalReport document using VS2005 by using labels, boxes etc. Now do I   have to use formula fields to set the values in the document. 2. When I have all the documents created how can I send them all to the CrystalReportViewer at once for viewing? For example, if I wanted to show all the orders of a customer and I have created a custom CrystalReport document for the orders.

      CodingYoshi Artificial Intelligence is no match for Human Stupidity.

      A Offline
      A Offline
      Adam R Harris
      wrote on last edited by
      #2

      CodingYoshi wrote:

      1. I have all the data in a DataTable. I have created the CrystalReport document using VS2005 by using labels, boxes etc. Now do I   have to use formula fields to set the values in the document.

      Your Crystal Report is, i would hate the be the one to tell you, not going to work. Crystal reports work based on either Strongly Typed Datasets or Parameters. Let me save you the head ache, you want to use a Strongly Typed Dataset. Parameters are good for ... well parameters to filter your dataset or for something trivial like headers or something like that. What you are going to want to do is create a new Dataset in your project, then make that mimic your data schema. After you have created your "Strongly Typed" Dataset add a new Crystal Report to your project and set the Datasource to your newly created Dataset. When creating your Crystal Report you want to use the "Data Fields" to actually display data to the user. Labels and Boxes are for static content, Your going to have to work the Google to get more info on how to create Crystal Reports.

      CodingYoshi wrote:

      2. When I have all the documents created how can I send them all to the CrystalReportViewer at once for viewing?

      Well this is extremely simple;

      1. Create a new form with a CrystalReportViewer on it
      2. Create a new instance of your report and call Load() on it
      3. Set the ReportDocument property ont he CrystalReportViewer to your new report instance

      If at first you don't succeed ... post it on The Code Project and Pray.

      A 1 Reply Last reply
      0
      • A Adam R Harris

        CodingYoshi wrote:

        1. I have all the data in a DataTable. I have created the CrystalReport document using VS2005 by using labels, boxes etc. Now do I   have to use formula fields to set the values in the document.

        Your Crystal Report is, i would hate the be the one to tell you, not going to work. Crystal reports work based on either Strongly Typed Datasets or Parameters. Let me save you the head ache, you want to use a Strongly Typed Dataset. Parameters are good for ... well parameters to filter your dataset or for something trivial like headers or something like that. What you are going to want to do is create a new Dataset in your project, then make that mimic your data schema. After you have created your "Strongly Typed" Dataset add a new Crystal Report to your project and set the Datasource to your newly created Dataset. When creating your Crystal Report you want to use the "Data Fields" to actually display data to the user. Labels and Boxes are for static content, Your going to have to work the Google to get more info on how to create Crystal Reports.

        CodingYoshi wrote:

        2. When I have all the documents created how can I send them all to the CrystalReportViewer at once for viewing?

        Well this is extremely simple;

        1. Create a new form with a CrystalReportViewer on it
        2. Create a new instance of your report and call Load() on it
        3. Set the ReportDocument property ont he CrystalReportViewer to your new report instance

        If at first you don't succeed ... post it on The Code Project and Pray.

        A Offline
        A Offline
        Adam R Harris
        wrote on last edited by
        #3

        Guess I should have mentioned that you can connect directly to your database from Crystal Reports, but its a bad idea due to the fact the if you want to deploy the report to a different server you have to recompile your app (if the reports are embedded) or your report (if you are loading your reports externally). Oh yeah, and if you want to load an external report all you have to do is call the overridden Load() on the ReportDocument object passing it the path to the report document to load.

        If at first you don't succeed ... post it on The Code Project and Pray.

        C 1 Reply Last reply
        0
        • A Adam R Harris

          Guess I should have mentioned that you can connect directly to your database from Crystal Reports, but its a bad idea due to the fact the if you want to deploy the report to a different server you have to recompile your app (if the reports are embedded) or your report (if you are loading your reports externally). Oh yeah, and if you want to load an external report all you have to do is call the overridden Load() on the ReportDocument object passing it the path to the report document to load.

          If at first you don't succeed ... post it on The Code Project and Pray.

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

          Thanks! I am grabbing the data from the database from many tables, processing the data and then saving it in DataTable object. What I need to do now is create a strongly typed DataSet (As you mentioned) and fill it with data from the datatable. Then it should work, hopefully.

          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