Integrating Stimulsoft Ultimate with ASP.NET Core MVC
Posted: Tue Jun 25, 2024 3:46 am
I hope everyone is doing well! I’m currently working on a project where I need to integrate Stimulsoft Ultimate with an ASP.NET Core MVC application, and I could use some guidance from those of you who have experience with this.
geometry dash
Project Overview:
- Stimulsoft Ultimate 2024
- SQL Server 2019
- Export reports in various formats (PDF, Excel, etc.).
- Implement role-based access to different reports.
Current Progress:
- Integrated the Stimulsoft Viewer in a Razor View.
Challenges:
Code Snippet:
Here’s a snippet of my current setup in the controller:
Questions:
- Is there a more efficient way to pass parameters to the report?
- How can I handle different export formats based on user selection (PDF, Excel, etc.)?
- What are the best practices for managing report templates within the project structure?
I would really appreciate any advice, examples, or resources you could provide. Thanks in advance for your help!
geometry dash
Project Overview:
- Environment:
- Stimulsoft Ultimate 2024
- SQL Server 2019
- Requirements:
- Export reports in various formats (PDF, Excel, etc.).
- Implement role-based access to different reports.
Current Progress:
- Setup:
- Integrated the Stimulsoft Viewer in a Razor View.
- Database Connection:
Challenges:
- Dynamic Data Sources:
- Custom Report Parameters:
- Role-Based Access:
Code Snippet:
Here’s a snippet of my current setup in the controller:
Code: Select all
public IActionResult GenerateReport()
{
var report = new StiReport();
report.Load("Reports/MyReport.mrt");
// Pass parameters
report.Dictionary.Variables["UserId"].Value = User.Identity.GetUserId();
// Render report
var stream = new MemoryStream();
report.ExportDocument(StiExportFormat.Pdf, stream);
stream.Position = 0;
return File(stream, "application/pdf", "Report.pdf");
}
- Is there a more efficient way to pass parameters to the report?
- How can I handle different export formats based on user selection (PDF, Excel, etc.)?
- What are the best practices for managing report templates within the project structure?
I would really appreciate any advice, examples, or resources you could provide. Thanks in advance for your help!