This is a migrated thread and some comments may be shown as answers.

Q1-2009 Table control Questions

2 Answers 259 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
KenF
Top achievements
Rank 1
KenF asked on 31 Mar 2009, 06:54 PM
I have an existing web report that I want to convert to use the table control in order to get better column alignments and to fix some exporting issues.  I've looked at the new demos, which all look to use the crosstab control, and not the table.  My current report binds the datasource to the report of the reportviewer in an aspx page by using something like:

_report = ReportViewer1.Report

_report.DataSource = ds.Tables(0).DefaultView

The current report also uses groups to group hierarchial data.  I would like to either convert this report, or create a newer report class for the above mentioned reasons.  So I have some questions about the table control.
1) Initially, it looks like I have to bind a datasource to the table and not to the report anymore.  Is that true and if so, how do I programmatically bind the datasource defined in my aspx page to the table in the report of the reportviewer?

2) Some column headings from the original report span multiple columns of the detail section.  I would assume to get the same effect with the table control I could merge columns.  However, I was unable to figure out how to merge adjacent cells in either the table header or detail.  How is that accomplished?

3) When I added a row grouping to group by a field in my datasource, the designer appeared to bunch the grouping into a single column that spanned a couple of rows.  I just have 2 layers of simple grouping I need to perform for the report, and I would expect for the group row to span the length of the table, but it doesn't.  What is the proper way to add row groupings to the table control?

4)  My current report has aggregate sums and calculations in the group headers of the different groupings.  How do I associate those cells with the same grouping scope?

5)  It appears that the demos use the crosstab and not the table control.  I understand they are similar, but the crosstab has sections that I don't feel I need for this type of report.  Is there an example of a table report that uses groupings that I could download and learn from?

An example layout of the report I am working is similar to this:
Segment 1  total1   total2  total3  total4
  Division 1  total1   total2  total3  total4
      Plant 1  data1  data2  data3  data4
      Plant 2  data1  data2  data3  data4
  Division 2  total1  total2  total3  total4
      Plant 2  data1  data2  data3  data4
      Plant 2  data1  data2  data3  data4
Any answers, help, or examples would be most appreciated.
-kenf-

2 Answers, 1 is accepted

Sort by
0
KenF
Top achievements
Rank 1
answered on 02 Apr 2009, 11:51 AM
Does anyone know???
-kenf-
0
Steve
Telerik team
answered on 03 Apr 2009, 02:45 PM
Hello KenF,

Actually there are three reports from our demos that use the Table item - Product Catalog, Product Line Sales and Barcodes. You can open them up from the Visual Studio examples and see how they're setup. Also starting from the Q1 release, the ReportViewer.Report property is now of type Telerik.Reporting.IReportDocument and getting the report object directly from ReportViewer.Report would not work as until now. Please review this KB article for more information.  Up to your questions:
  1. This is not exactly true. Indeed the table has its own datasource property, but if you're going to use it for table-like layout only and not for showing different data, you can have the same datasource for both report and table report item. For more info check the Product Catalog and ProductLine Sales examples referenced above. Setting the DataSource programmatically from the calling application is the same as you would do that for a subreport item - simply use the report hierarchy to locate the item and you would have access to its properties.
  2. We are still missing this functionality and it will be available in the upcoming service pack due in a couple of weeks. Please have in mind the Table item is pretty new and we need some more time to polish it. Anyway you can still merge the Table's cells - if this is a cell that belongs to any of the group hierarchies - RowGroups or ColumnGroups you have to re-arrange the groups in an appropriate way. If this is a cell in the Table's Body or Corner you may use the SetCellContent method overload with the 5 arguments:
    SetCellContent(Int32,Int32,ReportItem,Int32,Int32) Method that allows you to specify the number of rows and columns this cell spans. For a demonstration of this method please see the code of the Product Sales Per Period sample report.
For points #3 and #4, we are not really sure what you mean
For #5 - as stated above there are three reports from our demos that use the Table item - Product Catalog, Product Line Sales and Barcodes. Depending on your scenario you can create a table, a crosstab or even simple repeater (using the list item). Please take a look at our documentation on the matter:

Due to #3 and #4 and in general it would be great if you can send us your current report with some sample data and explain or better yet show us a picture/schematic of how you would like it to look. We would then be able to provide you with more to the point advices.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
KenF
Top achievements
Rank 1
Answers by
KenF
Top achievements
Rank 1
Steve
Telerik team
Share this question
or