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.
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.