I want to send list of data to Stimulsoft, so in stimulsoft designer I have created a Data Source type of (object), just named it and pressed OK
Then I Dragged a DataBand and Named it "RoomReservations" and set the data source of this DataBand to the data source I just created (RoomReservationSource): Also I have put the desired Variables on the DataBand(these are just simple variables that I have created and dragged here) I created these variables because I need these data to receive from my .Net project
In my Controller in my .Net 6 project I have created a method and desired code to print Report:
public IActionResult Index()
{
StiReport invoice = new StiReport();
invoice["ContactPerson"] = "Jhon Doe";
var data = GetRoomReservations();
invoice.RegBusinessObject("RoomReservationSource", data);
invoice.Load(StiNetCoreHelper.MapPath(this, "wwwroot/Reports/Invoice.mrt"));
return StiNetCoreReportResponse.PrintAsPdf(invoice);
}
public List<RoomReservation> GetRoomReservations()
{
// Create a data source representing the list of room reservations
List<RoomReservation> roomReservations = new List<RoomReservation>
{
// Add sample room reservations
new RoomReservation { Date = DateTime.Now.ToString("dd MMM yyyy"), RoomType = "Standard", RoomNo = "101", Price = 100, Quantity = 3 },
new RoomReservation { Date = DateTime.Now.AddDays(1).ToString("dd MMM yyyy"), RoomType = "Deluxe", RoomNo = "201", Price = 150, Quantity = 2 },
new RoomReservation { Date = DateTime.Now.AddDays(2).ToString("dd MMM yyyy"), RoomType = "Suite", RoomNo = "301", Price = 200, Quantity = 1 },
new RoomReservation { Date = DateTime.Now.AddDays(3).ToString("dd MMM yyyy"), RoomType = "Standard", RoomNo = "102", Price = 100, Quantity = 4 },
new RoomReservation { Date = DateTime.Now.AddDays(4).ToString("dd MMM yyyy"), RoomType = "Deluxe", RoomNo = "202", Price = 150, Quantity = 2 }
};
return roomReservations;
}
Eventhough it sends the basic variable there but the DataBand is empty and doesn't show the list of data in Report, is there something wrong with my code?
how can I achieve this?

