Export Dashboard
-
- Posts: 52
- Joined: Wed May 17, 2017 10:14 pm
Export Dashboard
I have Dashboards.win 2019.3.1. Is there any way to export a dashboard programmatically?
-
- Posts: 52
- Joined: Wed May 17, 2017 10:14 pm
Re: Export Dashboard
I want to clarify. I need to export a Dashboard to a pdf in a Winforms application. I currently have Dashboards.win 2019.3.1.
-
- Posts: 6337
- Joined: Tue Mar 20, 2018 5:34 am
Re: Export Dashboard
Hello,
Please check the following sample:
https://github.com/stimulsoft/Samples-D ... 0Dashboard
Thank you.
Please check the following sample:
https://github.com/stimulsoft/Samples-D ... 0Dashboard
Thank you.
-
- Posts: 52
- Joined: Wed May 17, 2017 10:14 pm
Re: Export Dashboard
Thank you. My programming language is VB.net. I was able to convert it from c# and simplify it.
Here is the code I came up with for anyone that is interested.
Imports Stimulsoft.Report
Imports System.IO
Private Function GetDashboard() As StiReport
Dim reportPath = Application.StartupPath & "\Dashboards\Christmas.mrt"
Dim report = StiReport.CreateNewDashboard()
report.Load(reportPath)
Return report
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim report = Me.GetDashboard()
Dim fileName = If(String.IsNullOrEmpty(report.ReportAlias), report.ReportName, report.ReportAlias)
Dim file As New System.IO.FileStream(fileName & ".pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write)
report.ExportDocument(StiExportFormat.Pdf, file)
file.Close()
End Sub
Here is the code I came up with for anyone that is interested.
Imports Stimulsoft.Report
Imports System.IO
Private Function GetDashboard() As StiReport
Dim reportPath = Application.StartupPath & "\Dashboards\Christmas.mrt"
Dim report = StiReport.CreateNewDashboard()
report.Load(reportPath)
Return report
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim report = Me.GetDashboard()
Dim fileName = If(String.IsNullOrEmpty(report.ReportAlias), report.ReportName, report.ReportAlias)
Dim file As New System.IO.FileStream(fileName & ".pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write)
report.ExportDocument(StiExportFormat.Pdf, file)
file.Close()
End Sub
-
- Posts: 6337
- Joined: Tue Mar 20, 2018 5:34 am
Re: Export Dashboard
Hello,
Thank you for the provided code.
Thank you for the provided code.