dim ribset, ledLoc if Report.Sheets.Exists("Error Codes and Max D #1") then Report.Sheets("Error Codes and Max D #1").Name = "Error Codes and Max D" end if for i = Report.Sheets.Count to 1 step -1 if Report.Sheets(i).Name <> "Error Codes and Max D" then if inStr(1, Report.Sheets(i).Name, "Error") > 0 then call Report.Sheets.Remove(i) end if end if next for i = Data.Root.ChannelGroups.Count to 1 step -1 if inStr(1, Data.Root.ChannelGroups(i).Name, "Error") > 0 then call Data.Root.ChannelGroups.Remove(i) end if next if Data.Root.ChannelGroups.Exists("Error Codes") then call Data.Root.ChannelGroups.Remove("Error Codes") end if if Data.Root.ChannelGroups.Exists("Max Values") then call Data.Root.ChannelGroups.Remove("Max Values") end if 'gather data for error codes table set errors = Data.Root.ChannelGroups.Add("Error Codes") set rib = errors.Channels.Add("Rib",DataTypeChnString) set led = errors.Channels.Add("LED",DataTypeChnString) set code = errors.Channels.Add("Error Code",DataTypeChnString) set startTime = errors.Channels.Add("Start Time (ms)",DataTypeChnString) set endTime = errors.Channels.Add("End Time (ms)",DataTypeChnString) set maxChange = errors.Channels.Add("Maximum Length Change (mm)",DataTypeChnString) set timeMax = errors.Channels.Add("Time of Maximum Length Change (ms)",DataTypeChnString) x = 0 'check = false count = 0 for each grp in Data.Root.ChannelGroups if inStr(1, lCase(grp.Name), "abs") > 0 then for each chn in grp.Channels Call ChnCharacterAll() if right(chn.Name, 2) = "LB" then whole = false for i = 1 to chn.Size if chn.Values(i) = int(chn.Values(i)) then whole = true end if next if whole = true then tolerance = 1E-10 timeStart = -1 timeEnd = -1 lastValue = Null ' Loop through the dataset For i = 1 To chn.Size currentValue = chn.Values(i) isWhole = Abs(currentValue - Int(currentValue)) < tolerance ' Check if current value is a whole number If isWhole Then ' Start a new sequence if necessary If lastValue <> currentValue Or timeStart = -1 Then If timeStart <> -1 and lastValue <> 0 Then x = x + 1 call ribtype(chn.Name) rib.Values(x) = ribset led.Values(x) = ledLoc code.Values(x) = lastValue startTime.Values(x) = formatNumber(round(timeStart, 1), 1) endTime.Values(x) = formatNumber(round(timeEnd, 1), 1) ' if startTime.Values(x) = endTime.Values(x) then ' code.Values(x) = code.Values(x) & "*" ' check = true ' end if if lastValue = chn.Maximum then maxChange.Values(x) = int(chn.Maximum) else maxChange.Values(x) = replace(formatNumber(round(chn.Maximum, 1), 1), ".0", "") end if if maxChange.Values(x) = code.Values(x) then timeMax.Values(x) = "N/A" else timeMax.Values(x) = formatNumber(round(Data.Root.ChannelGroups(1).Channels(1).Values(PNo(chn.Name, chn.Maximum)), 1), 1) end if End If timeStart = Data.Root.ChannelGroups(1).Channels(1).Values(i) ' Start new sequence End If timeEnd = Data.Root.ChannelGroups(1).Channels(1).Values(i) ' Update end time Else ' End the sequence if transitioning to a non-whole number If timeStart <> -1 Then x = x + 1 call ribtype(chn.Name) rib.Values(x) = ribset led.Values(x) = ledLoc code.Values(x) = lastValue startTime.Values(x) = formatNumber(round(timeStart, 1), 1) endTime.Values(x) = formatNumber(round(timeEnd, 1), 1) ' if startTime.Values(x) = endTime.Values(x) then ' code.Values(x) = code.Values(x) & "*" ' check = true ' end if if lastValue = chn.Maximum then maxChange.Values(x) = int(chn.Maximum) else maxChange.Values(x) = replace(formatNumber(round(chn.Maximum, 1), 1), ".0", "") end if if maxChange.Values(x) = code.Values(x) then timeMax.Values(x) = "N/A" else timeMax.Values(x) = formatNumber(round(Data.Root.ChannelGroups(1).Channels(1).Values(PNo(chn.Name, chn.Maximum)), 1), 1) end if timeStart = -1 ' Reset for the next sequence End If End If ' Update the last value lastValue = currentValue Next else x = x + 1 call ribtype(chn.Name) rib.Values(x) = ribset led.Values(x) = ledLoc code.Values(x) = "None" startTime.Values(x) = "N/A" endTime.Values(x) = "N/A" Call ChnCharacterAll() maxChange.Values(x) = replace(formatNumber(round(chn.Maximum, 1), 1), ".0", "") timeMax.Values(x) = formatNumber(round(Data.Root.ChannelGroups(1).Channels(1).Values(PNo(chn.Name, chn.Maximum)), 1), 1) end if end if next end if next 'gather data for max rib group values set max = Data.Root.ChannelGroups.Add("Max Values") set shoulder = max.Channels.Add("Shoulder",DataTypeChnString) set thorax = max.Channels.Add("Thorax",DataTypeChnString) set abdomen = max.Channels.Add("Abdomen",DataTypeChnString) x = 0 y = 0 z = 0 for i = 1 to rib.Size if inStr(1, rib.Values(i), "Shoulder") > 0 then if cDbl(maxChange.Values(i)) > x then x = cDbl(maxChange.Values(i)) shoulder.Values(1) = rib.Values(i) & " " & led.Values(i) & " LED" shoulder.Values(2) = formatNumber(cDbl(maxChange.Values(i)), 1) & " mm" end if elseif inStr(1, rib.Values(i), "Thorax") > 0 then if cDbl(maxChange.Values(i)) > y then y = cDbl(maxChange.Values(i)) thorax.Values(1) = rib.Values(i) & " " & led.Values(i) & " LED" thorax.Values(2) = formatNumber(cDbl(maxChange.Values(i)), 1) & " mm" end if elseif inStr(1, rib.Values(i), "Abdomen") > 0 then if cDbl(maxChange.Values(i)) > z then z = cDbl(maxChange.Values(i)) abdomen.Values(1) = rib.Values(i) & " " & led.Values(i) & " LED" abdomen.Values(2) = formatNumber(cDbl(maxChange.Values(i)), 1) & " mm" end if end if next count = rib.Size if count > 50 then Data.Root.ChannelGroups("Error Codes").Name = "Error Codes 1" Call ChnClpCopy("'Error Codes 1/Rib' - 'Error Codes 1/Time of Maximum Length Change (ms)'", False) Call GroupClpCopy(Array("Error Codes 1"), False) Call GroupClpPaste(6, False) Data.Root.ChannelGroups(7).Name = "Error Codes 2" Call DataBlDel("'Error Codes 1/Rib' - 'Error Codes 1/Time of Maximum Length Change (ms)'", 51, count, True) Call DataBlDel("'Error Codes 2/Rib' - 'Error Codes 2/Time of Maximum Length Change (ms)'", 1, 50, True) Report.Sheets("Error Codes and Max D").Name = "Error Codes and Max D #1" Call Report.Sheets.Copy("Error Codes and Max D #1", "Error Codes and Max D #2", Report.Sheets("Error Codes and Max D #1").Index + 1) end if if count > 100 then Call ChnClpCopy("'Error Codes 2/Rib' - 'Error Codes 2/Time of Maximum Length Change (ms)'", False) Call GroupClpCopy(Array("Error Codes 2"), False) Call GroupClpPaste(7, False) Data.Root.ChannelGroups(8).Name = "Error Codes 3" Call DataBlDel("'Error Codes 2/Rib' - 'Error Codes 2/Time of Maximum Length Change (ms)'", 51, count, True) Call DataBlDel("'Error Codes 3/Rib' - 'Error Codes 3/Time of Maximum Length Change (ms)'", 1, 50, True) Call Report.Sheets.Copy("Error Codes and Max D #2", "Error Codes and Max D #3", Report.Sheets("Error Codes and Max D #2").Index + 1) end if if count > 150 then Call ChnClpCopy("'Error Codes 3/Rib' - 'Error Codes 3/Time of Maximum Length Change (ms)'", False) Call GroupClpCopy(Array("Error Codes 3"), False) Call GroupClpPaste(8, False) Data.Root.ChannelGroups(9).Name = "Error Codes 4" Call DataBlDel("'Error Codes 3/Rib' - 'Error Codes 3/Time of Maximum Length Change (ms)'", 51, count, True) Call DataBlDel("'Error Codes 4/Rib' - 'Error Codes 4/Time of Maximum Length Change (ms)'", 1, 50, True) Call Report.Sheets.Copy("Error Codes and Max D #3", "Error Codes and Max D #4", Report.Sheets("Error Codes and Max D #3").Index + 1) end if if count > 200 then Call ChnClpCopy("'Error Codes 4/Rib' - 'Error Codes 4/Time of Maximum Length Change (ms)'", False) Call GroupClpCopy(Array("Error Codes 4"), False) Call GroupClpPaste(9, False) Data.Root.ChannelGroups(10).Name = "Error Codes 5" Call DataBlDel("'Error Codes 4/Rib' - 'Error Codes 4/Time of Maximum Length Change (ms)'", 51, count, True) Call DataBlDel("'Error Codes 5/Rib' - 'Error Codes 5/Time of Maximum Length Change (ms)'", 1, 50, True) Call Report.Sheets.Copy("Error Codes and Max D #4", "Error Codes and Max D #5", Report.Sheets("Error Codes and Max D #4").Index + 1) end if Call ChnCharacterAll() x = 0 for each grp in Data.Root.ChannelGroups if inStr(1, grp.Name, "Error") > 0 then x = x + 1 end if next Call ChnCharacterAll() if count <= 50 then for each table in Report.Sheets("Error Codes and Max D").Objects if inStr(1, table.Name, "Table") > 0 then Report.Sheets("Error Codes and Max D").Objects.Remove(table.Name) end if next 'If FileDlgShow(DataReadPath, "Report Template,*.tdr", "Data selection", false) = "IDOk" then ' Call Report.LoadLayout("M:\PROJECT\RIBEYE WORLDSID 50th\Crash test data\Ribeye data with 7.1 version software\For Scott\RibEye Crash Test Report Template HR.TDR") Report.Refresh() 'End If 'create the data table Set table1 = Report.Sheets("Error Codes and Max D").Objects.Add(eReportObject2DTable,"Table1") Set position = table1.Position.ByBorder position.Top = 10 'if check = true then ' position.Bottom = 37 'else position.Bottom = 36 'end if position.Left = 5 position.Right = 5 table1.Settings.IndexSettings.IndexEnd = rib.Size table1.Settings.GridHorizontal.Visible = True table1.Settings.Header.Font.Name = "Times New Roman" table1.Settings.Header.Font.Bold = True table1.Settings.Header.Font.Size = 2 table1.Settings.Header.Height = 15 table1.Settings.Header.UseTextClipping = True table1.Settings.Header.UseWordWrap = True table1.Settings.Header.BackgroundColor.SetRGBColor(RGB(214,214,214)) table1.Settings.UseXDoubleLine = False table1.Settings.UseYDoubleLine = False table1.Settings.UseAutoFontSize = False Set column1 = table1.Columns.Add(e2DTableColumnChannel) column1.Channel.Reference = "Error Codes/Rib" column1.Settings.Font.Name = "Times New Roman" column1.Settings.Font.Size = 2 Set column2 = table1.Columns.Add(e2DTableColumnChannel) column2.Channel.Reference = "Error Codes/LED" column2.Settings.Font.Name = "Times New Roman" column2.Settings.Font.Size = 2 Set column3 = table1.Columns.Add(e2DTableColumnChannel) column3.Channel.Reference = "Error Codes/Error Code" column3.Settings.Font.Name = "Times New Roman" column3.Settings.Font.Size = 2 Set column4 = table1.Columns.Add(e2DTableColumnChannel) column4.Channel.Reference = "Error Codes/Start Time (ms)" column4.Settings.Font.Name = "Times New Roman" column4.Settings.Font.Size = 2 Set column5 = table1.Columns.Add(e2DTableColumnChannel) column5.Channel.Reference = "Error Codes/End Time (ms)" column5.Settings.Font.Name = "Times New Roman" column5.Settings.Font.Size = 2 Set column6 = table1.Columns.Add(e2DTableColumnChannel) column6.Channel.Reference = "Error Codes/Maximum Length Change (mm)" column6.Settings.Font.Name = "Times New Roman" column6.Settings.Font.Size = 2 Set column7 = table1.Columns.Add(e2DTableColumnChannel) column7.Channel.Reference = "Error Codes/Time of Maximum Length Change (ms)" column7.Settings.Font.Name = "Times New Roman" column7.Settings.Font.Size = 2 ''create the sample text block if error code is a single sample 'if check = true then ' Set sample = Report.Sheets("Error Codes and Max D").Objects.Add(eReportObjectText, "sampleText") ' sample.Font.Name = "Times New Roman" ' sample.Font.Size = 2 ' sample.PositionXY.RelativePosition = eRelativePositionRightBottom ' sample.Text = "* error occurred in a single sample" ' sample.PositionXY.X = 5 ' sample.PositionXY.Y = 36 'end if 'create the max values table Set table2 = Report.Sheets("Error Codes and Max D").Objects.Add(eReportObject2DTable,"Table2") Set position = table2.Position.ByBorder position.Top = 68 position.Bottom = 5 position.Left = 5 position.Right = 52 table2.Settings.IndexSettings.IndexEnd = 2 table2.Settings.GridHorizontal.Visible = True table2.Settings.Orientation = eTableOrientationHorizontal table2.Settings.Header.Visible = True table2.Settings.Header.Font.Name = "Times New Roman" table2.Settings.Header.Font.Bold = True table2.Settings.Header.Font.Size = 2 table2.Settings.Header.Height = 40 table2.Settings.Header.UseTextClipping = False table2.Settings.Header.UseWordWrap = False table2.Settings.Header.BackgroundColor.SetRGBColor(RGB(214,214,214)) table2.Settings.UseXDoubleLine = False table2.Settings.UseYDoubleLine = False table2.Settings.UseAutoFontSize = False Set column1 = table2.Columns.Add(e2DTableColumnChannel) column1.Settings.UseWordWrap = True column1.Settings.UseTextClipping = True column1.Settings.Header.IndividualTitle.Enable = True column1.Settings.Header.IndividualTitle.Title1 = "Maximum" column1.Settings.Header.IndividualTitle.Title2 = "Shoulder" column1.Settings.Header.IndividualTitle.Title3 = "Length Change" column1.Channel.Reference = "Max Values/Shoulder" column1.Settings.Font.Name = "Times New Roman" column1.Settings.Font.Size = 2 column1.Settings.Format = "d.d" Set column2 = table2.Columns.Add(e2DTableColumnChannel) column2.Settings.UseWordWrap = True column2.Settings.UseTextClipping = True column2.Settings.Header.IndividualTitle.Enable = True column2.Settings.Header.IndividualTitle.Title1 = "Maximum" column2.Settings.Header.IndividualTitle.Title2 = "Thorax" column2.Settings.Header.IndividualTitle.Title3 = "Length Change" column2.Channel.Reference = "Max Values/Thorax" column2.Settings.Font.Name = "Times New Roman" column2.Settings.Font.Size = 2 column2.Settings.Format = "d.d" Set column3 = table2.Columns.Add(e2DTableColumnChannel) column3.Settings.UseWordWrap = True column3.Settings.UseTextClipping = True column3.Settings.Header.IndividualTitle.Enable = True column3.Settings.Header.IndividualTitle.Title1 = "Maximum" column3.Settings.Header.IndividualTitle.Title2 = "Abdomen" column3.Settings.Header.IndividualTitle.Title3 = "Length Change" column3.Channel.Reference = "Max Values/Abdomen" column3.Settings.Font.Name = "Times New Roman" column3.Settings.Font.Size = 2 column3.Settings.Format = "d.d" 'create the error code descriptions table Set table3 = Report.Sheets("Error Codes and Max D").Objects.Add(eReportObject2DTable,"Table3") Set position = table3.Position.ByBorder position.Top = 68 position.Bottom = 5 position.Left = 52 position.Right = 5 table3.Settings.IndexSettings.IndexEnd = 9 table3.Settings.GridHorizontal.Visible = True table3.Settings.Header.Font.Name = "Times New Roman" table3.Settings.Header.Font.Bold = True table3.Settings.Header.Font.Size = 2 table3.Settings.Header.Height = 13 table3.Settings.Header.UseTextClipping = True table3.Settings.Header.UseWordWrap = True table3.Settings.Header.BackgroundColor.SetRGBColor(RGB(214,214,214)) table3.Settings.UseXDoubleLine = False table3.Settings.UseYDoubleLine = False table3.Settings.UseAutoFontSize = False Set column1 = table3.Columns.Add(e2DTableColumnText) column1.Settings.RelativeColumnWidth = 0.3 column1.Settings.Header.IndividualTitle.Title1 = "Error Code" column1.Settings.Font.Name = "Times New Roman" column1.Settings.Font.Size = 2 column1.TextList.Count = 9 for i = 1 to column1.TextList.Count column1.TextList(i).Text = i next Set column2 = table3.Columns.Add(e2DTableColumnText) column2.Settings.Header.IndividualTitle.Title1 = "Error Code Description" column2.Settings.Font.Name = "Times New Roman" column2.Settings.Font.Size = 2 column2.TextList.Count = 9 column2.TextList(1).Text = "Top Sensor Blocked" column2.TextList(2).Text = "Bottom Sensor Blocked" column2.TextList(3).Text = "Top and Bottom Sensor Blocked" column2.TextList(4).Text = "Middle Sensor Blocked" column2.TextList(5).Text = "Middle and Top Sensor Blocked" column2.TextList(6).Text = "Middle and Bottom Sensor Blocked" column2.TextList(7).Text = "All Three Sensors Blocked" column2.TextList(8).Text = "Divide-By-Zero Condition" column2.TextList(9).Text = "LED Moved Out of Calibration Range" else 'create full page sheets for each sheet in report.Sheets if inStr(1, sheet.Name, "Error") > 0 then for each table in Report.Sheets(sheet.Name).Objects if inStr(1, table.Name, "Table") > 0 then Report.Sheets(sheet.Name).Objects.Remove(table.Name) end if next end if next for i = 1 to x - 1 'create the data table for each page Set table1 = Report.Sheets(i + 1).Objects.Add(eReportObject2DTable,"Table1") Set position = table1.Position.ByBorder position.Top = 10 'if check = true then ' position.Bottom = 37 'else position.Bottom = 4 'end if position.Left = 5 position.Right = 5 table1.Settings.IndexSettings.IndexEnd = rib.Size table1.Settings.GridHorizontal.Visible = True table1.Settings.Header.Font.Name = "Times New Roman" table1.Settings.Header.Font.Bold = True table1.Settings.Header.Font.Size = 2 table1.Settings.Header.Height = 9 table1.Settings.Header.UseTextClipping = True table1.Settings.Header.UseWordWrap = True table1.Settings.Header.BackgroundColor.SetRGBColor(RGB(214,214,214)) table1.Settings.UseXDoubleLine = False table1.Settings.UseYDoubleLine = False table1.Settings.UseAutoFontSize = False Set column1 = table1.Columns.Add(e2DTableColumnChannel) column1.Channel.Reference = "Error Codes " & i & "/Rib" column1.Settings.Font.Name = "Times New Roman" column1.Settings.Font.Size = 2 Set column2 = table1.Columns.Add(e2DTableColumnChannel) column2.Channel.Reference = "Error Codes " & i & "/LED" column2.Settings.Font.Name = "Times New Roman" column2.Settings.Font.Size = 2 Set column3 = table1.Columns.Add(e2DTableColumnChannel) column3.Channel.Reference = "Error Codes " & i & "/Error Code" column3.Settings.Font.Name = "Times New Roman" column3.Settings.Font.Size = 2 Set column4 = table1.Columns.Add(e2DTableColumnChannel) column4.Channel.Reference = "Error Codes " & i & "/Start Time (ms)" column4.Settings.Font.Name = "Times New Roman" column4.Settings.Font.Size = 2 Set column5 = table1.Columns.Add(e2DTableColumnChannel) column5.Channel.Reference = "Error Codes " & i & "/End Time (ms)" column5.Settings.Font.Name = "Times New Roman" column5.Settings.Font.Size = 2 Set column6 = table1.Columns.Add(e2DTableColumnChannel) column6.Channel.Reference = "Error Codes " & i & "/Maximum Length Change (mm)" column6.Settings.Font.Name = "Times New Roman" column6.Settings.Font.Size = 2 Set column7 = table1.Columns.Add(e2DTableColumnChannel) column7.Channel.Reference = "Error Codes " & i & "/Time of Maximum Length Change (ms)" column7.Settings.Font.Name = "Times New Roman" column7.Settings.Font.Size = 2 next 'create the final page Set table1 = Report.Sheets("Error Codes and Max D #" & x).Objects.Add(eReportObject2DTable,"Table1") Set position = table1.Position.ByBorder position.Top = 10 'if check = true then ' position.Bottom = 37 'else position.Bottom = 36 'end if position.Left = 5 position.Right = 5 table1.Settings.IndexSettings.IndexEnd = Data.Root.ChannelGroups("Error Codes " & x).Channels("Rib").Size table1.Settings.GridHorizontal.Visible = True table1.Settings.Header.Font.Name = "Times New Roman" table1.Settings.Header.Font.Bold = True table1.Settings.Header.Font.Size = 2 table1.Settings.Header.Height = 15 table1.Settings.Header.UseTextClipping = True table1.Settings.Header.UseWordWrap = True table1.Settings.Header.BackgroundColor.SetRGBColor(RGB(214,214,214)) table1.Settings.UseXDoubleLine = False table1.Settings.UseYDoubleLine = False table1.Settings.UseAutoFontSize = False Set column1 = table1.Columns.Add(e2DTableColumnChannel) column1.Channel.Reference = "Error Codes " & x & "/Rib" column1.Settings.Font.Name = "Times New Roman" column1.Settings.Font.Size = 2 Set column2 = table1.Columns.Add(e2DTableColumnChannel) column2.Channel.Reference = "Error Codes " & x & "/LED" column2.Settings.Font.Name = "Times New Roman" column2.Settings.Font.Size = 2 Set column3 = table1.Columns.Add(e2DTableColumnChannel) column3.Channel.Reference = "Error Codes " & x & "/Error Code" column3.Settings.Font.Name = "Times New Roman" column3.Settings.Font.Size = 2 Set column4 = table1.Columns.Add(e2DTableColumnChannel) column4.Channel.Reference = "Error Codes " & x & "/Start Time (ms)" column4.Settings.Font.Name = "Times New Roman" column4.Settings.Font.Size = 2 Set column5 = table1.Columns.Add(e2DTableColumnChannel) column5.Channel.Reference = "Error Codes " & x & "/End Time (ms)" column5.Settings.Font.Name = "Times New Roman" column5.Settings.Font.Size = 2 Set column6 = table1.Columns.Add(e2DTableColumnChannel) column6.Channel.Reference = "Error Codes " & x & "/Maximum Length Change (mm)" column6.Settings.Font.Name = "Times New Roman" column6.Settings.Font.Size = 2 Set column7 = table1.Columns.Add(e2DTableColumnChannel) column7.Channel.Reference = "Error Codes " & x & "/Time of Maximum Length Change (ms)" column7.Settings.Font.Name = "Times New Roman" column7.Settings.Font.Size = 2 ''create the sample text block if error code is a single sample 'if check = true then ' Set sample = Report.Sheets("Error Codes and Max D").Objects.Add(eReportObjectText, "sampleText") ' sample.Font.Name = "Times New Roman" ' sample.Font.Size = 2 ' sample.PositionXY.RelativePosition = eRelativePositionRightBottom ' sample.Text = "* error occurred in a single sample" ' sample.PositionXY.X = 5 ' sample.PositionXY.Y = 36 'end if 'create the max values table Set table2 = Report.Sheets("Error Codes and Max D #" & x).Objects.Add(eReportObject2DTable,"Table2") Set position = table2.Position.ByBorder position.Top = 68 position.Bottom = 5 position.Left = 5 position.Right = 52 table2.Settings.IndexSettings.IndexEnd = 2 table2.Settings.GridHorizontal.Visible = True table2.Settings.Orientation = eTableOrientationHorizontal table2.Settings.Header.Visible = True table2.Settings.Header.Font.Name = "Times New Roman" table2.Settings.Header.Font.Bold = True table2.Settings.Header.Font.Size = 2 table2.Settings.Header.Height = 40 table2.Settings.Header.UseTextClipping = False table2.Settings.Header.UseWordWrap = False table2.Settings.Header.BackgroundColor.SetRGBColor(RGB(214,214,214)) table2.Settings.UseXDoubleLine = False table2.Settings.UseYDoubleLine = False table2.Settings.UseAutoFontSize = False Set column1 = table2.Columns.Add(e2DTableColumnChannel) column1.Settings.UseWordWrap = True column1.Settings.UseTextClipping = True column1.Settings.Header.IndividualTitle.Enable = True column1.Settings.Header.IndividualTitle.Title1 = "Maximum" column1.Settings.Header.IndividualTitle.Title2 = "Shoulder" column1.Settings.Header.IndividualTitle.Title3 = "Length Change" column1.Channel.Reference = "Max Values/Shoulder" column1.Settings.Font.Name = "Times New Roman" column1.Settings.Font.Size = 2 column1.Settings.Format = "d.d" Set column2 = table2.Columns.Add(e2DTableColumnChannel) column2.Settings.UseWordWrap = True column2.Settings.UseTextClipping = True column2.Settings.Header.IndividualTitle.Enable = True column2.Settings.Header.IndividualTitle.Title1 = "Maximum" column2.Settings.Header.IndividualTitle.Title2 = "Thorax" column2.Settings.Header.IndividualTitle.Title3 = "Length Change" column2.Channel.Reference = "Max Values/Thorax" column2.Settings.Font.Name = "Times New Roman" column2.Settings.Font.Size = 2 column2.Settings.Format = "d.d" Set column3 = table2.Columns.Add(e2DTableColumnChannel) column3.Settings.UseWordWrap = True column3.Settings.UseTextClipping = True column3.Settings.Header.IndividualTitle.Enable = True column3.Settings.Header.IndividualTitle.Title1 = "Maximum" column3.Settings.Header.IndividualTitle.Title2 = "Abdomen" column3.Settings.Header.IndividualTitle.Title3 = "Length Change" column3.Channel.Reference = "Max Values/Abdomen" column3.Settings.Font.Name = "Times New Roman" column3.Settings.Font.Size = 2 column3.Settings.Format = "d.d" 'create the error code descriptions table Set table3 = Report.Sheets("Error Codes and Max D #" & x).Objects.Add(eReportObject2DTable,"Table3") Set position = table3.Position.ByBorder position.Top = 68 position.Bottom = 5 position.Left = 52 position.Right = 5 table3.Settings.IndexSettings.IndexEnd = 9 table3.Settings.GridHorizontal.Visible = True table3.Settings.Header.Font.Name = "Times New Roman" table3.Settings.Header.Font.Bold = True table3.Settings.Header.Font.Size = 2 table3.Settings.Header.Height = 13 table3.Settings.Header.UseTextClipping = True table3.Settings.Header.UseWordWrap = True table3.Settings.Header.BackgroundColor.SetRGBColor(RGB(214,214,214)) table3.Settings.UseXDoubleLine = False table3.Settings.UseYDoubleLine = False table3.Settings.UseAutoFontSize = False Set column1 = table3.Columns.Add(e2DTableColumnText) column1.Settings.RelativeColumnWidth = 0.3 column1.Settings.Header.IndividualTitle.Title1 = "Error Code" column1.Settings.Font.Name = "Times New Roman" column1.Settings.Font.Size = 2 column1.TextList.Count = 9 for i = 1 to column1.TextList.Count column1.TextList(i).Text = i next Set column2 = table3.Columns.Add(e2DTableColumnText) column2.Settings.Header.IndividualTitle.Title1 = "Error Code Description" column2.Settings.Font.Name = "Times New Roman" column2.Settings.Font.Size = 2 column2.TextList.Count = 9 column2.TextList(1).Text = "Top Sensor Blocked" column2.TextList(2).Text = "Bottom Sensor Blocked" column2.TextList(3).Text = "Top and Bottom Sensor Blocked" column2.TextList(4).Text = "Middle Sensor Blocked" column2.TextList(5).Text = "Middle and Top Sensor Blocked" column2.TextList(6).Text = "Middle and Bottom Sensor Blocked" column2.TextList(7).Text = "All Three Sensors Blocked" column2.TextList(8).Text = "Divide-By-Zero Condition" column2.TextList(9).Text = "LED Moved Out of Calibration Range" end if Report.Refresh() Call Report.Sheets(2).Activate sub ribtype(iso) ' determine rib location if mid(iso, 3, 2) = "SH" then ribset = "Shoulder" elseif mid(iso, 3, 2) = "TR" and mid(iso, 8, 1) = "U" then ribset = "Thorax 1" elseif mid(iso, 3, 2) = "TR" and mid(iso, 8, 1) = "M" then ribset = "Thorax 2" elseif mid(iso, 3, 2) = "TR" and mid(iso, 8, 1) = "L" then ribset = "Thorax 3" elseif mid(iso, 3, 2) = "AB" and mid(iso, 8, 1) = "U" then ribset = "Abdomen 1" elseif mid(iso, 3, 2) = "AB" and mid(iso, 8, 1) = "L" then ribset = "Abdomen 2" end if 'determine LED position if mid(iso, 9, 1) = "R" then ledLoc = "Rear" elseif mid(iso, 9, 1) = "M" then ledLoc = "Middle" elseif mid(iso, 9, 1) = "F" then ledLoc = "Front" end if end sub