private void FillTotalPrice(InDesign.Page page) { var totalPrice = currentProvidedServices.Sum(ps => ps.TotalPrice); var totalPriceContent = string.Format(PageStrings.MoneyDisplayDataFormat, totalPrice); ReportGenerationHelper.SetNewContentInTextFrame(page, 4, totalPriceContent); }
public void FillReport(Dictionary <string, object> paramsDict) { var startDate = (DateTime)paramsDict[StartDateParamKey]; var endDate = (DateTime)paramsDict[EndDateParamKey]; var doc = provider.GetReportDocument(reportsConfiguration.AppointmentsReportTemplatePath); InDesign.Page page = (InDesign.Page)doc.Pages[1]; InDesign.TextFrame dataFrame = (InDesign.TextFrame)page.TextFrames[4]; dataFrame.Contents = GetAppointments(startDate, endDate); InDesign.TextFrame dateRangeFrame = (InDesign.TextFrame)page.TextFrames[2]; dateRangeFrame.Contents = $"{startDate.ToShortDateString()} - {endDate.ToShortDateString()}"; doc.Export(reportsConfiguration.PdfType, string.Format(reportsConfiguration.AppointmentsPdfFilePathTemplate, startDate.ToShortDateString(), endDate.ToShortDateString())); }
/// <summary> /// Sets new content for the specified text frame. /// </summary> /// <param name="page">InDesign Page that contains the text frame.</param> /// <param name="textFrameNumber">Number of text frame.</param> /// <param name="content">String content to insert.</param> public static void SetNewContentInTextFrame(InDesign.Page page, int textFrameNumber, string content) { var textFrame = (InDesign.TextFrame)page.TextFrames[textFrameNumber]; textFrame.Contents = content; }
private void FillProvidedServiceList(InDesign.Page page) { var reportRows = ReportGenerationHelper.ConvertCollectionToContentView(currentProvidedServices); ReportGenerationHelper.SetNewContentInTextFrame(page, 6, reportRows); }
private void FillClientInfo(InDesign.Page page) { var clientNameContent = currentClient.Person; ReportGenerationHelper.SetNewContentInTextFrame(page, 8, clientNameContent); }
private void FillServiceDate(InDesign.Page page) { var serviceDateContent = string.Format(PageStrings.DateDisplayDataFormat, currentServiceDate); ReportGenerationHelper.SetNewContentInTextFrame(page, 3, serviceDateContent); }