4.0後續增加功能和修正Bug

修正的Bug:

1、報表設計工具,客戶端增加的報表名稱和分類,其它電腦無法看到

解決方法:

打開報表設計工具,修改ABQuery1的屬性FieldDefaultValues值爲下面的即可:

Ti_Group=Main,Ti_Tr_Guid=select dbo.Func_GetTreeGuid('Extend ReportType')

2、報表的cxGrid組件在解析SQL時,如果SQL的AS標題中有“|”時,會導致如下錯誤:

''ABcxGrid1ABcxGridDBBandedTableView1明細|240'' is not a valid component name.

 

 

解決方法:

在ABFrameworkcxGridU 單元中替換方法:

procedure TABcxGridDBBandedTableView.LoadColumnsFieldDef;
var
tempColumn:TcxGridDBBandedColumn;
tempIndex,
i:longint;
tempFieldDef:PABFieldDef;
tempHaveFieldEmptyStr ,
tempNoHaveFieldEmptyStr:boolean;
begin
if (Assigned(DataController)) and
(Assigned(DataController.DataSet)) and
(DataController.DataSet.Active) then
begin
ShowHourglassCursor;
try
BeginUpdate;
DataController.BeginUpdateFields;
try
if columncount>0 then
ClearItems;

GetExpProperty;

tempNoHaveFieldEmptyStr:=FNoHaveField=EmptyStr;
tempHaveFieldEmptyStr:=FHaveField=EmptyStr;
for i := 0 to DataController.DataSet.FieldCount-1 do
begin
if ((tempNoHaveFieldEmptyStr) or (ABPos(','+DataController.DataSet.Fields[i].FieldName+',',','+FNoHaveField +',')<=0)) and
((tempHaveFieldEmptyStr) or (ABPos(','+DataController.DataSet.Fields[i].FieldName+',',','+FHaveField+',')> 0)) then
begin
tempFieldDef:=ABFieldDefByFieldName(DataController.DataSet,
DataController.DataSet.Fields[i].FieldName
);
//SQL語句中的字段或數據字典中有定義的字段
if (NOT Assigned(tempFieldDef)) or (tempFieldDef.Fi_IsGridView) then
begin
// DataController.CreateItemByField(DataController.DataSet.Fields[I]);
tempColumn:= CreateColumn;

tempColumn.HeaderAlignmentHorz:=taCenter;
tempColumn.HeaderAlignmentVert:=TcxAlignmentVert.vaCenter;

tempColumn.DataBinding.FieldName := DataController.DataSet.Fields[i].FieldName;
if Name<>EmptyStr then
tempColumn.Name:=Name+StringReplace(DataController.DataSet.Fields[i].FieldName, '|', '_',[rfReplaceAll, rfIgnoreCase]);
ABReFreshCloumnAndControl(DataController.DataSource,DataController.DataSet.Fields[i],tempColumn);

if Assigned(tempColumn.Properties) then
tempColumn.Properties.ValidationOptions:=[evoRaiseException,evoShowErrorIcon,evoAllowLoseFocus];

if (DataController.DataSet.Fields[i].DataType in ABMemoDataType) or
(DataController.DataSet.Fields[i].DataType in ABBlobDataType) then
HeaderPopupMenu.AutoApplyBestFit:=False;

if (Assigned(tempFieldDef)) and (tempFieldDef.Fi_IsGridView) then
begin
tempColumn.HeaderHint:=tempFieldDef.Fi_Hint;

if (tempFieldDef.Field.FieldKind =fkCalculated) or
((Assigned(tempFieldDef.PMetaDef)) and ((tempFieldDef.PMetaDef.Fi_IsAutoAdd) or (tempFieldDef.PMetaDef.Fi_iscomputed))) then
begin
ABSetColumnReadOnlyOrNotEdit(tempColumn,True);
tempFieldDef.Fi_LockGridView :=true;
end
else if ((FReadOnlyField=EmptyStr) or (ABPos(','+tempFieldDef.Fi_Name+',',','+FReadOnlyField +',')<=0)) and
((FEditField=EmptyStr) or (ABPos(','+tempFieldDef.Fi_Name+',',','+FEditField+',')> 0)) then
begin
end
else
begin
ABSetColumnReadOnlyOrNotEdit(tempColumn,True);
tempFieldDef.Fi_LockGridView :=true;
end;

tempIndex:=tempFieldDef.Fi_GridColumnList.IndexOf(tempColumn.Name);
if tempIndex>=0 then
begin
tempFieldDef.Fi_GridColumnList.Objects[tempIndex]:=tempColumn;
end
else
begin
tempFieldDef.Fi_GridColumnList.AddObject(tempColumn.Name,tempColumn);
end;
end
else
begin
ABSetColumnReadOnlyOrNotEdit(tempColumn,True);
end;

if (Assigned(tempFieldDef)) and
(pos(ABEnterWrapStr,tempFieldDef.fi_Caption)>0) then
tempColumn.Position.LineCount:=ABGetSpaceStrCount(tempFieldDef.fi_Caption,ABEnterWrapStr);
end;
end;
end;
finally
DataController.EndUpdateFields;
EndUpdate;
end;
finally
HideHourglassCursor;
end;
end;
end;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章