Jump to content

jwarz

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by jwarz

  1. that did the trick!!! Thank you so much you are a life saver! 😃❤️
  2. sure not a problem! below is the rule for the Table: var DataSource = "Multi-line records"; // "Data Source:" (Required): DataSourceList var Columns = // "Column": MultiGroup with fields: [ { "Field": "name", "Heading": "Biomarker", "Width": HundredthsOfPointsFromText("2 in"), "HAlign": "Left", "VAlign": "Middle", "Format": { }, }, { "Field": "observation", "Heading": "Result", "Width": HundredthsOfPointsFromText("1 in"), "HAlign": "Left", "VAlign": "Middle", "Format": { }, }, { "Field": "interpretation", "Heading": "Finding", "Width": HundredthsOfPointsFromText("1.5 in"), "HAlign": "Left", "VAlign": "Middle", "Format": { }, }, ]; var Style = "Biomarker Results Table Format"; var StretchColumnsToFrameWidth = true; var table = new FPTable; if (Style) table = Rule(Style); for (var i in Columns) table.AddColumn(Columns[i].Width); var header = table.AddRow(); header.Type = "header"; for (var c in Columns) { var column = Columns[c]; var cell = header.Cells[c]; cell.Content = TaggedTextFromRaw(column.Heading || column.Field); cell.HAlign = column.HAlign; cell.VAlign = column.VAlign; if (table.style && table.style.headerStyle) { var HeaderStyle = table.style.headerStyle; cell.Font = HeaderStyle.family; cell.Bold = HeaderStyle.bold; cell.Italics = HeaderStyle.italic; cell.PointSize = HeaderStyle.pointsize; cell.TextColor = HeaderStyle.color; } if (table.style && table.style.each_cell.Rulings) cell.Rulings = table.style.each_cell.Rulings; if (table.style && table.style.each_cell.Margins) cell.Margins = table.style.each_cell.Margins; } // Create the main body from the data. var data; if (DataSource == "Multi-line records") data = FusionPro.GetMultiLineRecords(); else data = FusionPro.GetDataSource(DataSource); for (var r = 1; r <= data.recordCount; r++) { var row = table.AddRow(); for (var c in Columns) { var column = Columns[c]; var cell = row.Cells[c]; cell.Content = FormatGenericTagged(column.Format, data.GetFieldValue(r, column.Field)); cell.HAlign = column.HAlign; cell.VAlign = column.VAlign; if (table.style && table.style.bodyStyle) { var BodyStyle = table.style.bodyStyle; cell.Font = BodyStyle.family; cell.Bold = BodyStyle.bold; cell.Italics = BodyStyle.italic; cell.PointSize = BodyStyle.pointsize; cell.TextColor = BodyStyle.color; } if (table.style && table.style.each_cell.Rulings) cell.Rulings = table.style.each_cell.Rulings; if (table.style && table.style.each_cell.Margins) cell.Margins = table.style.each_cell.Margins; } } if (StretchColumnsToFrameWidth) table.StretchColumnsToFrameWidth(); return table; and we also have a Table Format Rule:
  3. Your are a life saver. So it is validating correctly on the multi line record rule, but its still displaying blanks in the table?
  4. Hello, We are very new the MultiLine record thing and were having through getting our data to display "N/A" if one of the cells are blank within the table. var result = ""; var data = FusionPro.GetMultiLineRecords(); for (var r = 1; r <= data.recordCount; r++) result += data.GetFieldValue(r, "name") + " " + data.GetFieldValue(r, "observation") + " " + data.GetFieldValue(r, "interpretation") + "\n"; return result; I have another rule that says... if (Field("observation") == "") { return "N/A"; } else { return Field("observation"); } So I was thinking maybe we could tell the data.GetFieldValue(r, "observation") to somehow read a rule rather than field. But then I also got the idea of putting something in the table format that if it finds a blank, return N/A, but again I couldn't seem to figure that one out either. Either way would be fine, as long as we can get any cell in the table thats blank to display N/A??
×
×
  • Create New...