In MVC which technic is prefered to report design ,how to design report
Loading
In MVC which technic is prefered to report design ,how to design report
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 16, 2023, 11:41 PM EST
Hello Asht,
If you want to create simple report, you can refer below link:
https://www.c-sharpcorner.com/article/ssrs-report-in-asp-net-mvc-5/#:~:text=For%20creating%20a%20report%2C%20right,new%20window%20will%20pop%20up.
https://www.c-sharpcorner.com/article/display-data-in-report-viewer-with-mvc-4/
https://www.boldreports.com/blog/how-to-add-the-report-viewer-to-an-aspnet-mvc-application
Thanks
Naimish Makwana
Asht TRank #5,917 · 282 reputationPosted Feb 17, 2023, 12:12 AM EST
@Naimish Makwana Thank u....
I used same like
https://www.c-sharpcorner.com/article/ssrs-report-in-asp-net-mvc-5/#:~:text=For%20creating%20a%20report%2C%20right,new%20window%20will%20pop%20up.
this.....but if you use subreport then how to use using this method....actually my report is print receipt multiple... so for this create subreport ...but how to write code for subreport using same code
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 17, 2023, 12:19 AM EST
You can refer below link for subreport.
https://www.c-sharpcorner.com/UploadFile/54db21/ssrs-report-sub-report/
https://oakdome.com/programming/SSRS_UsingSubReports.php
Thanks
Tuhin PaulRank #7 · 71.9K reputationPosted Feb 17, 2023, 11:39 PM EST
Hi Naimish, in Asht's last reply, is he asking about "Stimulsoft.Report" or did I get wrong.
I have provided this sample code. Let me know if this is helpful.
Subreports can be used in ASP.NET Core MVC applications to design reports that contain additional detail. Here's how you can design a report using a subreport in ASP.NET Core MVC:
public IActionResult MyReport() { // Load the main report and its data source var mainReport = new Stimulsoft.Report.StiReport(); mainReport.Load("MyReport.mrt"); var mainDataSource = GetMainReportData(); // Load the subreport and its data source var subReport = new Stimulsoft.Report.StiReport(); subReport.Load("MySubReport.mrt"); var subDataSource = GetSubReportData(); // Set the subreport control's properties var subReportControl = mainReport.GetComponentByName("MySubreport") as Stimulsoft.Report.Components.StiSubReport; subReportControl.DataSource = subDataSource; subReportControl.SubReport = subReport; // Set the main report's data source and render the report mainReport.RegData(mainDataSource); mainReport.Render(); // Return the report as a PDF var reportStream = new MemoryStream(); mainReport.ExportDocument(Stimulsoft.Report.StiExportFormat.Pdf, reportStream); reportStream.Position = 0; return new FileStreamResult(reportStream, "application/pdf"); }In this example, GetMainReportData and GetSubReportData are methods that load the data for the main report and the subreport, respectively. You'll need to replace these with your own methods that load the appropriate data for your report.