The header string cannot be replaced after upgrading to version 8.5
Posted: Thu Mar 28, 2019 4:05 am
Hello administrator
I upgraded ScaleRichView to version 8.5 today, but now I find that the substitution of header string cannot work properly, please help me have a look. thank you
I upgraded ScaleRichView to version 8.5 today, but now I find that the substitution of header string cannot work properly, please help me have a look. thank you
Code: Select all
///Change the header code//////////////////////////////////////////////////
for i := 0 to SRichViewEdit1.RVHeader.ItemCount-1 do
begin
if SRichViewEdit1.RVHeader.RVData.GetItemStyle(i) = rvsTable then
begin
TableTmp := TRVTableItemInfo(SRichViewEdit1.RVHeader.RVData.GetItem(i));
for tmpRow := 0 to TableTmp.RowCount-1 do
begin
for tmpCol := 0 to TableTmp.ColCount-1 do
begin
if TableTmp.Cells[tmpRow,tmpCol]<>nil then
begin
RVData := TableTmp.Cells[tmpRow,tmpCol].GetRVData;
for tmpTtemNO:=0 to RVData.ItemCount -1 do
begin
tmpCSID := Trim(RVData.GetItemTag(tmpTtemNO));
if (Trim(tmpCSID)<>'') and (Trim(tmpCSID)<>'DoctorID') then
begin
tmpCSJG := GetFieldLocation(tmpCSID);
if Trim(tmpCSJG) <> '' then
RVData.SetItemTextW(tmpTtemNO, WideString(tmpCSJG));
end;
end;
end;
end;
end;
end else begin
tmpCSID := Trim(SRichViewEdit1.RVHeader.GetItemTag(i));
if (Trim(tmpCSID)<>'') and (Trim(tmpCSID)<>'DoctorID') then
begin
tmpCSJG := GetFieldLocation(tmpCSID);
if Trim(tmpCSJG) <> '' then
SRichViewEdit1.RVHeader.SetItemTextEdW(i, WideString(tmpCSJG));
end;
end;
end;
//Change the body code//////////////////////////////////////////////////
for i := 0 to SRichViewEdit1.RichViewEdit.ItemCount-1 do
begin
if SRichViewEdit1.RichViewEdit.RVData.GetItemStyle(i) = rvsTable then
begin
TableTmp := TRVTableItemInfo(SRichViewEdit1.RichViewEdit.RVData.GetItem(i));
for tmpRow := 0 to TableTmp.RowCount-1 do
begin
for tmpCol := 0 to TableTmp.ColCount-1 do
begin
if TableTmp.Cells[tmpRow,tmpCol]<>nil then
begin
RVData := TableTmp.Cells[tmpRow,tmpCol].GetRVData;
for tmpTtemNO:=0 to RVData.ItemCount -1 do
begin
tmpCSID := Trim(RVData.GetItemTag(tmpTtemNO));
if (Trim(tmpCSID)<>'') and (Trim(tmpCSID)<>'DoctorID') then
begin
tmpCSJG := GetFieldLocation(tmpCSID);
if Trim(tmpCSJG) <> '' then
RVData.SetItemTextW(tmpTtemNO, WideString(tmpCSJG));
end;
end;
end;
end;
end;
end else begin
tmpCSID := Trim(SRichViewEdit1.RichViewEdit.GetItemTag(i));
if (Trim(tmpCSID)<>'') and (Trim(tmpCSID)<>'DoctorID') then
begin
tmpCSJG := GetFieldLocation(tmpCSID);
if Trim(tmpCSJG) <> '' then
SRichViewEdit1.RichViewEdit.SetItemTextEdW(i, WideString(tmpCSJG));
end;
end;
end;