Creating reports and dashboards | Stimulsoft community forum
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.
[Serializable]
class Person
{
string code, name;
public Person()
{
}
public string Code
{
get { return code; }
set { code = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
}
Person p = new Person();
p.Code = "JB";
p.Code = "Joe Bloggs";
StiReport report = new StiReport();
report.RegData("Person", p);
report.Design();
Also add the Assembly Reference to the report property "ReferencedAssemblies" so it knows where the Person class resides. You can do this from the Designer by select the Report object from the property grid and setting the property.
I couldn't add my fields in report.
1. add a stimulreport object in form1 --> stiReport1
2. add "TestStimulReport.exe" in its ReferencedAssemblies
3. call design for stiReport1
so what shall I do for find person class and properties?
Here's a vs2005 sample using 2007.3.0.0 stimulreport references (you may need to update the project references to whatever version you have installed) Download Link
When the designer is open you should see your registered object in there Dictionary here:
//Get Business object from Application
Person p = new Person();
p.Code = "JB";
p.Code = "Joe Bloggs";
//Load Designed Report
stiReport1.Load(@"C:\myReports\MyReport.mrt");
stiReport1.RegData("Person", p);
stiReport1.Show();
You can also register Business Objects in the report from design mode using:
1. From the Dictionary Add "New Data Source.."
2. Select "Data from Business Objects"
3. Type in the 'Name in Source' and 'Name' of your class "Person".
4. Press the 'Get Columns from Assembly' Button on the toolbar
5. Browse to your compiled assembly
6. Check the Business Objects and the Properties you wish to register as columns.
7. Click OK to add the data source structure for your business object so you can begin designing.
1. Some things to note is that your assembly must be compiled before you can use it as a lookup for a Data Source.
2. Any classes you wish to expose must be compiled as 'public class'. So if Person was just 'class Person' then it will not show. It must be exposed as 'public class Person' in your assembly.
3. Make sure to add the assembly name to the ReferencedAssemblies property of the Report.
4. You probably won't have any design time 'Preview' as there is no actual data registered with the report, this would have to be done at runtime.
2. Any classes you wish to expose must be compiled as 'public class'. So if Person was just 'class Person' then it will not show. It must be exposed as 'public class Person' in your assembly.