Page 1 of 1
"Report save name" in preview
Posted: Fri Apr 27, 2007 10:40 am
by Fabio Pagano
Assume this (vb) code:
Code: Select all
Dim rpt As New Stimulsoft.Report.StiReport
rpt.LoadPackedDocument("c:\foo.mdz")
rpt.Show()
If in the preview i choose "Save", the proposed report name is "Report" and the default extension is ".mdc". I would have expected a save default as "foo.mdz". Is there a way to accomplish this? I have found that setting (before the show method):
gives (in the "Save") the correct name to the report, but the proposed extension is always ".mdc", not ".mdz".
In a few words, i need to open a previously saved packed document and, if i click "Save", the dialog must default to save on the document (file) just opened.
Hope i have been clear.
Thanks.
"Report save name" in preview
Posted: Fri Apr 27, 2007 11:37 am
by Fabio Pagano
About the report name in the save dialog i have solved, it simply assumes the original reportname.
Now, i only don't know how to default to the ".mdz" extension when i click "Save" in the preview.
Thanks.
"Report save name" in preview
Posted: Sat Apr 28, 2007 10:52 am
by Vital
Please call this code at start of your program:
Code: Select all
StiConfig.Services.Remove(typeof(Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService));
StiConfig.Services.Remove(typeof(Stimulsoft.Report.SaveLoad.StiPackedDocumentSLService));
StiConfig.Services.Add(new Stimulsoft.Report.SaveLoad.StiPackedDocumentSLService());
StiConfig.Services.Add(new Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService());
Thank you.
"Report save name" in preview
Posted: Sun Apr 29, 2007 4:55 am
by Fabio Pagano
Ok, it works, thanks.
I have tried something more: i only want to give the ability to save only in compressed format, so i have put this VB code in FormLoad event:
Code: Select all
Stimulsoft.Report.StiConfig.Services.Remove(GetType(Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService))
Stimulsoft.Report.StiConfig.Services.Remove(GetType(Stimulsoft.Report.SaveLoad.StiPackedDocumentSLService))
Stimulsoft.Report.StiConfig.Services.Add(New Stimulsoft.Report.SaveLoad.StiPackedDocumentSLService())
But the ability to save in uncompressed format (mdc) remains.
Using V2007.1.
Thanks.
"Report save name" in preview
Posted: Sun Apr 29, 2007 6:12 am
by Vital
In this case you can use following code:
Code: Select all
StiServiceContainer services = StiConfig.Services.GetServices(typeof(Stimulsoft.Report.SaveLoad.StiDocumentSLService));
foreach (StiService service in services)
{
if (service is Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService)
{
service.ServiceEnabled = false;
}
}
Thank you.
"Report save name" in preview
Posted: Fri May 04, 2007 6:46 am
by Fabio Pagano
I have translated in VB the above code:
Code: Select all
Dim services As Stimulsoft.Base.Services.StiServiceContainer = Stimulsoft.Report.StiConfig.Services.GetServices(GetType(Stimulsoft.Report.SaveLoad.StiDocumentSLService))
For Each service As Stimulsoft.Base.Services.StiService In services
If service Is Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService Then
service.ServiceEnabled = False
End If
Next
But in the row:
Code: Select all
If service Is Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService Then
the editor gives the following error:
"StiXmlDocumentSLService is a type in SaveLoad and cannot be used as an espression".
Actually i have solved using the following code instead of the offending line:
Code: Select all
If service.ServiceName.ToLower = "stixmldocumentslservice" Then
but, of course, i don't like it too much.
May you help me?
Thanks.
"Report save name" in preview
Posted: Fri May 04, 2007 9:39 am
by Edward
Please use the VB.Net code in the following form (it is a direct translation of Vital's code)
Code: Select all
Dim services As Stimulsoft.Base.Services.StiServiceContainer =
Stimulsoft.Report.StiConfig.Services.GetServices(GetType(Stimulsoft.Report.SaveLoad.StiDocumentSLService))
Dim service As Stimulsoft.Base.Services.StiService
For Each service In services
If TypeOf service Is Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService Then
service.ServiceEnabled = False
End If
Next
Let us know if you need additional help.
Thank you.
"Report save name" in preview
Posted: Sun Aug 24, 2008 10:19 pm
by sphextor
Edward wrote:Please use the VB.Net code in the following form (it is a direct translation of Vital's code)
Code: Select all
Dim services As Stimulsoft.Base.Services.StiServiceContainer =
Stimulsoft.Report.StiConfig.Services.GetServices(GetType(Stimulsoft.Report.SaveLoad.StiDocumentSLService))
Dim service As Stimulsoft.Base.Services.StiService
For Each service In services
If TypeOf service Is Stimulsoft.Report.SaveLoad.StiXmlDocumentSLService Then
service.ServiceEnabled = False
End If
Next
Let us know if you need additional help.
Thank you.
but when i want to open filetype in open dialog misssing
help me pleae i want user to save .mdz and also open only .mdz
code in vb.net
thankyou
"Report save name" in preview
Posted: Thu Sep 04, 2008 6:27 am
by Edward
Hello.
Unfortunately there is no such an option in the Designer yet.
Thank you.