AccessTr.neT
Customize A Report's Grouping And Sorting At Runtime - Baskı Önizleme

+- AccessTr.neT (https://accesstr.net)
+-- Forum: Microsoft Access (https://accesstr.net/forum-microsoft-access.html)
+--- Forum: Access Cevaplanmış Soruları (https://accesstr.net/forum-access-cevaplanmis-sorulari.html)
+--- Konu Başlığı: Customize A Report's Grouping And Sorting At Runtime (/konu-customize-a-report-s-grouping-and-sorting-at-runtime.html)



Customize A Report's Grouping And Sorting At Runtime - accessman - 08/01/2020

Usta link paylaşmayın dediği için sadece sitenin adını yazıyorum "etutorials"
bu sitede konunun isminden de anlaşıldığı üzere son kullanıcının özelliklerinde değişiklik yaparak rapor yazdırabilmesi için örnek var
bakmadan geçmeyin hatta yorum yapmadan hiç geçmeyin mümkünse birimiz buradaki örneği program haline dönüştürüp siteye eklesin

[Resim: do.php?img=9427]


Cvp: Customize A Report's Grouping And Sorting At Runtime - ozanakkaya - 08/01/2020

Sayın @accessman, örnek uygulamanız var ise, örneğinizi ekleyin, paylaşın. Sorunuz var ise Access soruları bölümüne yeni konu açıp sorunuzu sorun. X sitesinde şu var, Y sitesinde bu var olaylarına girmeyin.


Cvp: Customize A Report's Grouping And Sorting At Runtime - accessman - 08/01/2020

İki saattir şu kodu anlamaya çalışıyorum bir türlü çözemedim

Private Sub FixUpCombos(ctlCalling As Control)

    Dim intIndex As Integer
    Dim intI As Integer
   
    ' Grab the last character of the calling
    ' control's name and convert to an integer
    intIndex = CInt(Right(ctlCalling.Name, 1))
   
    ' Enable the next control if and only if the
    ' value of the calling control is non-null
    If intIndex < acbcMaxSortFields Then
        With Me("cboField" & intIndex + 1)
            .Value = Null
            .Enabled = (Not IsNull(ctlCalling))
        End With
        Me("grpSort" & intIndex + 1).Enabled = (Not IsNull(ctlCalling))
    End If
   
    ' Disable all controls after the next one
    If intIndex < acbcMaxSortFields - 1 Then
        For intI = intIndex + 2 To acbcMaxSortFields
            With Me("cboField" & intI)
                .Value = Null
                .Enabled = False
            End With
            With Me("grpSort" & intI)
                .Value = acbcNoSort
                .Enabled = False
            End With
        Next intI
    End If
End Sub



Cvp: Customize A Report's Grouping And Sorting At Runtime - ozanakkaya - 08/01/2020

Kullanım şekli:

FixUpCombos(Metin1)


Kod içerisindeki  intIndex = CInt(Right(ctlCalling.Name, 1)) kodu ile denetimin numarasını alıyor. Metin1'in son hanesi 1

acbcMaxSortFields, farklı biryerde tanımlanmış sayı. 

 If intIndex < acbcMaxSortFields Then
        With Me("cboField" & intIndex + 1)
            .Value = Null
            .Enabled = (Not IsNull(ctlCalling))
        End With
        Me("grpSort" & intIndex + 1).Enabled = (Not IsNull(ctlCalling))
    End If
intindex acbcMaxsortfieldsten küçük ise, cbofield2 = null, Metin1 boş ise cbofield2'in enabled özelliği true,
grpsort2'nin enabled true

If intIndex < acbcMaxSortFields - 1 Then
        For intI = intIndex + 2 To acbcMaxSortFields
            With Me("cboField" & intI)
                .Value = Null
                .Enabled = False
            End With
            With Me("grpSort" & intI)
                .Value = acbcNoSort
                .Enabled = False
            End With
        Next intI
    End If

intindex, acbcMaxSortFields değerinin 1 eksiğinden kuçuk ise Metin1'e göre 1+2=3'ten acbcMaxSortFields değerine kadar for döngüsü var. Bu döngü ile cbofield4, cbofield5 ... value değeri null, görünümü kapalı

grpsort4, grupsort5... değedleri abcNoSort değeri olacak, Enabled=false olacak.

acbcMaxSortFields ve abcNoSort sanırım değişken.


Cvp: Customize A Report's Grouping And Sorting At Runtime - accessman - 08/01/2020

Teşekkürler admin ellerine sağlık
Becerebilirsem treeviewle birleştirip örnek olarak eklemek isterim