or
[DataObject]class DailyInvoicing{ [DataObjectMethod(DataObjectMethodType.Select)] public IList<DailyInvoice> GetDailyInvoices(DateTime dateEntered) { // Build data set here }}An error has occurred while processing Report 'DailyInvoicingReport': An error occurred while invoking data retrieval method. Try restarting Visual Studio. ------------- InnerException ------------- Exception has been thrown by the target of an invocation. ------------- InnerException ------------- Could not load file or assembly 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.An error has occurred while processing Report 'DailyInvoicingReport': An error occurred while invoking data retrieval method. ------------- InnerException ------------- Exception has been thrown by the target of an invocation. ------------- InnerException ------------- Unable to load the specified metadata resource.[HttpPost][Route("api/supportingreports/email/{reportName}")]public bool SendReportViaEmail(string reportName){ // TODO verify user access to report try { var reportProcessor = new ReportProcessor(); var report = new Report {DocumentName = HttpContext.Current.Server.MapPath(string.Format("{0}{1}.trdx", FileUtility.ReportPath, reportName))}; var instanceReportSource = new InstanceReportSource {ReportDocument = report}; instanceReportSource.Parameters.Add(new Parameter("userId", 3)); instanceReportSource.Parameters.Add(new Parameter("eventId", 0)); instanceReportSource.Parameters.Add(new Parameter("exceptionId", 14)); instanceReportSource.Parameters.Add(new Parameter("employeeId", 3860)); var result = reportProcessor.RenderReport("PDF", instanceReportSource, new Hashtable()); var fileName = report.Name + "." + result.Extension; var path = Path.GetTempPath(); var filePath = Path.Combine(path, fileName); var mailMessage = new MailMessage {From = new MailAddress(ConfigurationManager.AppSettings["fromAddress"])}; using (var fs = new FileStream(filePath, FileMode.Create)) { fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length); fs.Seek(0, SeekOrigin.Begin); var a = new Attachment(fs, report.Name + "." + result.Extension); mailMessage.Attachments.Add(a); mailMessage.To.Add(new MailAddress("cbohatka@aztekweb.com")); mailMessage.Subject = "TEST"; var smtpClient = new SmtpClient(); smtpClient.Send(mailMessage); } } catch (Exception ex) { Debug.WriteLine(ex.Message); throw; } return true; // dummy return}