powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Microsoft Access [игнор отключен] [закрыт для гостей] / Report печать перекрестной таблицы в отчете.
3 сообщений из 3, страница 1 из 1
Report печать перекрестной таблицы в отчете.
    #32622674
Alexanderik
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Как можно распечатать перекрестую таблицу, если в зависимости от условий,
постоянно меняются ее поля, и количество столбцов ?

Есть ли в отчетах подобие свойсва. Datasheet. ?
чтобы не указывать и конкретизировать поля ?
...
Рейтинг: 0 / 0
Report печать перекрестной таблицы в отчете.
    #32622757
Alexanderik
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Ура !! нашел !

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
Private Sub Report_Open(Cancel As Integer)
    ' You didn't know how many columns, or what
    ' their names would be, until now.
    ' Fill in the label captions,
    ' and control ControlSources.
'

    
    Dim intColCount As Integer
    Dim intControlCount As Integer
    Dim i As Integer
    Dim strName As String
    
    On Error Resume Next
    
    Dim rst As ADODB.Recordset
    
    Set rst = New ADODB.Recordset
    rst.Open _
     Source:=Me.RecordSource, _
     ActiveConnection:=CurrentProject.Connection, _
     Options:=adCmdTable
    
    intColCount = rst.Fields.Count
    intControlCount = Me.Detail.Controls.Count
    
    If intControlCount < intColCount Then
        intColCount = intControlCount
    End If
    
    ' Fill in information for the necessary controls.
'

    For i =  1  To intColCount
        strName = rst.Fields(i -  1 ).Name
        Me.Controls("lblHeader" & i).Caption = strName
        Me.Controls("txtData" & i).ControlSource = strName
        Me.Controls("txtSum" & i).ControlSource = _
         "=Sum([" & strName & "])"
    Next i
    
    ' Hide the extra controls.
'
    For i = intColCount +  1  To intControlCount
        Me.Controls("txtData" & i).Visible = False
        Me.Controls("lblHeader" & i).Visible = False
        Me.Controls("txtSum" & i).Visible = False
    Next i
    
    ' Close the recordset.
'
    rst.Close
End Sub
...
Рейтинг: 0 / 0
Report печать перекрестной таблицы в отчете.
    #32622769
Alexanderik
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Ура !! нашел !

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
Private Sub Report_Open(Cancel As Integer)
    ' You didn't know how many columns, or what
    ' their names would be, until now.
    ' Fill in the label captions,
    ' and control ControlSources.
'

    
    Dim intColCount As Integer
    Dim intControlCount As Integer
    Dim i As Integer
    Dim strName As String
    
    On Error Resume Next
    
    Dim rst As ADODB.Recordset
    
    Set rst = New ADODB.Recordset
    rst.Open _
     Source:=Me.RecordSource, _
     ActiveConnection:=CurrentProject.Connection, _
     Options:=adCmdTable
    
    intColCount = rst.Fields.Count
    intControlCount = Me.Detail.Controls.Count
    
    If intControlCount < intColCount Then
        intColCount = intControlCount
    End If
    
    ' Fill in information for the necessary controls.
'

    For i =  1  To intColCount
        strName = rst.Fields(i -  1 ).Name
        Me.Controls("lblHeader" & i).Caption = strName
        Me.Controls("txtData" & i).ControlSource = strName
        Me.Controls("txtSum" & i).ControlSource = _
         "=Sum([" & strName & "])"
    Next i
    
    ' Hide the extra controls.
'
    For i = intColCount +  1  To intControlCount
        Me.Controls("txtData" & i).Visible = False
        Me.Controls("lblHeader" & i).Visible = False
        Me.Controls("txtSum" & i).Visible = False
    Next i
    
    ' Close the recordset.
'
    rst.Close
End Sub
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / Microsoft Access [игнор отключен] [закрыт для гостей] / Report печать перекрестной таблицы в отчете.
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]