Hi,
We are doing a PoC using Stimulsoft for our new project. Basically we are doing a feasibility study to finalize whether stimulsoft can be used in our project. So, I need to know whether we can set data source to Designer web dynamically. What I did was set the SqlDataSource from the code to my report before it set to the StiWebDesigner. My code looks like follows.
protected void Page_Load(object sender, EventArgs e)
{
var report = new StiReport();
var webReport = new StiWebReport();
string appDirectory = HttpContext.Current.Server.MapPath(string.Empty);
report.Load(appDirectory + "\\Reports\\ReportTemplate.mrt");
var sqlDataSource = new SqlDataSource
{
ConnectionString = @"Data Source=(local)\TEST;Initial Catalog=ABC;User ID=user;Password=user123",
SelectCommand = "SELECT [OrganizationName], [Address], [Country] FROM [Organization]"
};
webReport.RegData(report, "ReportConnection", sqlDataSource);
designer1.Design(report);
}
I can see the data source "ReportConnection" in my designer web, but data will not be showed. Appreciate your help on this.
Thanks,
Hasitha.
Dynamically set data source to designer web
Dynamically set data source to designer web
Hello, Hasitha.
Please, see an attached project.
Thank you.
Please, see an attached project.
Thank you.
- Attachments
-
- 1370.Sample.zip
- (288.4 KiB) Downloaded 419 times
Dynamically set data source to designer web
Thank you....
Dynamically set data source to designer web
Have a great day!