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

Summary problems

1 Answer 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 29 Jul 2011, 10:26 AM
Hi.

Im making an invoice report and i want a summary of all projects on that invoice at the beginning of the repport ordered by project name.
You could call it a summary list of all projects. I only get the data from the latest project, not all of them. I tried with a table, list and cross table but i dont get out any data.

Underneath i got a group section with all projects, articles and workdates and this works perfectly.

Here is the code i use to set the datasource:

     var invoice = InvoiceRepository.GetInvoiceById(226);


            var query = from w in invoice.WorkHours
                        select new
                                   {
                                       Hours = w.BillableHours ?? w.Hours,
                                       Period = string.Format("{0:yyyy-MM-dd} - {1:yyyy-MM-dd}", w.Invoice.StartDate, w.Invoice.EndDate),
                                       WorkDate = w.WorkSpecification.WorkDate,
                                       Consultant = w.WorkSpecification.User.FirstName + " " + w.WorkSpecification.User.LastName,
                                       ClientName = w.WorkSpecification.Project.Client.ClientNameLegal,
                                       CompanyName = w.WorkSpecification.User.Company.CompanyName,
                                       ArticleName = w.Article.ArticleName,
                                       ProjectName = w.WorkSpecification.Project.ProjectName,
                                       InvoiceTag = w.Invoice.InvoiceTag,
                                       InvoiceUrl = w.Invoice.InvoiceURL,
                                       InvoiceNo = w.Invoice.InvoiceNo,
                                       PricePerHour = w.Article.Prices.Single(p => p.StartDate <= w.WorkSpecification.WorkDate && (p.EndDate ?? DateTime.MaxValue) >= w.WorkSpecification.WorkDate).PricePerHour,
                                       YourReference = w.WorkSpecification.Project.ClientContactName,
                                       ContryZipAndCity = string.Format("{0}-{1} {2}", w.WorkSpecification.User.Company.CountryCode, "", ""),
                                       OurReference = "",
                                       CompanyAdress = "1",
                                   };


            return query.ToList();

Please help me. Ive been working on this for 3 days and im quite a good developer but this thing just breaks me.

Best regards Stefan Ã…berg.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 03 Aug 2011, 05:48 PM
Hi Stefan,

If you have a data bound the report you can easily get a summary with a Table/Crosstab located in the report header section with a binding to the DataSource property with =ReportItem.DataObject expression. Still we are not sure about the desired layout and If you still experience difficulties we will appreciate if you elaborate further on the report layout and the required summary.

Regards,
Peter
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

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