Report-Viewer is crashing

Stimulsoft Reports.NET discussion
Post Reply
mietzekotze
Posts: 39
Joined: Tue Dec 20, 2011 8:07 am
Location: Germany

Report-Viewer is crashing

Post by mietzekotze »

Hey Guys,

i have following problem:

I'm trying to run your software via command line, so you can give the program parameters, but the problem is, when i'm trying to show the report, the preview-windo crashes. If i do it via GUI it works fine. Unfortunatly i have no Idea where the mistake is, maybe you can tell me. This is the sourcecode:

Code: Select all

Imports Stimulsoft.Report
Imports Stimulsoft.Report.Dictionary
Imports Stimulsoft.Base.Drawing
Imports Stimulsoft.Report.Components
Imports Stimulsoft.Base
Imports Stimulsoft.Base.Serializing
Imports Stimulsoft.Controls
Imports Stimulsoft.Report.CodeDom
Imports Stimulsoft.Report.Design

Module Module1
    Dim paraDic As New Dictionary(Of String, String)
    Sub Main()
        Dim parm = Command()
        Parameter(parm)
        Dim Report As New StiReport
        Report.Load(paraDic.Item("dir"))
        Report.Show()

        'Console.WriteLine(CompiledReportFileName)
        Console.ReadLine()
    End Sub

    Sub Parameter(ByVal args As String)

        Dim words As String() = args.ToString.Split("|")
        Dim word As String
        For Each word In words
            'Console.WriteLine(word)

            If word.Contains("dir") Then
                Dim splitted As String() = word.Split("=")
                paraDic.Add(splitted(0), splitted(1))
                Console.WriteLine(splitted(1))
            End If

            If word.Contains("target") Then
                Dim splitted As String() = word.Split("=")
                paraDic.Add(splitted(0), splitted(1))
            End If



        Next
    End Sub

End Module
Regards
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Report-Viewer is crashing

Post by HighAley »

Hello.

Please, send us a sample project and step-by-step guide how to reproduce the issue.
What report do you get?

Thank you.
mietzekotze
Posts: 39
Joined: Tue Dec 20, 2011 8:07 am
Location: Germany

Report-Viewer is crashing

Post by mietzekotze »

I decided to use the GUI-Interface-version. Its much easier to use. But i still have a question:
Is it possible under VB.Net to disable Exportfunctions. For example i just want to export to pdf?

Regards
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Report-Viewer is crashing

Post by HighAley »

Hello.
mietzekotze wrote:I decided to use the GUI-Interface-version. Its much easier to use. But i still have a question:
Is it possible under VB.Net to disable Exportfunctions. For example i just want to export to pdf?
Please, try to use next code:

Code: Select all

StiConfig.Load()
Dim services As StiServiceContainer = StiConfig.Services.GetServices(GetType(StiExportService))

Dim service As StiService
For Each service In services
	If TypeOf service Is StiPdfExportService Then
		service.ServiceEnabled = true
	Else
		service.ServiceEnabled = false
	End If
Next

StiConfig.Save()
Thank you.
mietzekotze
Posts: 39
Joined: Tue Dec 20, 2011 8:07 am
Location: Germany

Report-Viewer is crashing

Post by mietzekotze »

Unfortunatly this code doesnt work for me.

This is my project, maybe you'll be able to find my mistake.
http://www.mediafire.com/file/7mmws0rhr ... Viewer.zip
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Report-Viewer is crashing

Post by Stephan1 »

Hi MietzeKotze,

Try this:

Dim Services As Stimulsoft.Base.Services.StiServiceContainer = Stimulsoft.Report.StiConfig.Services.GetServices(GetType(StiExportService))
Dim service As StiService
For Each service In Services
If TypeOf service Is StiPdfExportService Then
service.ServiceEnabled = True
Else
service.ServiceEnabled = False
End If
Next

P.S: Achja: Cooler name :byebye:
mietzekotze
Posts: 39
Joined: Tue Dec 20, 2011 8:07 am
Location: Germany

Report-Viewer is crashing

Post by mietzekotze »

Stephan1 wrote: Dim Services As Stimulsoft.Base.Services.StiServiceContainer = Stimulsoft.Report.StiConfig.Services.GetServices(GetType(StiExportService))
Dim service As StiService
For Each service In Services
If TypeOf service Is StiPdfExportService Then
service.ServiceEnabled = True
Else
service.ServiceEnabled = False
End If
Next
That did the trick. Thanks :D
Stephan1 wrote: P.S: Achja: Cooler name :byebye:
Danke :biggrin:
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Report-Viewer is crashing

Post by Andrew »

Hello Stephan1,

Thank you for sharing your experience.

Thank you.
Post Reply