Error on Report but only on deployed code.

Stimulsoft Reports.NET discussion
Post Reply
spv123
Posts: 26
Joined: Mon Oct 02, 2006 8:07 am
Location: Sheffield, UK

Error on Report but only on deployed code.

Post by spv123 »

When I generate my report on my development machine from within Visual Studio, reports generate fine.

However, I'm having a problem with generating some reports on my released version (it works on some reports but consistently having the same problem on certain other reports).

The report is very simple - it consists of 60 formula fields set to "{FieldX}" ie x=1 to 60 to display a variable.

The code sets all the variables and then compiles and renders the form.

The variables are all preset to null in the form (ie it previews ok in the designer).

I get an error on the compile/render phase. The error raised is no 5 and is described as "c:\DOCUME~1\spv\LOCALS~1\Temp\su1tfkr.0.vb(556,0) : error BC30205: End of statement expected.

This same report works in other circumstances (running through the same code but with different data).

I'm guessing it's a problem with the variables but I can't think a) what, or b) how to fix it!

Anybody any thoughtsd on how I can trace the problem down further so I can fix it ?

Thanks in advance
Simon
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Error on Report but only on deployed code.

Post by Vital »

Please check what version of StimulReport.Net you are use on development machine and on other macnihes.

Please provide your code - how you initialize variables.

Thank you.
spv123
Posts: 26
Joined: Mon Oct 02, 2006 8:07 am
Location: Sheffield, UK

Error on Report but only on deployed code.

Post by spv123 »

The versions of stimulsoft on both machines is identical (the version on the deployed system is installed by the installer created by my project.

The code generating the report is :

Code: Select all

Private Function CreateStimulReport(ByVal FormName As String, ByVal FieldNames() As String, ByVal FieldData() As String) As Stimulsoft.Report.StiReport

        ' Create and Return Report

        Dim tmpReport(0) As Stimulsoft.Report.StiReport
        tmpReport(0) = New Stimulsoft.Report.StiReport


        tmpReport(0).Load("c:\dms\forms\" & FormName & ".mrt")
        Dim PageNo As Int32 = 0
        Dim dct As Int32 = FieldNames.GetLength(0) - 1
        For cnt As Int32 = 0 To dct

            If FieldNames(cnt) = "@PAGE" Then
                ' Create New Page
                If tmpReport(PageNo).Pages.Count > 0 Then
                    tmpReport(PageNo).Compile()
                    tmpReport(PageNo).Render()
                    If PageNo > 0 Then tmpReport(0).RenderedPages.AddRange(tmpReport(PageNo).RenderedPages)
                    ReDim Preserve tmpReport(tmpReport.GetLength(0))
                    PageNo = PageNo + 1
                    tmpReport(PageNo) = New Stimulsoft.Report.StiReport
                    tmpReport(PageNo).Load("c:\dms\forms\" & FormName & ".mrt")

                End If
            Else

                Try
                    Debug.WriteLine("Setting Field [" & FieldNames(cnt) & "] = " & FieldData(cnt))
                    If FieldData(cnt).StartsWith(" ") Then FieldData(cnt) = Chr(30) & FieldData(cnt)
                    tmpReport(PageNo).Dictionary.Variables(FieldNames(cnt)).Value = FieldData(cnt).TrimEnd(" ")
                Catch
                    Debug.WriteLine("Err with field & " & FieldNames(cnt) & "  = " & Err.Description)
                End Try
            End If

        Next
        Try
            If tmpReport(PageNo).Pages.Count > 0 Then

                tmpReport(PageNo).Compile()
                tmpReport(PageNo).Render()
                If PageNo > 0 Then tmpReport(0).RenderedPages.AddRange(tmpReport(PageNo).RenderedPages)
            End If
        Catch
            MsgBox("error = " & Err.Number & " " & Err.Description)  [color=red]<------ it hits this line[/color]
        End Try

        ' tmpReport(0).Show()
        Return tmpReport(0)
    End Function
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Error on Report but only on deployed code.

Post by Vital »

Can you say what type of variables you are use and assign?
Please send your report to support [at] stimulsoft [dot] com.

Thank you.
spv123
Posts: 26
Joined: Mon Oct 02, 2006 8:07 am
Location: Sheffield, UK

Error on Report but only on deployed code.

Post by spv123 »

The variables are all string variables, and the data being set is all string (the form is being used to pick up a report from a "legacy" unix system via a socket call and render onto a report which has company logo's etc on it.)

I'll email the report now from my hotmail account.
Post Reply