I've been playing with this demo version for a while now.. taking things slow. Any ways, I can't figure out how to turn off the the save, open, new page, and edit page buttons on the preview window, as well as, certain export features. I really just want a bare bones print preview and maybe export to pdf, jpg & tiff. I'm hopeful there's an easy way to do this using VB. Here's my current code. When I click on the print button in my Winforms app, a very simple report is generated.
Private Sub PrintToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripButton.Click
Me.Cursor = Cursors.WaitCursor
Dim report As New Stimulsoft.Report.StiReport
Dim drv As DataRowView = DirectCast(Me.MyBindingSource.Current, DataRowView)
Dim clientName As String = drv("ClientName")
Dim drv2 As DataRowView = DirectCast(Me.BindingSource2.Current, DataRowView)
Dim _locationName As String = drv2("LocationName")
report.Load("MyReport.mrt")
report.Compile()
report("ClientName") = clientName
report("LocationName") = _locationName
report.Show()
Me.Cursor = Cursors.Default
End Sub
Turn Stuff Off
Turn Stuff Off
Hello.
Please use the following code:
And here is the code for disabling of the export services as well:
Thank you.
Please use the following code:
Code: Select all
'Do this operation once when running the program
StiConfig.Load()
'Get service
Dim Config As StiViewerConfigService = TryCast(StiConfig.Services.GetService(GetType(StiViewerConfigService)), StiViewerConfigService)
'Turn off all unnecessary buttons
Config.PageNewEnabled = False
Config.PageDeleteEnabled = False
Config.PageDesignEnabled = False
Config.PageSizeEnabled = False
'Save configuration if necessary
StiConfig.Save()
Code: Select all
StiConfig.Load()
Dim Services As StiServiceContainer = StiConfig.Services.GetServices(GetType(StiExportService))
For Each Service As StiService In Services
If TypeOf Service Is StiBmpExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiCsvExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiEmfExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiGifExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiJpegExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiPdfExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiRtfExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiTiffExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiTxtExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiXmlExportService Then Service.ServiceEnabled = False
Next Service
StiConfig.Save()
Turn Stuff Off
I get this error on my form:
Type 'StiViewerConfigService' is not defined.
I'm thinking I'm missing an Imports statement or something?
Type 'StiViewerConfigService' is not defined.
I'm thinking I'm missing an Imports statement or something?
Turn Stuff Off
Hello,
Please use StiPreviewConfigService instead StiViewerConfigService if you are use 2008.1 or previous. If you use 2008.2 add reference to Stimulsoft.Report.Win.dll assembly.
Thank you.
Please use StiPreviewConfigService instead StiViewerConfigService if you are use 2008.1 or previous. If you use 2008.2 add reference to Stimulsoft.Report.Win.dll assembly.
Thank you.