procedure TForm1.Button1Click(Sender: TObject); procedure SaveFR3CompTxtToIni(aTmpFrxComp:TfrxComponent); var i:Integer; tmpFrxComp:TfrxComponent; begin for i:=0 to aTmpFrxComp.Objects.Count-1 do begin tmpFrxComp:=aTmpFrxComp.Objects[i]; if tmpFrxComp is TfrxMemoView then begin //Memo1.Lines.Add(TfrxMemoView(tmpFrxComp).Name+' **** '+TfrxMemoView(tmpFrxComp).Text); 这里,自已写代码...将 TfrxMemoView(tmpFrxComp).Text 保存到一个ini中,同时记录下"TfrxMemoView(tmpFrxComp).Name".
下一步,你还要用XE写一个导入程序,和这个代码差不多,也是frxReport1.LoadFromFile,再循环,再把INI中对应的值,填进去. end else begin SaveFR3CompTxtToIni(tmpFrxComp); end; end; end; begin
procedure TForm1.Button1Click(Sender: TObject); var aIniFile:TIniFile; sUpGradeOKFileName:string; aStream:TMemoryStream;
procedure SaveFR3CompTxtToIni(aTmpFrxComp:TfrxComponent); var i:Integer; tmpFrxComp:TfrxComponent; begin for i:=0 to aTmpFrxComp.Objects.Count-1 do begin tmpFrxComp:=aTmpFrxComp.Objects[i];
if tmpFrxComp is TfrxBarcode2DView then begin aIniFile.WriteString('TfrxBarcode2DView',TfrxBarcode2DView(tmpFrxComp).Name,kBase64Encode(TfrxBarcode2DView(tmpFrxComp).Text)); end else if tmpFrxComp is TfrxMemoView then begin aIniFile.WriteString('TfrxMemoView',TfrxMemoView(tmpFrxComp).Name,kBase64Encode(TfrxMemoView(tmpFrxComp).Text)); end else if tmpFrxComp is TfrxDBCrossView then begin aIniFile.WriteString('TfrxDBCrossView',TfrxDBCrossView(tmpFrxComp).Name+'.CellFields.Text',kBase64Encode(TfrxDBCrossView(tmpFrxComp).CellFields.Text)); aIniFile.WriteString('TfrxDBCrossView',TfrxDBCrossView(tmpFrxComp).Name+'.ColumnFields.Text',kBase64Encode(TfrxDBCrossView(tmpFrxComp).ColumnFields.Text)); aIniFile.WriteString('TfrxDBCrossView',TfrxDBCrossView(tmpFrxComp).Name+'.RowFields.Text',kBase64Encode(TfrxDBCrossView(tmpFrxComp).RowFields.Text)); end else begin SaveFR3CompTxtToIni(tmpFrxComp); end; end; end; begin sUpGradeOKFileName:=sGetTmpDir+'UpGradeOK'; DeleteFile(sUpGradeOKFileName);
ADOQuery1.SQL.Text:='SELECT * FROM REPORTS ORDER BY ID'; try ADOQuery1.Open; except ShowMessage('无法从数据库中读取旧的报表文件!'+#13 +ADOQuery1.ConnectionString); Exit; end;
//该程序,是放在system目录下 with AdoQuery1 do begin First; while not Eof do begin