I am working on a WebApplication, and including a Telerik-Report in it. The normal way as described works well.
Now I'm trying to load the report definition from a Database, instead of having a file (request from the boss). So far, I've made it work with a temp-file, code is below. But this is far from nice coding.
My question: can I somehow give a string or stream to the report (instead of a file)?
My current code looks like this:
private readonly string __path = "C:\my-temp-directory\Reports\";
protected void Page_Load(object sender, EventArgs e) {
string contents = /** Get XML from Database **/;
File.WriteAllText(__path + "temp.trdx", contents); // <-- This file I want to omit.
if (!IsPostBack) {
this.reportViewer1.ReportSource.Identifier = "temp.trdx";
this.reportViewer1.ReportSource.IdentifierType = IdentifierType.TypeReportSource;
}
}
Thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…