Results 1 to 6 of 6

Thread: [2005] VB.Net -> Crystal Reports C++ Runtime Error

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    65

    Question [2005] VB.Net -> Crystal Reports C++ Runtime Error

    Hey Guys,

    WOW BusinessObjects.com is hard to navigate and find good info! Hence I pose my question to you learned folk…

    I have an issue with Crystal Reports included with VS.Net 2005. Please see the screen shot of the error attached.

    This error message is displayed when trying to view a report using the Crystal Reports viewer. I am using the push data method, i.e I create and populate a dataset and then ‘push’ it onto the report. I then set the report source for the viewer and call show for the form – all standard stuff. Now this all works beautifully BUT if I switch between other applications before the report is displayed I am greeted with this error message (attached):

    Runtime Error!

    Program: <AppPath>

    R6025
    -pure virtual function call

    Upon clicking OK my whole app catastrophically fails, down she goes….

    All the code is sitting inside Try, Catch, Finally blocks so any error produced by my code *should* be caught. Could anything about my code be provoking this situation?

    Obvious answer: Don’t switch between apps! But the report can take up to a couple of minutes to display, users have work to do. Further more it should be possible just by principle – I mean that’s the whole reason behind a multitasking environment.

    I attempted the obvious solution and went searching for any service packs or hot fixes but none have been released yet for 2005 (as far as I can see – please correct me if not).

    Some code:
    VB Code:
    1. Private Sub ShowExecRpt()
    2.  
    3.             Dim objRpt As New crExecRpt
    4.             Dim objExecData As xsExecRpt
    5.  
    6.             'Gather the data
    7.             objExecData = cRptDataEngine.BuildExecData()
    8.  
    9.             'Sort the data and push onto report
    10.             objRpt.SetDataSource(SortDataSet(objExecData))
    11.  
    12.             'Set the print options
    13.             objRpt.PrintOptions.PaperSize = CrystalDecisions.[Shared].PaperSize.PaperA3
    14.             objRpt.PrintOptions.PaperOrientation = CrystalDecisions.[Shared].PaperOrientation.Landscape
    15.  
    16.             'Display the report
    17.             ShowRpt(objRpt, "Executive Summary " & DateTime.Now.ToString(cMain.conDateFormat))
    18.  
    19.             objRpt.Dispose()
    20.             objRpt = Nothing
    21.  
    22.             If Not objExecData Is Nothing Then
    23.                 objExecData.Dispose()
    24.                 objExecData = Nothing
    25.             End If
    26.         End Sub
    27.  
    28.     Public Shared Sub ShowRpt(ByVal objRpt As Object, ByVal sWindText As String, Optional ByVal sEndDate As String = "")
    29.             'Open the report form with window txt passed in. Set the report EndDate param to passed value.
    30.  
    31.             Dim frmRptViewInst As frmRptView
    32.             Dim paramField As CrystalDecisions.Shared.ParameterField
    33.             Dim discreteVal As CrystalDecisions.Shared.ParameterDiscreteValue
    34.             Dim paramFields As CrystalDecisions.Shared.ParameterFields
    35.  
    36.             frmRptViewInst = New frmRptView
    37.             frmRptViewInst.MdiParent = cMain.frmMDIMain
    38.  
    39.             Try
    40.                 If sEndDate <> "" Then
    41.  
    42.                     discreteVal = New CrystalDecisions.Shared.ParameterDiscreteValue
    43.  
    44.                     discreteVal.Value = sEndDate
    45.  
    46.                     paramField = New CrystalDecisions.Shared.ParameterField
    47.  
    48.                     paramField.ParameterFieldName = "EndDate"
    49.                     paramField.CurrentValues.Add(discreteVal)
    50.  
    51.                     paramFields = New CrystalDecisions.Shared.ParameterFields
    52.  
    53.                     paramFields.Add(paramField)
    54.  
    55.                     frmRptView.crView.ParameterFieldInfo = paramFields
    56.                 End If
    57.  
    58.                 frmRptViewInst.crView.ReportSource = objRpt
    59.                 frmRptViewInst.Text = sWindText
    60.                 frmRptViewInst.Show()
    61.  
    62.             Catch ex As Exception
    63.                 MessageBox.Show("An error occured while attempting to display the report." & vbCr & _
    64.                                 "The report cannot be displayed." & vbCr & vbCr & _
    65.                                 "Please contact your System Administrator.", "Marketing Reports", MessageBoxButtons.OK, MessageBoxIcon.Information)
    66.                 cMain.WriteErrorLog("frmCampRpt::ShowRpt()" & vbTab & ex.Message)
    67.             End Try
    68.  
    69.         End Sub
    This code works EVERYTIME I keep focus on my app, if I switch to another app the error message is displayed right before the viewer actually renders the report. Its definately making it to 'frmRptView.Show()' because the form pops up, the viewers controls are all placed along the top and then BOOM error!

    Tearing my hair out! Looks like it may be in the CR runtime? It occurs on my both my Dev machine and end users machines. Occurs when running from the IDE or exe on my Dev box. I have deployed the CR.Net 2005 merge modules to the client machines using an MSI built in VS2005.

    Apologies for the length of the post but trying to provide as much info as possible.

    Many thanks in advance for any suggestions, ideas or possible solutions.
    Matt.
    Attached Images Attached Images  
    Last edited by GottaGetITDone; Aug 29th, 2006 at 11:40 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width