Page 1 of 1
Sandisk U3 Application - DefaultReportSettingsPath
Posted: Tue Nov 04, 2008 8:56 am
by xfratboy
I'm working on a demo project that needs to run completely from a USB drive. I've noticed that some settings get written to the user\local settings\applications\ folder. How can a force Stimulsoft to maintain all settings and files within a different folder (e.g. System.Windows.Forms.Application.StartupPath).
I don't/can't have anything from my demo being written to the local computer. I know that I can massage the U3 settings to clean things up upon ejection of the USB drive, but it would be a lot easier and cleaner if I could just make that setting persist within stimulsoft's configuration somehow.
I'm coding in VB not C# and examples I've found are only in C#. Any ideas?
Sandisk U3 Application - DefaultReportSettingsPath
Posted: Tue Nov 04, 2008 10:54 am
by Edward
Hi.
You can use the following shared properties for setting of the default configuration report paths:
Code: Select all
Stimulsoft.Report.StiOptions.Configuration.DefaultReportConfigPath
Stimulsoft.Report.StiOptions.Configuration.DefaultReportSettingsPath
Stimulsoft.Report.StiOptions.Configuration.DirectoryLocalization
You must assign all these shared properites in a vaery beginning of your application when none of Stimulsoft Reports.Net objects have been created.
Thank you.
Sandisk U3 Application - DefaultReportSettingsPath
Posted: Tue Nov 04, 2008 10:18 pm
by xfratboy
So, I must be doing something wrong. I put this in the _load section of my form But I get this error:
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Stimulsoft.Report.StiOptions.Configuration.DefaultReportConfigPath = System.Windows.Forms.Application.StartupPath & "\MyFolder\"
Stimulsoft.Report.StiOptions.Configuration.DefaultReportSettingsPath = System.Windows.Forms.Application.StartupPath & "\MyFolder\"
Stimulsoft.Report.StiOptions.Configuration.DirectoryLocalization = System.Windows.Forms.Application.StartupPath & "\MyFolder\"
StiConfig.Load()
' ''Get service
Dim Config As Render.StiPreviewConfigService = TryCast(StiConfig.Services.GetService(GetType(Render.StiPreviewConfigService)), Render.StiPreviewConfigService)
' ''Turn off all unnecessary buttons
Config.PageNewEnabled = False
Config.PageDeleteEnabled = False
Config.PageDesignEnabled = False
Config.PageSizeEnabled = False
Config.OpenEnabled = False
Config.SaveEnabled = False
Config.ToolHandEnabled = False
Config.ToolEditorEnabled = False
' ''Save configuration if necessary
' ''StiConfig.Save()
' ''StiConfig.Load()
Dim Services As StiServiceContainer = StiConfig.Services.GetServices(GetType(StiExportService))
For Each Service As StiService In Services
If TypeOf Service Is StiTxtExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiXmlExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiOdsExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiOdtExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiMhtExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiExcelExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiExcelXmlExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiXpsExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiExcel2007ExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiWord2007ExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiHtmlExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiDbfExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiCsvExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiRtfExportService Then Service.ServiceEnabled = False
If TypeOf Service Is StiEmfExportService Then Service.ServiceEnabled = True
If TypeOf Service Is StiGifExportService Then Service.ServiceEnabled = True
If TypeOf Service Is StiJpegExportService Then Service.ServiceEnabled = True
If TypeOf Service Is StiPdfExportService Then Service.ServiceEnabled = True
If TypeOf Service Is StiTiffExportService Then Service.ServiceEnabled = True
If TypeOf Service Is StiBmpExportService Then Service.ServiceEnabled = True
Next Service
StiConfig.Save() <-- Object reference not set to an instance of an object.
End Sub
Sandisk U3 Application - DefaultReportSettingsPath
Posted: Thu Nov 06, 2008 7:08 pm
by Vital
Hello,
So, I must be doing something wrong. I put this in the _load section of my form But I get this error:
Please provide full error stack.
Thank you.