access raporda dikine çizgi boyu

Katılım
1 Mayıs 2007
Mesajlar
9
Excel Vers. ve Dili
2007
selam, bi rapor dosyasında tablo kullanmak istiyorum. fakat ayrıntı kısmında dikini bir çizgi koyduğum zaman eğer burdaki metin uzunsa çizgi kısa kalıyor. bu çizgiyi satır sayısına göre nasıl uzatabilirim
 

beab05

Özel Üye
Katılım
19 Mart 2007
Mesajlar
1,418
Excel Vers. ve Dili
Office 2013
Aşağıdaki kodu raporunuzun kod kısmına yerleştirin bütün verileriniz çerçeve içine girer yani tablo görüntüsünde olur..

Option Explicit


Private Type udtPrtMips_str
strRGB As String * 28
End Type

' Structure from ADH97
Private Type udtPrtMips
lngLeft As Long
lngTop As Long
lngRight As Long
lngBottom As Long
lngDataOnly As Long
lngWidth As Long
lngHeight As Long
lngDefaultSize As Long
lngItemsAcross As Long
lngColumnSpacing As Long
lngRowSpacing As Long
lngItemLayout As Long
lngFastPrinting As Long
lngDataSheet As Long
End Type

' Track where Detail Section Ends
' so we can Draw Grid to fill in
' down the rest of the page
Dim intDetailEnds As Integer


Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' How thick our Line will be
Me.DrawWidth = 4

' Set ScaleMode = Twips
Me.ScaleMode = 1

' Print Border Line at bottom of this Section
Me.Line (0, Me.Height)-(Me.Width, Me.Height)

' For Debugging
' Print out the values of Me.Top and Me.Height
'Me.CurrentX = 1440
'Me.CurrentY = Me.Height - 180
'Me.Print Me.Top + Me.Height

' Let's keep track of the bottom of the
' last row/the bottom of the Detail section
intDetailEnds = Me.Top + Me.Height
'Debug.Print "intDetailEnds:" & intDetailEnds & " Me.Top:" & Me.Top & " Me.Height:" & Me.Height & " " & Me.customerID
End Sub

Private Sub Report_Activate()
DoCmd.Maximize
End Sub

Private Sub Report_Page()
Const TWIPSPERINCH = 1440

' Offset from right edge of Control where our
' Vertical Line will start - adjust as you desire.
' Expressed in Twips
Dim intLineMargin As Integer

' Need Control object to loop through Control Collection
Dim CtlDetail As Control

' Y position where we will start Drawing our Grid from
Dim startY As Integer

' Var will be set to the Margin you
' set for the Bottom of the Page
' and Top of the Page via
' the Page Setup Menu
' Expressed in TWIPS.
Dim varBMargin As Variant
Dim varTMargin As Variant

' PrtMips structs
Dim MIPSstr As udtPrtMips_str
Dim MIPS As udtPrtMips

' See Access help for PrtMip
MIPSstr.strRGB = Me.PrtMip
LSet MIPS = MIPSstr

' Copy value into our page Margin vars
varBMargin = MIPS.lngBottom
varTMargin = MIPS.lngTop

' intLineMargin is expressed in TWIPS
intLineMargin = 60

' How thick our Line will be
Me.DrawWidth = 4

' We need to draw a vertical line at the left
' edge of our report. All other vertical lines are to the
' right edge of the existing controls
' You should place the right most control at the extreme
' right edge of your report - intMargin
With Me
Me.Line ((0), .Section(acPageHeader).Height) _
-(0, .ScaleHeight - _
(.Section(acPageFooter).Height))
End With

' OK lets draw a vertical line to seperate each field
' for each control in details control
For Each CtlDetail In Me.Section(acDetail).Controls

' Don't draw a Vertical line at end of Horizontal Line control - not needed
If Not TypeOf CtlDetail Is Access.Line Then
With CtlDetail
Me.Line ((.Left + .Width + intLineMargin), Me.Section(acPageHeader).Height) _
-(.Left + .Width + intLineMargin, Me.ScaleHeight - _
(Me.Section(acPageFooter).Height))
End With
End If
Next

' If there is still room between where Detail Section ends
' and the Top of the Page Footer Section begins.
If intDetailEnds < (Me.ScaleHeight + varBMargin) - (Me.Section(acPageFooter).Height) Then

' Draw our Horizontal Lines
' Start at Bottom of last Detail Section
' We must subtract Top Page Margin
startY = intDetailEnds - varTMargin

' Let's fill in the rest of the this blank space with a Grid
' equal in height to the Detail Section.
With Me
Do While startY <= (.ScaleHeight + varBMargin) - ((.Section(acPageFooter).Height) + .Section(acDetail).Height)
Me.Line (0, startY)-(.Width, startY)
'Debug.Print "StartY:" & startY & " Detail Section Height:" & .Section(acDetail).Height
'Me.CurrentX = 1440
'Me.CurrentY = startY
'Me.Print startY
' Increase by height of Detail Section
' You can use whatever value you want for the Grid Height
startY = startY + .Section(acDetail).Height
Loop
End With
End If

'CleanUp time
Set CtlDetail = Nothing

End Sub
 

beab05

Özel Üye
Katılım
19 Mart 2007
Mesajlar
1,418
Excel Vers. ve Dili
Office 2013
E&#287;er sadece dikine &#231;izgi isterseniz de a&#351;a&#287;&#305;daki kodu deneyiniz..

Option Explicit
Private Type udtPrtMips_str
strRGB As String * 28
End Type

' Structure from ADH97
Private Type udtPrtMips
lngLeft As Long
lngTop As Long
lngRight As Long
lngBottom As Long
lngDataOnly As Long
lngWidth As Long
lngHeight As Long
lngDefaultSize As Long
lngItemsAcross As Long
lngColumnSpacing As Long
lngRowSpacing As Long
lngItemLayout As Long
lngFastPrinting As Long
lngDataSheet As Long
End Type


Private Sub PageHeader_Print(Cancel As Integer, PrintCount As Integer)
With Me
' Let's Draw a border around the Section as well
' We could do simply code like:
'Me.Line (0, 0)-Step(.Width, .Height), 0, B
' But let's do it in individual line segments
' in case you need to draw/not draw these segments
Me.Line (0, 0)-(.Width, 0)
Me.Line (0, .Height)-(.Width, .Height)
Me.Line (0, 0)-(0, .Height)
Me.Line (.Width, 0)-(.Width, .Height)
End With
End Sub


Private Sub Report_Activate()
DoCmd.Maximize
End Sub


Private Sub Report_Page()
Const TWIPSPERINCH = 1440

' Offset from right edge of Control where our
' Vertical Line will start - adjust as you desire.
' Expressed in Twips
Dim intLineMargin As Integer

' Need Control object to loop through Control Collection
Dim CtlDetail As Control

' Y position where we will start Drawing our Grid from
Dim startY As Integer

' Var will be set to the Margin you
' set for the Bottom of the Page
' and Top of the Page via
' the Page Setup Menu
' Expressed in TWIPS.
Dim varBMargin As Variant
Dim varTMargin As Variant

' PrtMips structs
Dim MIPSstr As udtPrtMips_str
Dim MIPS As udtPrtMips

' See Access help for PrtMip
MIPSstr.strRGB = Me.PrtMip
LSet MIPS = MIPSstr

' Copy value into our page Margin vars
varBMargin = MIPS.lngBottom
varTMargin = MIPS.lngTop


'intLineMargin is expressed in TWIPS
intLineMargin = 20

' We need to draw a vertical line at the left and right
' edge of our report. All other vertical lines are to the
' right edge of the existing controls
' You should place the right most control at the extreme
' right edge of your report - intMargin
' Draw Line Left Edge
With Me
' Won't take 0 for the starting Y param - use 1.
Me.Line ((0), 1)-(0, .ScaleHeight - _
(.Section(acPageFooter).Height))

End With

' OK lets draw a vertical line to seperate each field
' for each control in details control
For Each CtlDetail In Me.Section(acDetail).Controls
With CtlDetail
If Page = 1 Then
Me.Line ((.Left + .Width + intLineMargin), 1 + Me.Section(acHeader).Height) _
-(.Left + .Width + intLineMargin, Me.ScaleHeight - (Me.Section(acPageFooter).Height))
Else
Me.Line ((.Left + .Width + intLineMargin), 1) _
-(.Left + .Width + intLineMargin, Me.ScaleHeight - (Me.Section(acPageFooter).Height))
End If
End With
Next

'CleanUp time
Set CtlDetail = Nothing

End Sub

Private Sub ReportHeader_Print(Cancel As Integer, PrintCount As Integer)
With Me
' Let's Draw a border around the Section as well
' We could do simply code like:
'Me.Line (0, 0)-Step(.Width, .Height), 0, B
' But let's do it in individual line segments
' in case you need to draw/not draw these segments
Me.Line (0, 0)-(.Width, 0)
Me.Line (0, .Height)-(.Width, .Height)
Me.Line (0, 0)-(0, .Height)
Me.Line (.Width, 0)-(.Width, .Height)
End With
End Sub
 
Katılım
1 Mayıs 2007
Mesajlar
9
Excel Vers. ve Dili
2007
güzel kod...fakat bişi soracam acaba şöyle bişe yapabilirmiyiz, ayrıntı kısmında normalde gelen ver verinin yüksekliği farklı oluyor ve bu yüzden dikey çizgi kısa kalabiliyor, bu çizginin boyunu gelen veriye göre nasıl ayarlayabiliriz. Örneğin;
cizgi.Height=aciklama.Height gibi birşey kullanmam lazım
 

beab05

Özel Üye
Katılım
19 Mart 2007
Mesajlar
1,418
Excel Vers. ve Dili
Office 2013
Sorunuzu anlamakta g&#252;&#231;l&#252;k &#231;ekiyorum, nas&#305;l bir rapor tasar&#305;m&#305;n&#305;z var ? Yukar&#305;daki kodlarla da yapabilirsiniz ya da en iyisi raporunuzu g&#246;rmek laz&#305;m ;)
 

beab05

Özel Üye
Katılım
19 Mart 2007
Mesajlar
1,418
Excel Vers. ve Dili
Office 2013
Ben yine tam anlamad&#305;m kan&#305;mca ;)
Size tavsiyem ise dikey &#231;izgi &#231;ekece&#287;iniz alan i&#231;in 1 ya da 2 tane metin kutusu yap&#305;n be bu kutulara ayn&#305; alan ismini verin sonra bu kutular&#305;n &#231;izgi rengi, arka rengi saydam beyaz ya da siyah yaparak ve boyutlar&#305;yla oynuyarak ve tabii &#252;ste getir alta getir &#246;zelliklerini de katarak bunlar&#305; &#252;st &#252;ste bindirin ve istedi&#287;iniz sonucu al&#305;ncaya dek u&#287;ra&#351;&#305;n. Ayr&#305;ca bu metin kutular&#305;n&#305;n b&#252;y&#252;yebilir &#246;zelliklerini evet olarak ayarlay&#305;n..

Kolay gelsin ;)
 
Katılım
24 Eylül 2005
Mesajlar
332
bir modül oluştur
Public Sub MakeBoxesGrow(ThisReport As Report)
Dim X1 As Single
Dim X2 As Single
Dim Y1 As Single
Dim Y2 As Single
Dim Offset As Single
Dim Color As Long
Dim ThisControl As Control
Dim MaxHeight As Single

For Each ThisControl In ThisReport.Section(acDetail).Controls
If ThisControl.Visible = True Then
If ThisControl.Height > MaxHeight Then
MaxHeight = ThisControl.Height
End If
End If
Next ThisControl

ThisReport.ScaleMode = 1

Offset = 0
ThisReport.DrawWidth = 3
Color = RGB(0, 0, 0) '

For Each ThisControl In ThisReport.Section(acDetail).Controls
If ThisControl.Visible = True Then

X1 = ThisControl.Left - Offset
Y1 = ThisControl.Top - Offset

X2 = ThisControl.Left + ThisControl.Width + Offset
Y2 = ThisControl.Top + MaxHeight + Offset

ThisReport.Line (X1, Y1)-(X2, Y2), Color, B
End If
Next ThisControl

Set ThisControl = Nothing
End Sub


raporun ayrıntı kodunu

Private Sub Ayrıntı_Print(Cancel As Integer, PrintCount As Integer)
MakeBoxesGrow Me
End Sub

şeklinde yap

metin kutularının

arka plan ve kenarlığını saydam yap

büyüyebilirliğini evet yap

sorununun çözülür.
 
Katılım
1 Mayıs 2007
Mesajlar
9
Excel Vers. ve Dili
2007
saol birader bu son gönderdiğin cuk oturdu...eline sağlık... bu accessin bu olaya bi el atması lazım...
 
Üst