Load Rtm File
How can i load an existing RTM file to a database field ?
i try
ppReport1.Template.FileName := OpenDialog1.FileName;
ppReport1.Template.LoadFromFile;
ppReport1.Template.SaveToDatabase;
but every time it inserts a new record, and dont update over actual record.
--
Jorge C. Mosquera R.
Investigaci?n y Desarrollo
www.sitis.info
i try
ppReport1.Template.FileName := OpenDialog1.FileName;
ppReport1.Template.LoadFromFile;
ppReport1.Template.SaveToDatabase;
but every time it inserts a new record, and dont update over actual record.
--
Jorge C. Mosquera R.
Investigaci?n y Desarrollo
www.sitis.info
This discussion has been closed.
Comments
You need to be sure you are defining all the
Report.Template.DatabaseSettings properties or else ReportBuilder will not
know which record to save the template and will by default save it in a new
one. See the TppTemplate.DatabaseSettings topic in the ReportBuilder help
for more information.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
flexiblity I need. Some code snippets (for a Firebird DB with IBO):
lDesigner.Report.Template.SaveToStream(lMS);
SaveDBReport(aReportID, lMS);
procedure TfrmTRAKPrint.SaveDBReport(aReportID: integer; aStream:
TMemoryStream);
var
lTx: TIB_Transaction;
lDSQL: TIB_DSQL;
begin
lTx := CreateTransaction;
lDSQL := CreateDSQL(lTx, 'Update Reports set TheReport = :TheReport where
Report_ID = %d', [aReportID]);
try
lTx.StartTransaction;
try
lDSQL.Prepare;
lDSQL.Params[0].Assign(aStream);
lDSQL.ExecSQL;
Assert(lDSQL.RowsAffected = 1, Format('Rows Affected (%d) should equal
1 but does not.', [lDSQL.RowsAffected]));
lTx.Commit;
except
lTx.Rollback;
raise;
end;
finally
lDSQL.Free;
lTx.Free;
end;
end;
--
Ed Dressel
Team DM