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

cross tab and data source

3 Answers 756 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
gal bar
Top achievements
Rank 1
gal bar asked on 03 Nov 2009, 07:07 PM
Hi,
I have just downloaded the trial version of the Telerik Reporting, and could use some help,
I would like to be located in a Silverlight application, and to be able to:
 present cross tab information, meanning that I want to feed it with a list of items of class "Item" (each item has a date, location and value ). and have summary rows both by days and by locations - meaning both by columns and by rows.

basically it should look pretty similar to your sales by period report in the example, but the only thing I'm missing there is the option to scroll in case there are too many columns, and to have a freeze column such that the scroll applies only on the details columns and non on the summary columns.

I could not understand how to bind the datasource to any list of items, should I do it pogramatically?

in addition, I tried to creat a silverlight application, and add the classLibrary project with a new report, and I got the message tha the report is not supported by the silverlight runtime...

I hope you would be able to assist me here,...
Thanks
Gal

3 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 06 Nov 2009, 05:19 PM
Hi gal bar,

Perhaps the easiest way to create a crosstab for your report is to use the Crosstab Wizard. Simply drag the Crosstab Wizard toolbox item to the report and the wizard will start automatically. There you can select your data source and adjust the initial layout of the crosstab. You can customize the generated layout later in the Report Designer to best suit your needs.

Data binding in design time is mostly useful when the data source is a typed DataSet with a DataAdapter because Report Designer can generate automatically the required code to fill the DataSet for you. It is possible to bind your crosstab in design time to a custom collection of business objects, but the collection must have a parameterless constructor which should be responsible for populating all data. Please refer to the following help topic from the online documentation for a list of all supported data source types. If you have other means to retrieve the data for your report, e.g. by calling a certain method from your business logic layer, you have no other choice but to data bind the crosstab programmatically yourself. This is a rather easy task to accomplish: you can either specify the data source in the report constructor as described in this help topic, or you can handle the NeedDataSource event of the Crosstab report item which is designated for this sole purpose. The proper way to handle the NeedDataSource event is described in the following help topic from the documentation.

To preview the report in the Silverlight Report Viewer you can use our Silverlight sample project as a base guideline. In case you do not know, the sample projects are located under the Examples folder within the main folder where you have installed Telerik Reporting. The most important thing to note here is that the report resides only on the server machine, while the Silverlight Report Viewer is on the client machine, so you do not have to reference the report library assembly from the client Silverlight project at all. To specify the appropriate report to the viewer use the assembly qualified type name of the report. The viewer is merely responsible to send a request to the server with the name of the report, then the server instantiates your report, processes and renders it in XPS format, and then sends the generated rendering output to the Silverlight client. At the present moment the Telerik.Reporting assembly is compiled only against the regular .NET framework, which basically limits its usage only on the server side of the application, although we have future plans to provide a lightweight version that can be used directly from the Silverlight client.

Regarding the feature about freezing certain rows and columns of the crosstab: if you expect this to work the same way MS Excel does it, I am afraid this feature is not currently supported by the Report Viewer. You see the sole purpose of the Report Viewer is to provide a page oriented WYSIWYG print preview of the report, similar to the Print Preview mode of other applications such as MS Word and MS Excel. You can set the ColumnHeadersPrintOnEveryPage and RowHeadersPrintOnEveryPage properties of the Crosstab report item to true in order to make the column headers and row headers appear on every page, but this is still static. If you need a more dynamic interactive preview of your data, perhaps our Rad Grid control might be a better option for you in this specific scenario.

Best wishes,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mike Lyncheski
Top achievements
Rank 1
answered on 29 Dec 2009, 05:12 PM
Just to be clear, you need to set the DataSource on the Crosstab control not the DataSource on the report itself.  The previous posting implied otherwise.

 

        public TaskMatrixReport()  
        {  
            InitializeComponent();  
 
            crosstab1.NeedDataSource += new EventHandler(crosstab1_NeedDataSource);  
        }  
 
 
        private void crosstab1_NeedDataSource(object sender, EventArgs e)  
        {  
            Telerik.Reporting.Processing.Table table = (Telerik.Reporting.Processing.Table)sender;  
 
            table.DataSource = GetTaskDataSet();  
            table.DataMember = "Tasks";  
        } 

Regards,
Mike
0
Stefen
Top achievements
Rank 1
answered on 03 Jun 2011, 10:38 PM
I am looking for information on programatically binding to a CrossTab. This link is expired. Does this article still exist somewhere ?
Tags
General Discussions
Asked by
gal bar
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Mike Lyncheski
Top achievements
Rank 1
Stefen
Top achievements
Rank 1
Share this question
or