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

Retreiving data from web service

1 Answer 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 1
Ivan asked on 04 Jun 2012, 01:16 PM
I am creating a new report which gets it's data from a web service which looks like this:
private ReportDto GetEvaluationReports(Guid evaluationId)
{
  var dto = new ReportDto();
  var result = (from e in ... ).ToList();
 
  dto.Attributes = result;
  return dto;
}

The data provided from the report is fine and everything looks nice untill I have to use the result from the service

The DTO looks like this

public class ReportDto
{
   public List<Attribute> Attributes { get; set; }
}
 
public class Attribute
{
   public Guid Id { get; set; }
 
   public string AttributeText { get; set; }
 
   public IQueryable<EvaluationDefinition> DefinitionsQuery { get; set; }
 
   public List<EvaluationDefinition> Definitions
   {
      get { return DefinitionsQuery.ToList(); }
   }
}
 
public class EvaluationDefinition
{
   public Guid Id { get; set; }
 
   public string DefinitionText { get; set; }
 
   public IQueryable<EvaluationBookmark> BookmarksQuery { get; set; }
 
   public List<EvaluationBookmark> Bookmarks
   {
        get { return BookmarksQuery.ToList(); }
   }
}
 
public class EvaluationBookmark
{
}

I now want to have a report which groups by Attributes and has all it's definitions listed underneath them.

I have tried it with =Fields.AttributeText and =Fields.Attributes.AttributeText but had no luck.

Can you please help me
Edit: I am now taking another approach... Instead of generating one dto which hass all the information I generate one with the attribute-definition-bookmark hierarchy and another one which has the summary data also needed... Will post if this works

1 Answer, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 07 Jun 2012, 10:57 AM
Hi Ivan,

You cannot nest the Field calls (meaning "= Fields.Field.SubField.SubSubField..." is not a valid expression). In order to group by Attribute, list the definitions and show the other properties, you have to use an item that supports DataBinding. The most logical choice in your scenario would be to put a SubReport. If you do so, you can use Bindings to bind it's DataSource. The binding will look like this:
Property Path                                    Expression
ReportSource.DataSource          = ReportItem.DataObject.Attributes  

Then in the Report that will server as sub-report you will have the current Attribute as Data-Context and you can display the properties and list the definitions (with table for example).

All the best,
Elian
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Ivan
Top achievements
Rank 1
Answers by
Elian
Telerik team
Share this question
or