Posted on 2014-07-11
Last Modified: 2015-02-06
We have a legacy VB6 project which is being brought forward to VB.NET and it uses the Crystal Reports DLL crpe32.dll to set up and print reports.

We are using PEAddParameterCurrentValue to set the value of one of the parameters in the report. The function returns success, but the when the report prints, the parameter field is blank.

The structure being used for passing the value is as follows:

  Public Structure peValueInfo
    Dim StructSize As Short
    Dim ValueType As Short
    Dim ViNumber As Double
    Dim ViCurrency As Double
    Dim ViBoolean As Integer
    <VBFixedString(PE_VI_STRING_LEN), MarshalAs(UnmanagedType.ByValTStr, SizeConst:=PE_VI_STRING_LEN)> _
      Dim ViString As String
    <VBFixedArray(2), MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> _
      Dim ViDate() As Short
    <VBFixedArray(5), MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> _
      Dim ViDateTime() As Short
    <VBFixedArray(2), MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> _
      Dim ViTime() As Short
    Dim ViColor As Integer
    Dim ViInteger As Short
    Dim ViC As Byte
    Dim Ignored As Byte
    Dim ViLong As Integer
    Public Sub Initialize()
      ReDim ViDate(2)
      ReDim ViDateTime(5)
      ReDim ViTime(2)
    End Sub
  End Structure
Question by:DSLSystems
    1 Comment
    LVL 100

    Accepted Solution

    WHat version of Crystal are you using?

    What version of VS.Net?

    The .Net assemblies are different than the VB6 methods.

    Here is one method

    There are guides on the SAP site that show how to convert from the .COM (VB6) methods to the .Net assemblies.

    If I can find them I will post the link.  I have the urls on my machine at home.


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    This video discusses moving either the default database or any database to a new volume.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now