I want to create a Calendar report wich shows the teacher names and Class time and the student who in that class as shown in the attached file which is a mockup of what I tend to have.
Thank you
8 Answers, 1 is accepted
You can create a time sheet reports with our Crosstab item. Just follow the steps:
- Set up a Column Group for the Teachers and a Row Group for the time.
- To display the subjects you have to nest them in a Crosstab cell Panel - List - Textbox
- Set the List.DataSource with Bindings to the =ReportItem.DataObject expression
I have attached a sample report to illustrate the above approach.
Regards,
Peter
the Telerik team
Thank you for the reply it seems it should do what I expected, but the problem is when i bound the datasource of list to =ReportItem.DataObject I get an error which is "Index was outside the bounds of the array."
Is there any way to fix this problem?
Regards,
Amir
Where is the List item placed i.e. what is its parent? The ReportItem keyword is evaluated at runtime to the Data Item in which context the data source is used i.e. in our case Table item. The DataObject keyword specifies the data context in which the current data item is executed (which is what we need to know).
Greetings,
Steve
the Telerik team
Thank you for the reply. I have attached 2 snapshot which shows my current situation.
As it is shown in first picture I created a crosstab and grouped the column by Teacher ID(TID) and the row by SessionTime(StartTime) then I add an event (needDataSource) which can be seen in second picture.
I also added a list in the gray cell of cross tab(as you suggested in previous posts) and add another textbox which should show the student's name (can be up to 5 student per session).
First I added the ReportItem.DataObject from the properties section and i got "Index was outside the bounds of the array." I add it at the end of my NeedDataSource Event and i still get the same error
As you see in snapshot 2 I also add a Parent to the ReportItem.DataObject but it didn't change anything
Please let me know if you need more detail.
Thank you in advance for your kind help
Amir
We have noticed in the provided code snippet that you had used the Report Parameter definition item instead of the processing counterpart. The definition report parameter value is actually the default value. The sender of the event is always the processing counterpart of the data item and you can use it to access the processing report parameter. For more information check out the Using Report Parameters programmatically. Additionally in the report's ItemDataBinding you cast the sender to Telerik.Reporting.Processing.Table but the sender of the event is always the processing counterpart of the data item in this case Telerik.Reporting.Processing.Report. If you need only Telerik.Reporting.Processing.Table you should handle table.ItemDataBinding.
Still based on the provided code we don't find any reason to use events for providing datasource to the report. Instead our suggestion is to utilize our Data Source Components. If your reports display data from a database, we suggest using the SqlDataSource component that is designed to work especially with Telerik's reporting engine moreover the datasource components offer design time support for parameters. For more information and example check out the Using Stored Procedures in Telerik Reporting with the SqlDataSource Component video.
Peter
the Telerik team
Thank you for the fast reply
I have changed the whole report and used the standard way as shown in attached snapshots(2 and 3). and the result looks like snapshot 1 shows the result which is not what I am after
Questions:
1- is there anyway to create a report like i explained in my first Post (basically a day including some sessions and each sessions has some students in it )
2- if the answer of first question is yes, how can I show only students related to that specific session(which is grouped by teacher and startTime) in the list ? I already used the filter as follow
=ReportItem.Parent.DataObject .TID = =Fields.TID
AND =ReportItem.Parent.DataObject .StartTime = =Fields.StartTime
but it does not work
Thank you again
Amir
Your scenario is possible as I have shown in the attached sample in my first post. Have you placed a Panel item in the cell and nest the List item in it? The Panel item is required to evaluate correctly the ReportItem at runtime to the Data Item in which context the data source is used i.e. in our case Crosstab item. Please check out the sample I have attached in my first post and elaborate if you experience any troubles with it.
Additionally we will appreciate if you elaborate on the version of Telerik Reporting you use.
Peter
the Telerik team
As soon as I added Panel item in the cell and nest the List item in it, the problem is solved.
Thank you very much for your kind help and good support.
Amir