Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread ReportBuilder Conversion
Thu, May 1 2008 7:37 AMPermanent Link

"Al Vas"
Hi,

We have an extensive number of ReportBuilder reports (both standard and
customised by clients).  Has anyone performed the task of doing a conversion
from V3.30 of DBISAM to ElevateDB?  What is required and is it difficult?

TIA

Alex
Thu, May 1 2008 8:17 AMPermanent Link

Uli Becker
Al,

> We have an extensive number of ReportBuilder reports (both standard and
> customised by clients).  Has anyone performed the task of doing a
> conversion from V3.30 of DBISAM to ElevateDB?  What is required and is
> it difficult?

I am just working on the migration of a complex application from DBISAM
3.3 to EDB.
Concerning ReportBuilder there is just nothing to change.
Since the data-pipelines refer to a TDataSource it is 100% compatible.

Regards Uli
Thu, May 1 2008 12:10 PMPermanent Link

"Terry Swiers"
Alex,

> We have an extensive number of ReportBuilder reports (both standard and
> customised by clients).  Has anyone performed the task of doing a
> conversion from V3.30 of DBISAM to ElevateDB?  What is required and is it
> difficult?

If you are using DBISAMTable and DBISAMQuery objects connected to the report
via DataPipelines as Uli indicated in his message, you shouldn't have to do
anything at all since the reports are not database specific.

But if you are like me, I use DADE objects to handle the data retrieval as
well as use binary templates with a header at the front of the template to
store custom data which makes the conversion a bit more difficult.  The
following is the entire code unit that I'm going to be using to convert my
DBISAM4 RB templates to EDB RB tamplates.  It pulls out the header, converts
the binary template to text, replaces the object, converts it back to
binary, inserts the header into the file stream, and then saves the
template.

If you are not using a report header and offset, you can just strip out that
portion of the code.  And if you are using text templates, you can just load
the files directly into the stringlist and do the component replacement.

Hope this helps.

//>>> Start unit rbdbi2edb
unit rbdbi2edb;

interface

uses
 Classes, SysUtils, Dialogs;

type

 TemplateHeader = packed record
   HeaderID: LongInt;
   Offset: LongInt;
   //Add additional custom data here
   end;

   function ConvertFormat( FileName : String ) : Boolean;

const
 cHeaderID = $F0000001;

implementation

function ConvertFormat(FileName: String): Boolean;

 function LoadBinary(FileName : String; StringList : TStringList;
   var Header : TemplateHeader) : Boolean;
 var
 lFileStream: TFileStream;
 lTextStream: TMemoryStream;
 lReadFrom : Integer;
 begin
 Result := False;

 lFileStream := TFileStream.Create(FileName, fmOpenRead);
 lTextStream := TMemoryStream.Create;

 lFileStream.Seek(0, soFromBeginning);
 lFileStream.Read(Header, SizeOf(TemplateHeader));
 if (Header.HeaderID = cHeaderID) then lReadFrom := Header.Offset
 else begin
   FillChar(Header, SizeOf(TemplateHeader), 0);
   lReadFrom := 0;
   end;

 try
 try
 lFileStream.Position := lReadFrom;
 ObjectBinaryToText(lFileStream, lTextStream);
 lTextStream.Position := 0;
 StringList.LoadFromStream(lTextStream);
 Result := True;
 except
 on E: Exception do begin
   ShowMessage(E.Message);
   end;
 end;
 finally
 lFileStream.Free;
 lTextStream.Free;
 end;
 end;

 function SaveBinary(FileName : String; StringList : TStringList;
   Header : TemplateHeader) : Boolean;
 var
 lFileStream: TFileStream;
 lTextStream: TMemoryStream;
 lWriter: TWriter;
 begin
 Result := False;
 DeleteFile(FileName);

 lFileStream := TFileStream.Create(FileName, fmCreate);
 lTextStream := TMemoryStream.Create;
 try
 StringList.SaveToStream(lTextStream);
 lTextStream.Position := 0;

 Header.HeaderID := cHeaderID; //make sure the header ID is set
 Header.Offset := Sizeof(TemplateHeader);
 lFileStream.Write(Header, SizeOf(TemplateHeader));

 ObjectTextToBinary(lTextStream, lFileStream);
 lWriter := TWriter.Create(lFileStream, 1024);
 try
 lWriter.WriteListEnd;
 finally
 lWriter.Free;
 end;
 lFileStream.Position := 0;
 Result := True;
 finally
 lFileStream.Free;
 lTextStream.Free;
 end;
 end;

 procedure ReplaceObject(OldObject, NewObject : String;
   StringList : TStringList);
 var
 n : Integer;
 begin
 for n := 0 to StringList.Count - 1 do
   StringList[n] := StringReplace(StringList[n], OldObject,
     NewObject, [rfReplaceAll, rfIgnoreCase]);
 end;

var
StringList : TStringList;
Header : TemplateHeader;
begin
Result := False;
StringList := TStringList.Create;
try
if LoadBinary(FileName, StringList, Header) then begin
 ReplaceObject('daDBISAMQueryDataView', 'daEDBQueryDataView',
   StringList);
 ReplaceObject('dtDBISAM', 'dtElevateDB', StringList);
 Result := SaveBinary(FileName, StringList, Header);
 end;
finally
StringList.Free;
end;
end;

end.
//>>> End unit rbdbi2edb

--

---------------------------------------
 Terry Swiers
 Millennium Software, LLC
 http://www.1000years.com
 http://www.atrex.com

 Atrex Inventory Control/POS -
    Big business features without spending big business bucks!

Atrex Electronic Support Options:
 Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
 Email: mailto:support@atrex.com
 Newsgroup: news://news.1000years.com/millennium.atrex
 Fax: 1-925-829-1851
 Phone: 1-925-828-5892 (M-F, 9a-5p Pacific)
 ---------------------------------------








Image