load stimulsoft form inside a microsoft form
Posted: Thu Aug 04, 2011 1:56 pm
I am trying to create a windows form that contains several reports, each report is first written directly in stimulsoft with the options form include with the report. Here is a sample report of what i mean by a report and form in stimulsoft:
EngineV2
None;Black;2;Solid;False;4;Black
Transparent
Transparent
0,0.1,7.3,0.2
Arial,8
0,0,0,0
Text1
this report is a demo of my questions.
Black
Expression
c19b1d4fd9f940fb99d8252937adce4b
0.39,0.39,0.39,0.39
Page1
11
8.5
Letter
Arial,100
[50:0:0:0]
Control
96,72,80,40
OK
Microsoft Sans Serif,8
Black
96, 72
cmdShow
80, 40
Button
Microsoft Sans Serif,8
6cb9e104922c4d0f9b37ebedd7502245
0, 0
Form1
304, 232
Form1
System.Dll
System.Drawing.Dll
System.Windows.Forms.Dll
System.Data.Dll
System.Xml.Dll
Stimulsoft.Controls.Dll
Stimulsoft.Base.Dll
Stimulsoft.Report.Dll
Report
8/4/2011 1:33:28 PM
8/4/2011 1:09:55 PM
c3be4767b12f4e45be1371342016ec45
Report
Inches
2010.2.800
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;
namespace Reports
{
public class Report : Stimulsoft.Report.StiReport
{
public Report()
{
this.InitializeComponent();
}
#region StiReport Designer generated code - do not modify#endregion StiReport Designer generated code - do not modify
}
}
CSharp
END OF REPORT
END OF REPORT
My program that calls this needs to load first the form inside my programs form, on a new tab. I am trying to do this using VB .Net 2010. The code that shows how i am attempting to do this looks like this:
'When you click to show the report it goes to this:
Private Sub cmdShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdShowReport.Click, lstReports.DoubleClick
If lstReports.SelectedIndex -1 Then
'MessageBox.Show(lstReports.SelectedItem.ToString())
AddReportTab(lstReports.SelectedItem.ToString(), Application.StartupPath, "Demo.mrt")
End If
End Sub
'Which calls this form which i was hoping would load the stimulsoft form inside of the new tab:
Private Sub AddReportTab(ByVal rsReportName As String, ByVal rsReportLocation As String, ByVal rsReportFileName As String)
Dim loReportFormViewer As New Stimulsoft.Report.StiViewMode
Dim loViewer As New Stimulsoft.Report.Viewer.StiViewerControl
Dim loReport As New Stimulsoft.Report.StiReport
'create the tab for the report
Dim tpReportTab As New TabPage
tabsHistoricalReports.TabPages.Add(tpReportTab)
tabsHistoricalReports.SelectedTab = tpReportTab
tpReportTab.Text = rsReportName
loViewer.Dock = DockStyle.Fill
tpReportTab.Controls.Add(loViewer)
loReport.Load(rsReportLocation & "\" & rsReportFileName)
loViewer.Report = loReport
loReport.Show(True)
End Sub
can you tell me what I need to do to make this work right?
Thanks, Chris
EngineV2
None;Black;2;Solid;False;4;Black
Transparent
Transparent
0,0.1,7.3,0.2
Arial,8
0,0,0,0
Text1
this report is a demo of my questions.
Black
Expression
c19b1d4fd9f940fb99d8252937adce4b
0.39,0.39,0.39,0.39
Page1
11
8.5
Letter
Arial,100
[50:0:0:0]
Control
96,72,80,40
OK
Microsoft Sans Serif,8
Black
96, 72
cmdShow
80, 40
Button
Microsoft Sans Serif,8
6cb9e104922c4d0f9b37ebedd7502245
0, 0
Form1
304, 232
Form1
System.Dll
System.Drawing.Dll
System.Windows.Forms.Dll
System.Data.Dll
System.Xml.Dll
Stimulsoft.Controls.Dll
Stimulsoft.Base.Dll
Stimulsoft.Report.Dll
Report
8/4/2011 1:33:28 PM
8/4/2011 1:09:55 PM
c3be4767b12f4e45be1371342016ec45
Report
Inches
2010.2.800
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;
namespace Reports
{
public class Report : Stimulsoft.Report.StiReport
{
public Report()
{
this.InitializeComponent();
}
#region StiReport Designer generated code - do not modify#endregion StiReport Designer generated code - do not modify
}
}
CSharp
END OF REPORT
END OF REPORT
My program that calls this needs to load first the form inside my programs form, on a new tab. I am trying to do this using VB .Net 2010. The code that shows how i am attempting to do this looks like this:
'When you click to show the report it goes to this:
Private Sub cmdShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdShowReport.Click, lstReports.DoubleClick
If lstReports.SelectedIndex -1 Then
'MessageBox.Show(lstReports.SelectedItem.ToString())
AddReportTab(lstReports.SelectedItem.ToString(), Application.StartupPath, "Demo.mrt")
End If
End Sub
'Which calls this form which i was hoping would load the stimulsoft form inside of the new tab:
Private Sub AddReportTab(ByVal rsReportName As String, ByVal rsReportLocation As String, ByVal rsReportFileName As String)
Dim loReportFormViewer As New Stimulsoft.Report.StiViewMode
Dim loViewer As New Stimulsoft.Report.Viewer.StiViewerControl
Dim loReport As New Stimulsoft.Report.StiReport
'create the tab for the report
Dim tpReportTab As New TabPage
tabsHistoricalReports.TabPages.Add(tpReportTab)
tabsHistoricalReports.SelectedTab = tpReportTab
tpReportTab.Text = rsReportName
loViewer.Dock = DockStyle.Fill
tpReportTab.Controls.Add(loViewer)
loReport.Load(rsReportLocation & "\" & rsReportFileName)
loViewer.Report = loReport
loReport.Show(True)
End Sub
can you tell me what I need to do to make this work right?
Thanks, Chris