Can not display data from .mrt template file
Posted: Tue Sep 13, 2011 4:08 am
load the mrt file , and preview,it is nothing on page,read nothing from the server.the mrt file contains sqlconnectionstring .
Reporting tool and data analytics tools for creating reports and dashboards in ASP.NET, ASP.NET MVC, .NET Core, Blazor, Angular, PHP, Python, WPF, JavaScript, and Java applications.
https://forum.stimulsoft.com/
Code: Select all
_context = new ScreenContext();
_context.Load(_context.GetTable_1Query(), LoadBehavior.RefreshCurrent, true).Completed += (sender1, arg1) =>
{
var lstobj = (from p in _context.Table_1s select p).ToList();
report.RegBusinessObject("Table_1", "Table_1", _context.Table_1s);
report.Dictionary.SynchronizeBusinessObjects(3);
report.Render();
viewerControl.Report = report;
};
Code: Select all
public Page2()
{
InitializeComponent();
StiReport report = new StiReport();
InitializeComponent();
using (Stream stream = this.GetType().Assembly.GetManifestResourceStream("HRApp.Report.OM_BaoCaoDSBanHangTheoHD.mrt"))
{
if (stream == null)
throw new Exception();
report.Load(stream);
}
_context = new ScreenContext();
_context.Load(_context.GetTable_1Query(), LoadBehavior.RefreshCurrent, true).Completed += (sender1, arg1) =>
{
var lstobj = (from p in _context.Table_1s select p).ToList();
report.RegBusinessObject("Table_1", "Table_1", _context.Table_1s);
report.Dictionary.SynchronizeBusinessObjects(3);
report.Render();
viewerControl.Report = report;
};
//report.Dictionary.Databases.Clear();
//report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", @"Provider=SQLNCLI10.1;Persist Security Info=False;User ID=sa;Initial Catalog=eBiz4DApp;Data Source=TOANND-PC\TOANND;password=P@ssw0rd"));
// report.Dictionary.Restrictions.Add("sptest", StiDataType.DataSource, StiRestrictionTypes.DenyEdit);
//report.CompiledReport.DataSources["sptest"].Parameters["@opt"].ParameterValue = 1;
}
Code: Select all
public IQueryable<Table_1> GetTable_1()
{
return this.ObjectContext.Table_1;
}