Bron - Thanks again! My colleague suggested finding a different way to calculate an item's indent level in this case, after reading what you posted. So for anyone looking for a solution here is what I used: Place the first part in your SQL code and then paste the second part in the left padding property of the item number field you are looking to indent.
First Part:
@WorkOrderId char(31)
AS
Declare @LoopCounter as int = 0
Declare @IndentLevel as int = 0
Declare @TotalLoops as int = (Select MAX(SEQ_I) From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId)- (Select MIN(SEQ_I) From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId)
Declare @CurrentSequence as int = (Select MIN(SEQ_I) From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId)
Declare @SubAssembly as varchar(31) = ISNULL((Select SUBASSEMBLYOF_I From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId And SEQ_I=@CurrentSequence),'')
Declare @LastSubAssembly as varchar(31)
Begin
Create Table #TempIndentLvlData (rownum int IDENTITY (1, 1) Primary key NOT NULL, PPN_I char(31), ITEM_NMBR char(31), ITEM_NMBR smallint, POS_NUM2 smallint, SEQ_I int, SUBASSEMBLY_OF_I char(31), INDENT_LVL int)
While (@LoopCounter <= @TotalLoops)
Begin
If @SubAssembly = ''
Set @IndentLevel = 0
Else If @LastSubAssembly <> @SubAssembly and @SubAssembly <> ''
Set @IndentLevel = @IndentLevel + 1
Else
Set @IndentLevel = @IndentLevel
Set @LastSubAssembly = @SubAssembly
Set @SubAssembly = ISNULL((Select SUBASSEMBLYOF_I From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId And SEQ_I=@CurrentSequence+1),'')
Insert Into #TempIndentLvlData Values (
(Select PPN_I From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId And SEQ_I=@CurrentSequence),
(Select ITEMNMBR From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId And SEQ_I=@CurrentSequence),
(Select POSITION_NUMBER From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId And SEQ_I=@CurrentSequence),
(Select POSITION_NUMBER2 From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId And SEQ_I=@CurrentSequence),
(Select SEQ_I From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId And SEQ_I=@CurrentSequence),
(Select SUBASSEMBLYOF_I From PK010033 Where MANUFACTUREORDER_I=@WorkOrderId And SEQ_I=@CurrentSequence),
@IndentLevel
)
Set @CurrentSequence = @CurrentSequence + 1
Set @LoopCounter = @LoopCounter + 1
Select * From #TempIndentLvlData
End
End
Second Part:
=Fields!INDENT_LVL.Value & "2pt"