avwtech
12-28-2004, 06:54 AM
Ok. I've got a report that is generated from a value called COI2. This report is displaying records row after row. Each row is indented based on the number of periods in its title(for instance: A1.1 is a root with A1.1.1 indented and A1.2 falling directly under A1.1). This works fine and everything lines up. This document is for the Dept. of Navy so everything must follow a certain format. On most of my reports my coding works fine, but on some of the larger ones I receive a "control too large" error. In efforts to fix this error, I made the commented out code dictating the size of the details control. This code however only utilizes 60% of a landscape report. I tried "can grow" but it seems to only be working vertically and not horizontally. I need to make a way for my descriptions to fill the page width to the right hand side without jepordizing their formatted position on the left hand side. Let me know what yall think. Any help towards solving this problem will be much appreciated. Thanks a lot.
Dave
----- -CODE- -----
Dim COI2 As String
COI2 = Reports("COI2outline").Section("Detail").Controls("COI2").Value
Dim numPeriods As Integer, periodplace As Integer
numPeriods = 0
periodplace = 1
Do While Not InStr(periodplace, CStr(COI2), ".") = 0
periodplace = InStr(periodplace, COI2, ".") + 1
numPeriods = numPeriods + 1
Loop
' Size = (8 * 1440) - (700 * CInt(numPeriods))
' Do Until (Size + 900 + 700 * numPeriods) < (7.5 * 1440 + 80)
' Size = Size - 100
' Loop
' Reports("COI2outline").Section("Detail").Controls("Description").Width = Size
Reports("COI2outline").Section("Detail").Controls("COI2").Left = 200 + 600 * numPeriods
Reports("COI2outline").Section("Detail").Controls("Description").Left = 900 + 600 * numPeriods ' ERROR debugs to this line of code numPeriods=4
If numPeriods < 2 Then
Reports("COI2outline").Section("Detail").Controls("COI2").fontsize = 10
Reports("COI2outline").Section("Detail").Controls("Description").fontsize = 10
Else
Reports("COI2outline").Section("Detail").Controls("COI2").fontsize = 8
Reports("COI2outline").Section("Detail").Controls("Description").fontsize = 8
End If
Dave
----- -CODE- -----
Dim COI2 As String
COI2 = Reports("COI2outline").Section("Detail").Controls("COI2").Value
Dim numPeriods As Integer, periodplace As Integer
numPeriods = 0
periodplace = 1
Do While Not InStr(periodplace, CStr(COI2), ".") = 0
periodplace = InStr(periodplace, COI2, ".") + 1
numPeriods = numPeriods + 1
Loop
' Size = (8 * 1440) - (700 * CInt(numPeriods))
' Do Until (Size + 900 + 700 * numPeriods) < (7.5 * 1440 + 80)
' Size = Size - 100
' Loop
' Reports("COI2outline").Section("Detail").Controls("Description").Width = Size
Reports("COI2outline").Section("Detail").Controls("COI2").Left = 200 + 600 * numPeriods
Reports("COI2outline").Section("Detail").Controls("Description").Left = 900 + 600 * numPeriods ' ERROR debugs to this line of code numPeriods=4
If numPeriods < 2 Then
Reports("COI2outline").Section("Detail").Controls("COI2").fontsize = 10
Reports("COI2outline").Section("Detail").Controls("Description").fontsize = 10
Else
Reports("COI2outline").Section("Detail").Controls("COI2").fontsize = 8
Reports("COI2outline").Section("Detail").Controls("Description").fontsize = 8
End If