populating Crystal Reports from DataGrid data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brock

    populating Crystal Reports from DataGrid data

    I am trying to populate a Crystal Report from data in my DataGrid.
    The
    reason for this is that I want the user to be able to change values
    without updating the database, but still have their report reflect
    the
    values they anticipate committing to see hypothetical totals of
    columns from a set of records. These records are displaying properly
    on my DataGrid but I'm not sure how to get Crystal Reports 10 to use
    as its datasource the dataset in memory that could be had directly
    from the datagrid.

    I'm guessing I need to Dim a new DataSet, populate it from the
    datagrid, and set the new dataset as the datasource for CR. But how?


    How can I specify that the Datagrid's DataSource property can be
    explicitly cast as a DataSet object that CR can pick up. And how in
    CR
    do I tell it that this resultingDataSe t is what it needs for the
    report?


    I found a snippet of code that may work as PART of the solution, but
    I
    need a little direction.
    Private Sub FillDataSet(ByV al DataFromGrid As DataSet)
    DataFromGrid = CType(dgEmploye es.DataSource, DataSet)
    End Sub

  • sloan

    #2
    Re: populating Crystal Reports from DataGrid data


    And you really need to not multi post.

    I've added some replies in the framework.aspne t newsgroup.




    "Brock" <wade.brock@yah oo.comwrote in message
    news:31f9946f-7410-4c25-96f4-d28b927b9063@l6 4g2000hse.googl egroups.com...
    >I am trying to populate a Crystal Report from data in my DataGrid.
    The
    reason for this is that I want the user to be able to change values
    without updating the database, but still have their report reflect
    the
    values they anticipate committing to see hypothetical totals of
    columns from a set of records. These records are displaying properly
    on my DataGrid but I'm not sure how to get Crystal Reports 10 to use
    as its datasource the dataset in memory that could be had directly
    from the datagrid.
    >
    I'm guessing I need to Dim a new DataSet, populate it from the
    datagrid, and set the new dataset as the datasource for CR. But how?
    >
    >
    How can I specify that the Datagrid's DataSource property can be
    explicitly cast as a DataSet object that CR can pick up. And how in
    CR
    do I tell it that this resultingDataSe t is what it needs for the
    report?
    >
    >
    I found a snippet of code that may work as PART of the solution, but
    I
    need a little direction.
    Private Sub FillDataSet(ByV al DataFromGrid As DataSet)
    DataFromGrid = CType(dgEmploye es.DataSource, DataSet)
    End Sub
    >

    Comment

    • Brock

      #3
      Re: populating Crystal Reports from DataGrid data

      In all due respect I am simply trying to understand the concepts for
      which I am granted a newbie at. Different individuals frequent
      different newsgroups and each has their own perspective on how to
      assit with problem solving. I was having difficulty understanding how
      to begin, even remotely, to construct code to capture the session
      information and make it available to Crystal Reports, plus the
      challenge of how to on the CR side to let it know where the dataset
      resides and how to capture it as its datasource. I meant no offense in
      double posting, I'm just a beginner trying to understand a 'real-
      world' programming challenge that the textbooks due a pitiful job of
      presenting. And again thanks for taking interest in my post. If you
      can help any further I would love to continue, but the solution as
      presented is just over my head.
      thanks Brock

      On Jul 21, 3:21 pm, "sloan" <sl...@ipass.ne twrote:
      And you really need to not multi post.
      >
      I've added some replies in the framework.aspne t newsgroup.
      >
      "Brock" <wade.br...@yah oo.comwrote in message
      >
      news:31f9946f-7410-4c25-96f4-d28b927b9063@l6 4g2000hse.googl egroups.com...
      >
      >
      >
      I am trying to populate a Crystal Report from data in my DataGrid.
      The
      reason for this is that I want the user to be able to change values
      without updating the database, but still have their report reflect
      the
      values they anticipate committing to see hypothetical totals of
      columns from a set of records. These records are displaying properly
      on my DataGrid but I'm not sure how to get Crystal Reports 10 to use
      as its datasource the dataset in memory that could be had directly
      from the datagrid.
      >
      I'm guessing I need to Dim a new DataSet, populate it from the
      datagrid, and set the new dataset as the datasource for CR. But how?
      >
      How can I specify that the Datagrid's DataSource property can be
      explicitly cast as a DataSet object that CR can pick up. And how in
      CR
      do I tell it that this resultingDataSe t is what it needs for the
      report?
      >
      I found a snippet of code that may work as PART of the solution, but
      I
      need a little direction.
         Private Sub FillDataSet(ByV al DataFromGrid As DataSet)
             DataFromGrid = CType(dgEmploye es.DataSource, DataSet)
         End Sub- Hide quoted text -
      >
      - Show quoted text -

      Comment

      • Steve Gerrard

        #4
        Re: populating Crystal Reports from DataGrid data

        Brock wrote:
        In all due respect I am simply trying to understand the concepts for
        which I am granted a newbie at. Different individuals frequent
        different newsgroups and each has their own perspective on how to
        assit with problem solving.
        You are forgiven (just this once) for not knowing the difference between
        multi-posting and cross-posting.

        If you feel your question must be posted to more than one newsgroup, do so the
        same way you would send an email to two different people. Put the first
        newsgroup in the address, followed by a comma, followed by the second one.

        That way, when someone (such as sloan) replies in one newsgroup, readers in the
        other group can also see the reply. Otherwise, you just get chaos.

        I will reply to your question only briefly, since sloan may have already
        answered it. (See why cross-posting would be better?)

        If the datagrid can accept a dataset as its datasource, and a crystal report can
        as well, then you need only set one to the other. No copying of data is needed.
        You might need nothing more than

        MyCrystalReport .SetDataSource( MyDataGrid.Data Source)

        I don't actually use crystal reports, but a look through the documentation
        suggests that something along those lines would get it done.


        Comment

        Working...