اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

التقرير المجمع


monm

الردود الموصى بها

نعود مرة أخرى للمبدعين  وخاصة استاذنا جعفر وعودا محمودا

التقرير الذى تم عمله من قبل فى غاية الامتياز ولكن.....

عند استخدامة فى إدارة واحدة تكون النتائج ممتازة 

عند استخدام اكثر من إدارة الأمور تتعقد 

ارجو الحل

تجارب.mdb

رابط هذا التعليق
شارك

السلام عليكم 🙂

 

في الماضي كان عندنا معيار واحد فقط (التاريخ) ، بينما الآن اصبح عندنا معيارين (التاريخ و الادارة) ، وهذا اخذ مني اكثر من يومين للوصول اليه !!

على العموم ، نظّفت الكود بطريقة اخرى ، والعرض اصبح الآن يأخذ الصفحة كاملة ، وعلى اساسه يعمل عرض الحقول 🙂

 

1030.Clipboard01.jpg.410efccd03194f7af6dbc7ae66c70c0d.jpg

وهذا الكود كاملا:

Private Sub Report_Open(Cancel As Integer)

    Dim ctrl As Control
    Dim A As Integer
    Dim Empty_Cells As Integer
    Dim Full_Cells As Integer
    Dim W As Integer
    Dim myWhere As String
    Dim rpt_width As Integer
    Dim Full_Date As Date
    Dim D As Integer
    Dim Y As Integer
    Dim M As Integer
   
    'W = 2200 / 4    'field width
    Empty_Cells = 0
    Full_Cells = 0  'the name
    rpt_width = 0
        
    Y = Forms!Report!iYear   'year
    M = Forms!Report!iMonth  'month
    
    'lets fit/expand the controld based on the avaible width
    'how many Full_Cells
    For D = 1 To 31
        Full_Date = DateSerial(Y, M, D)
        myWhere = "[edara]='" & Forms!Report!cmd_edara_N & "'"
        myWhere = myWhere & " And "
        myWhere = myWhere & "[zeiara_date]=" & DateFormat(Full_Date)
        A = DCount("*", "zeara", myWhere)
        If A <> 0 Then
            Full_Cells = Full_Cells + 1
        End If
    Next D
    
    
    W = Me.Width - (Me.Printer.LeftMargin + Me.Printer.RightMargin + Me("mogh_name").Width)
    W = W / (Full_Cells - 1)
    
    For D = 1 To 31
            
            Full_Date = DateSerial(Y, M, D)     'the field Names from the Crosstab query
            
            'check if this field exists int the table
            myWhere = "[edara]='" & Forms!Report!cmd_edara_N & "'"
            myWhere = myWhere & " And "
            myWhere = myWhere & "[zeiara_date]=" & DateFormat(Full_Date)
            
            A = DCount("*", "zeara", myWhere)
            
               
        
        If A = 0 Then
            'field dose not exist
            
            Me("txt_" & D).Width = 0                        'trim field size to Zero
            Me("txt_" & D).Visible = False                  'make the field invisible
            Me("txt_" & D).ControlSource = ""               'remove the Control Source
                
            Me("lbl_" & D).Width = 0                        'trim label size to Zero
            Me("lbl_" & D).Visible = False                  'make the label invisible
                
            Empty_Cells = Empty_Cells + 1
                
            'Debug.Print "Off " & Me("txt_" & D).Name & vbTab & "D:" & D & vbTab & "Full:" & Full_Date & vbTab & "A:" & A
            
        Else
            'field exists

            Me("txt_" & D).Width = 1 * W                    'set the field width
            Me("txt_" & D).Visible = True                   'make the field visible
            Me("txt_" & D).ControlSource = Full_Date
                
            Me("lbl_" & D).Width = 1 * W                    'set the label width
            Me("lbl_" & D).Visible = True                   'make the label visible
            Me("lbl_" & D).Caption = D & "/" & M            'give the label, a caption
            
            Full_Cells = Full_Cells + 1
            rpt_width = rpt_width + Me("txt_" & D).Width              'add the width

            'Debug.Print "ON  " & Me("txt_" & D).Name & vbTab & "D:" & D & vbTab & "Full:" & Full_Date & vbTab & "A:" & A
            
        End If
        
    Next D
 

    Me.Width = rpt_width + Me("mogh_name").Width            'the final Report width

    
End Sub

 

جعفر

1030.rpt_Monthly_Crosstaby.mdb

  • Like 4
  • Thanks 2
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information