Автор: Cryogen2003
Дата сообщения: 25.12.2009 07:53
vladman
Думаю просто где-то что-то забыл. Сейчас просто часть кода dfm и select
[more=Читать dfm и select для гридов]
object dbgCardBanksoftHistory: TcxGrid
Left = 1
Top = 57
Width = 348
Height = 125
Align = alClient
Constraints.MinHeight = 70
TabOrder = 2
DragOpening = False
LevelTabs.Style = 7
LookAndFeel.Kind = lfFlat
RootLevelOptions.TabsForEmptyDetails = False
object dbgCardBanksoftHistoryDBTableView1: TcxGridDBTableView
OnKeyDown = dbgCardBanksoftHistoryDBTableView1KeyDown
NavigatorButtons.ConfirmDelete = False
NavigatorButtons.First.Hint = #1055#1077#1088#1074#1072#1103' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.PriorPage.Hint = #1055#1077#1088#1077#1081#1090#1080' '#1085#1072' '#1087#1088#1077#1076#1099#1076#1091#1097#1091#1102' '#1089#1090#1088#1072#1085#1080#1094#1091
NavigatorButtons.PriorPage.Visible = False
NavigatorButtons.Prior.Hint = #1055#1088#1077#1076#1099#1076#1091#1097#1072#1103' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.Next.Hint = #1057#1083#1077#1076#1091#1102#1097#1072#1103' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.NextPage.Hint = #1055#1077#1088#1077#1081#1090#1077' '#1085#1072' '#1089#1083#1077#1076#1091#1102#1097#1091#1102' '#1089#1090#1088#1072#1085#1080#1094#1091
NavigatorButtons.NextPage.Visible = False
NavigatorButtons.Last.Hint = #1055#1086#1089#1083#1077#1076#1085#1103#1103' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.Last.Visible = True
NavigatorButtons.Insert.Hint = #1044#1086#1073#1072#1074#1083#1077#1085#1080#1077' '#1079#1072#1087#1080#1089#1080
NavigatorButtons.Insert.Visible = False
NavigatorButtons.Append.Hint = #1044#1086#1073#1072#1074#1083#1077#1085#1080#1077' '#1079#1072#1087#1080#1089#1080' '#1074' '#1082#1086#1085#1077#1094
NavigatorButtons.Delete.Hint = #1059#1076#1072#1083#1080#1090#1100' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.Delete.Visible = False
NavigatorButtons.Edit.Hint = #1056#1077#1076#1072#1082#1090#1080#1088#1086#1074#1072#1085#1080#1077' '#1079#1072#1087#1080#1089#1080
NavigatorButtons.Edit.Visible = False
NavigatorButtons.Post.Hint = #1057#1086#1093#1088#1072#1085#1080#1090#1100' '#1080#1079#1084#1077#1085#1077#1085#1080#1103
NavigatorButtons.Post.Visible = False
NavigatorButtons.Cancel.Hint = #1054#1090#1084#1077#1085#1072' '#1080#1079#1084#1077#1085#1077#1085#1080#1081
NavigatorButtons.Cancel.Visible = False
NavigatorButtons.Refresh.Hint = #1054#1073#1085#1086#1074#1080#1090#1100
NavigatorButtons.Refresh.Visible = False
NavigatorButtons.SaveBookmark.Hint = #1057#1086#1093#1088#1072#1085#1080#1090#1100' '#1079#1072#1082#1083#1072#1076#1082#1091
NavigatorButtons.GotoBookmark.Hint = #1055#1077#1088#1077#1081#1090#1080' '#1082' '#1079#1072#1082#1083#1072#1076#1082#1077
NavigatorButtons.Filter.Hint = #1060#1080#1083#1100#1090#1088
NavigatorButtons.Filter.Visible = False
FilterBox.Position = fpTop
FilterBox.Visible = fvNever
DataController.DataModeController.SmartRefresh = True
DataController.DataSource = dsCardBanksoftHistory_B
DataController.Filter.Options = [fcoCaseInsensitive]
DataController.Filter.Active = True
DataController.Filter.TranslateBetween = True
DataController.Filter.TranslateIn = True
DataController.Filter.TranslateLike = True
DataController.Filter.SupportedLike = False
DataController.Options = [dcoAnsiSort, dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoSortByDisplayText]
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
FilterRow.InfoText = #1053#1072#1078#1084#1080#1090#1077' '#1079#1076#1077#1089#1100', '#1095#1090#1086#1073#1099' '#1085#1072#1089#1090#1088#1086#1080#1090#1100' '#1092#1080#1083#1100#1090#1088
NewItemRow.InfoText = #1053#1072#1078#1084#1080#1090#1077' '#1089#1102#1076#1072', '#1095#1090#1086#1073#1099' '#1076#1086#1073#1072#1074#1080#1090#1100' '#1085#1086#1074#1091#1102' '#1089#1090#1088#1086#1082#1091
OptionsBehavior.CopyCaptionsToClipboard = False
OptionsBehavior.ImmediateEditor = False
OptionsBehavior.IncSearch = True
OptionsBehavior.NavigatorHints = True
OptionsBehavior.CopyPreviewToClipboard = False
OptionsBehavior.PullFocusing = True
OptionsCustomize.ColumnsQuickCustomization = True
OptionsCustomize.DataRowSizing = True
OptionsData.Deleting = False
OptionsData.Inserting = False
OptionsView.Navigator = True
OptionsView.NoDataToDisplayInfoText = #1054#1090#1089#1091#1090#1089#1090#1074#1091#1102#1090' '#1076#1072#1085#1085#1099#1077
OptionsView.GroupByBox = False
OptionsView.HeaderAutoHeight = True
OptionsView.Indicator = True
Styles.Content = dmdMain.stGridContentEven
Styles.ContentEven = dmdMain.stGridContentEven
Styles.ContentOdd = dmdMain.stGridContentOdd
Styles.Selection = dmdMain.stGridSelection
Styles.Header = dmdMain.stGridHeader
object dbgCardBanksoftHistoryDBTableView1Column1: TcxGridDBColumn
Caption = #1058#1080#1087' '#1087#1088#1086#1076#1091#1082#1090#1072
DataBinding.FieldName = 'agreeproduct'
HeaderAlignmentVert = vaCenter
Width = 211
end
object dbgCardBanksoftHistoryDBTableView1Column2: TcxGridDBColumn
Caption = #1053#1086#1084#1077#1088' '#1076#1086#1075#1086#1074#1086#1088#1072
DataBinding.FieldName = 'agreenum'
HeaderAlignmentVert = vaCenter
Width = 108
end
object dbgCardBanksoftHistoryDBTableView1Column3: TcxGridDBColumn
Caption = #1053#1086#1084#1077#1088' '#1082#1072#1088#1090#1099
DataBinding.FieldName = 'absagreeid'
HeaderAlignmentVert = vaCenter
Width = 150
end
object dbgCardBanksoftHistoryDBTableView1Column4: TcxGridDBColumn
DataBinding.FieldName = 'agreeid'
Visible = False
HeaderAlignmentVert = vaCenter
VisibleForCustomization = False
end
end
object dbgCardBanksoftHistoryDBTableView2: TcxGridDBTableView
OnKeyDown = dbgCardBanksoftHistoryDBTableView2KeyDown
NavigatorButtons.ConfirmDelete = False
NavigatorButtons.First.Hint = #1055#1077#1088#1074#1072#1103' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.PriorPage.Hint = #1055#1077#1088#1077#1081#1090#1080' '#1085#1072' '#1087#1088#1077#1076#1099#1076#1091#1097#1091#1102' '#1089#1090#1088#1072#1085#1080#1094#1091
NavigatorButtons.PriorPage.Visible = False
NavigatorButtons.Prior.Hint = #1055#1088#1077#1076#1099#1076#1091#1097#1072#1103' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.Next.Hint = #1057#1083#1077#1076#1091#1102#1097#1072#1103' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.NextPage.Hint = #1055#1077#1088#1077#1081#1090#1077' '#1085#1072' '#1089#1083#1077#1076#1091#1102#1097#1091#1102' '#1089#1090#1088#1072#1085#1080#1094#1091
NavigatorButtons.NextPage.Visible = False
NavigatorButtons.Last.Hint = #1055#1086#1089#1083#1077#1076#1085#1103#1103' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.Last.Visible = True
NavigatorButtons.Insert.Hint = #1044#1086#1073#1072#1074#1083#1077#1085#1080#1077' '#1079#1072#1087#1080#1089#1080
NavigatorButtons.Insert.Visible = False
NavigatorButtons.Append.Hint = #1044#1086#1073#1072#1074#1083#1077#1085#1080#1077' '#1079#1072#1087#1080#1089#1080' '#1074' '#1082#1086#1085#1077#1094
NavigatorButtons.Delete.Hint = #1059#1076#1072#1083#1080#1090#1100' '#1079#1072#1087#1080#1089#1100
NavigatorButtons.Delete.Visible = False
NavigatorButtons.Edit.Hint = #1056#1077#1076#1072#1082#1090#1080#1088#1086#1074#1072#1085#1080#1077' '#1079#1072#1087#1080#1089#1080
NavigatorButtons.Edit.Visible = False
NavigatorButtons.Post.Hint = #1057#1086#1093#1088#1072#1085#1080#1090#1100' '#1080#1079#1084#1077#1085#1077#1085#1080#1103
NavigatorButtons.Post.Visible = False
NavigatorButtons.Cancel.Hint = #1054#1090#1084#1077#1085#1072' '#1080#1079#1084#1077#1085#1077#1085#1080#1081
NavigatorButtons.Cancel.Visible = False
NavigatorButtons.Refresh.Hint = #1054#1073#1085#1086#1074#1080#1090#1100
NavigatorButtons.Refresh.Visible = False
NavigatorButtons.SaveBookmark.Hint = #1057#1086#1093#1088#1072#1085#1080#1090#1100' '#1079#1072#1082#1083#1072#1076#1082#1091
NavigatorButtons.GotoBookmark.Hint = #1055#1077#1088#1077#1081#1090#1080' '#1082' '#1079#1072#1082#1083#1072#1076#1082#1077
NavigatorButtons.Filter.Hint = #1060#1080#1083#1100#1090#1088
NavigatorButtons.Filter.Visible = False
FilterBox.Position = fpTop
FilterBox.Visible = fvNever
DataController.DataModeController.SmartRefresh = True
DataController.DataSource = dsCardBanksoftHistory
DataController.DetailKeyFieldNames = 'agreeid'
DataController.Filter.Options = [fcoCaseInsensitive]
DataController.Filter.Active = True
DataController.Filter.TranslateBetween = True
DataController.Filter.TranslateIn = True
DataController.Filter.TranslateLike = True
DataController.Filter.SupportedLike = False
DataController.KeyFieldNames = 'agreeid'
DataController.MasterKeyFieldNames = 'agreeid'
DataController.Options = [dcoAnsiSort, dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoSortByDisplayText]
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
FilterRow.InfoText = #1053#1072#1078#1084#1080#1090#1077' '#1079#1076#1077#1089#1100', '#1095#1090#1086#1073#1099' '#1085#1072#1089#1090#1088#1086#1080#1090#1100' '#1092#1080#1083#1100#1090#1088
NewItemRow.InfoText = #1053#1072#1078#1084#1080#1090#1077' '#1089#1102#1076#1072', '#1095#1090#1086#1073#1099' '#1076#1086#1073#1072#1074#1080#1090#1100' '#1085#1086#1074#1091#1102' '#1089#1090#1088#1086#1082#1091
OptionsBehavior.CopyCaptionsToClipboard = False
OptionsBehavior.ImmediateEditor = False
OptionsBehavior.IncSearch = True
OptionsBehavior.NavigatorHints = True
OptionsBehavior.CopyPreviewToClipboard = False
OptionsBehavior.PullFocusing = True
OptionsCustomize.ColumnsQuickCustomization = True
OptionsCustomize.DataRowSizing = True
OptionsData.Deleting = False
OptionsData.Inserting = False
OptionsView.Navigator = True
OptionsView.NoDataToDisplayInfoText = #1054#1090#1089#1091#1090#1089#1090#1074#1091#1102#1090' '#1076#1072#1085#1085#1099#1077
OptionsView.GroupByBox = False
OptionsView.HeaderAutoHeight = True
OptionsView.Indicator = True
Styles.Content = dmdMain.stGridContentEven
Styles.ContentEven = dmdMain.stGridContentEven
Styles.ContentOdd = dmdMain.stGridContentOdd
Styles.Selection = dmdMain.stGridSelection
Styles.Header = dmdMain.stGridHeader
object dbgCardBanksoftHistoryDBTableView2Column1: TcxGridDBColumn
Caption = #1042#1072#1083#1102#1090#1072
DataBinding.FieldName = 'curc'
Width = 60
end
object dbgCardBanksoftHistoryDBTableView2Column2: TcxGridDBColumn
Caption = #1044#1072#1090#1072
DataBinding.FieldName = 'expdate'
Width = 110
end
object dbgCardBanksoftHistoryDBTableView2Column3: TcxGridDBColumn
Caption = #1055#1088#1086#1089#1088#1086#1095#1082#1072
DataBinding.FieldName = 'expno'
Width = 69
end
object dbgCardBanksoftHistoryDBTableView2Column4: TcxGridDBColumn
Caption = #1052#1080#1085#1080#1084#1072#1083#1100#1085#1099#1081' '#1087#1083#1072#1090#1077#1078
DataBinding.FieldName = 'minplat'
Width = 130
end
end
object dbgCardBanksoftHistoryLevel1: TcxGridLevel
GridView = dbgCardBanksoftHistoryDBTableView1
object dbgCardBanksoftHistoryLevel2: TcxGridLevel
GridView = dbgCardBanksoftHistoryDBTableView2
end
end
end
Первый уровень наполняется так:
SELECT DISTINCT agreeproduct, agreenum, absagreeid, agreeid
FROM (SELECT /*+ ordered */
a.agreeid,
TO_CHAR (a.absagreeid) AS absagreeid,
serv.getrefstr
(22,
a.agreeproductgroup
)
|| ' - '
|| serv.getrefstr (13, agreeproduct)
AS agreeproduct,
agreenum, bs.acccurc AS curc,
accrestdate AS expdate,
SUM
(CASE
WHEN accrest IS NULL
AND accrestdebit IS NULL
THEN NULL
WHEN accrest IS NULL
AND accrestdebit IS NOT NULL
THEN -accrestdebit
WHEN accrest IS NOT NULL
AND accrestdebit IS NULL
THEN accrest
ELSE NULL
END
) OVER (PARTITION BY a.absagreeid ORDER BY accrestdate)
AS expno,
cardimport.calcsaldoonminplat
(cardimport.calckeyforaccno
(cardaccno,
cardimport.getsyncaccnoone
(2)
),
accrestdate
) minplat
FROM agree a, banksoft_history bs
WHERE a.clientid = v_cli_id
AND bs.accnotype = 10001
AND a.agreetype = 2
AND bs.agreeid = a.agreeid
ORDER BY absagreeid, expdate DESC)
WHERE expno > 0
второй уровень так (примерно так же, чуть-чуть по другому):
SELECT *
FROM (SELECT /*+ ordered */
TO_CHAR (a.absagreeid) AS absagreeid,
serv.getrefstr
(22,
a.agreeproductgroup
)
|| ' - '
|| serv.getrefstr (13, agreeproduct)
AS agreeproduct,
agreenum, bs.acccurc AS curc,
accrestdate AS expdate,
SUM
(CASE
WHEN accrest IS NULL
AND accrestdebit IS NULL
THEN NULL
WHEN accrest IS NULL
AND accrestdebit IS NOT NULL
THEN -accrestdebit
WHEN accrest IS NOT NULL
AND accrestdebit IS NULL
THEN accrest
ELSE NULL
END
) OVER (PARTITION BY a.absagreeid ORDER BY accrestdate)
AS expno,
cardimport.calcsaldoonminplat
(cardimport.calckeyforaccno
(cardaccno,
cardimport.getsyncaccnoone
(2)
),
accrestdate
) minplat, a.agreeid
FROM agree a, banksoft_history bs
WHERE a.clientid = v_cli_id
AND bs.accnotype = 10001
AND a.agreetype = 2
AND bs.agreeid = a.agreeid
ORDER BY absagreeid, expdate DESC)
WHERE expno > 0
[/more]
Добавлено:
Жду ответа как полечить можно, а то пользователи съедят