How To create a new report.
Hi I have all my reports stored in a Database. How I can create a new report
through a sql sentence.? My problem is with the "template" field, I always
get the same error, "template error".
I am doing the following :
Insert into dbo.report (report_id, report_template, report_nom,
report_modified, report_size) values (a,b,c,d,e).
But which value must have the report_template?
Best Regards and thanks in advance
through a sql sentence.? My problem is with the "template" field, I always
get the same error, "template error".
I am doing the following :
Insert into dbo.report (report_id, report_template, report_nom,
report_modified, report_size) values (a,b,c,d,e).
But which value must have the report_template?
Best Regards and thanks in advance
This discussion has been closed.
Comments
1. You need to save the report to a stream. You can use
Report.Template.SaveToStream to accomplish this.
2. The technique used by ReportBuilder to save reports to the database does
not use a SQL statement. It uses DatSet.Insert and DataSet.Post. For an
example see ppTmplat.pas, the method TppTemplate.SaveToSource.
3. We do not have an example using SQL statement to do this. I searched
Google Groups and found recommendations to use a parameterized query for the
blob value. Several responses said that is the only way to make it work.
myQuery.SQL.Text := "Insert into dbo.report (report_id, report_template,
report_nom,
report_modified, report_size) values (a,:TemplateValue,c,d,e)";
lBlobField := TBlobField(myQuery.ParamByName('TemplateValue'));
lBlobField.LoadFromStream(myReportStream); // or use load from file
--
Nard Moseley
Digital Metaphors Corporation
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com