Problem with StiConfig
Posted: Tue Jan 03, 2012 4:27 am
Hello again,
I have following problem:
I have a program, which i want to control mainly via command line. The parameters for the command line, are "template" (which is the mrt-file), "report" (which is the disered target file) and "autosave" which indicates, if the programm shall save the file automatically or wait for the user to do it. The parameter "report" shall contains the desired type of file, like 'report="c:\test.pdf"', or 'report="c:\test.docx"', and so on.So if autosave is false, the programm shall disable all export-formats, except for the one in the report-parameter.
This is the code for this part of my program:
The problem is, that if i start the program twice, everytime with different export-formats, at the second time there are no export-formats left. First i tried to put StiConfig.Restore() in front of StiConfig.Load(), but it didn't work, because all the export-formats appeared again, everytime i ran the program.
Is there a way to store the StiConfig-settings only for one Session of the Program?
I hope you understood my problem.
Regards.
I have following problem:
I have a program, which i want to control mainly via command line. The parameters for the command line, are "template" (which is the mrt-file), "report" (which is the disered target file) and "autosave" which indicates, if the programm shall save the file automatically or wait for the user to do it. The parameter "report" shall contains the desired type of file, like 'report="c:\test.pdf"', or 'report="c:\test.docx"', and so on.So if autosave is false, the programm shall disable all export-formats, except for the one in the report-parameter.
This is the code for this part of my program:
Code: Select all
Dim services As Stimulsoft.Base.Services.StiServiceContainer = Stimulsoft.Report.StiConfig.Services.GetServices(GetType(StiExportService))
Dim service As StiService
StiConfig.Load()
If ext = ".pdf" Then
For Each service In services
If TypeOf service Is StiPdfExportService Then
service.ServiceEnabled = True
Else
service.ServiceEnabled = False
End If
Next
ElseIf ext = ".docx" Then
For Each service In services
If TypeOf service Is StiWord2007ExportService Then
service.ServiceEnabled = True
Else
service.ServiceEnabled = False
End If
Next
ElseIf ext = ".xls" Then
For Each service In services
If TypeOf service Is StiExcel2007ExportService Then
service.ServiceEnabled = True
Else
service.ServiceEnabled = False
End If
Next
ElseIf ext = ".csv" Then
For Each service In services
If TypeOf service Is StiCsvExportService Then
service.ServiceEnabled = True
Else
service.ServiceEnabled = False
End If
Next
ElseIf ext = ".png" Then
For Each service In services
If TypeOf service Is StiPngExportService Then
service.ServiceEnabled = True
Else
service.ServiceEnabled = False
End If
Next
ElseIf ext = ".rtf" Then
For Each service In services
If TypeOf service Is StiRtfExportService Then
service.ServiceEnabled = True
Else
service.ServiceEnabled = False
End If
Next
ElseIf ext = ".odt" Then
For Each service In services
If TypeOf service Is StiOdtExportService Then
service.ServiceEnabled = True
Else
service.ServiceEnabled = False
End If
Next
End If
StiConfig.Save()
Is there a way to store the StiConfig-settings only for one Session of the Program?
I hope you understood my problem.
Regards.