• sometime ago
  • Topic: Sub report: setting RecordSource property - Our ComponentOne

    Sub report: setting RecordSource property

    • 1p
      newsgroup_archive1p 12 years ago

      Yes, this should be doable from C#, VB, or VBScript.

      "Frank de Badts" wrote in message
      news:3ef72c34$1@news.componentone.com...
      >
      > Hi,
      >
      > Is it possible to set the recordsource property (including a parameter for
      the SQL query) for a sub report?. E.g., from the main report I want to use
      something like:
      >
      > Subreport.DataSource.RecordSource = sql;
      > ---------
      > Can this be done from C# or VBScript?
      >
      > I also want to pass a parameter to the subreport, the SQL query should be
      different for each record that is displayed on the main report. Is this
      possible?
      >
      > Thanks in advance.

    • 1p
      newsgroup_archive1p 12 years ago

      Hi,

      Is it possible to set the recordsource property (including a parameter for the SQL query) for a sub report?. E.g., from the main report I want to use something like:

      Subreport.DataSource.RecordSource = sql;
      ---------
      Can this be done from C# or VBScript?

      I also want to pass a parameter to the subreport, the SQL query should be different for each record that is displayed on the main report. Is this possible?

      Thanks in advance.

    • 1p
      newsgroup_archive1p 12 years ago

      Bernardo,

      In Crystal, if I loaded a Dataset with two tables, I could simply assign
      that dataset to the report, and the report would figure out which was the
      master and which was the detail.

      I always use datasets as the source for reports, filling them
      programmatically. If I have a report with a subreport, how do I assign the
      datasources, and will the report understand the relationships (if there is
      one) or will I have to specify that in the dataset?

      "Bernardo de Castilho" wrote in message
      news:3ef7598d@news.componentone.com...
      > Yes, this should be doable from C#, VB, or VBScript.
      >
      >
      > "Frank de Badts" wrote in message
      > news:3ef72c34$1@news.componentone.com...
      > >
      > > Hi,
      > >
      > > Is it possible to set the recordsource property (including a parameter
      for
      > the SQL query) for a sub report?. E.g., from the main report I want to use
      > something like:
      > >
      > > Subreport.DataSource.RecordSource = sql;
      > > ---------
      > > Can this be done from C# or VBScript?
      > >
      > > I also want to pass a parameter to the subreport, the SQL query should
      be
      > different for each record that is displayed on the main report. Is this
      > possible?
      > >
      > > Thanks in advance.
      >
      >

    • 1p
      newsgroup_archive1p 12 years ago

      Hi Charles.

      In C1Report, the DataSet is logically equivalent to a connection string, and
      the DataTables in it are equivalent to sql statements (or sprocs or tables).

      In the latest versions of the control (starting with build 81), you can edit
      the report at design time and use data sources available on your project
      (including DataSets).

      To use subreports, you generally need two steps:

      1) Set the data source for the subreport. The process is exactly the same as
      setting the data source for the main report.

      2) Set up the relationship between the main and sub report (it's not done
      automatically). This is done using the Text property on the subreport field
      as described in the manual. But the designer makes it very easy. Just right
      click on a subreport field and select the "Link Subreport" menu option. This
      will bring up a dialog where you can pick the main field and the linked
      field.

      If you have any suggestions to make this process easier and more automatic,
      please let me know. Thanks in advance.

      "Charles Richardson" wrote in message
      news:3efbe77c@news.componentone.com...
      > Bernardo,
      >
      > In Crystal, if I loaded a Dataset with two tables, I could simply assign
      > that dataset to the report, and the report would figure out which was the
      > master and which was the detail.
      >
      > I always use datasets as the source for reports, filling them
      > programmatically. If I have a report with a subreport, how do I assign the
      > datasources, and will the report understand the relationships (if there is
      > one) or will I have to specify that in the dataset?
      >
      >
      > "Bernardo de Castilho" wrote in message
      > news:3ef7598d@news.componentone.com...
      > > Yes, this should be doable from C#, VB, or VBScript.
      > >
      > >
      > > "Frank de Badts" wrote in message
      > > news:3ef72c34$1@news.componentone.com...
      > > >
      > > > Hi,
      > > >
      > > > Is it possible to set the recordsource property (including a parameter
      > for
      > > the SQL query) for a sub report?. E.g., from the main report I want to
      use
      > > something like:
      > > >
      > > > Subreport.DataSource.RecordSource = sql;
      > > > ---------
      > > > Can this be done from C# or VBScript?
      > > >
      > > > I also want to pass a parameter to the subreport, the SQL query should
      > be
      > > different for each record that is displayed on the main report. Is this
      > > possible?
      > > >
      > > > Thanks in advance.
      > >
      > >
      >
      >

    Viewing 4 posts - 1 through 4 (of 4 total)

    You must be logged in to reply to this topic.