Print Page | Close Window

Port Crystal VB6 Code to .NET Crystal API

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005-2015
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
Printed Date: 13 Aug 2020 at 3:27pm

Topic: Port Crystal VB6 Code to .NET Crystal API
Posted By: keithf1138
Subject: Port Crystal VB6 Code to .NET Crystal API
Date Posted: 22 Jun 2015 at 8:24am
So I am moving some Crystal Report logic from VB6 to .NET. For some of the more complex reports the code sets the value for grouping. I figured out how to set the 1st item in the SortFields array. What I cant find is how to set the first item in the GroupSortFields array because well GroupSortFields doesnt exist in the .NET API. I have a number of reports that uses this syntax and need to get the code that invokes them converted. Amazes me that this isnt simply documented, but I havent found anything.

Here is a simplified version of the VB6 code

CR1.ReportFileName = fullPathAndFileNameToRpt
CR1.Connect = dataConnectionString
CR1.ParameterFields(0) = "SortField;" & rptParameter & ";TRUE"
CR1.SelectionFormula = ""{Manager_Category1.List}"="SomeValue""
CR1.GroupSortFields(0) = "Sum({@ABSWeightedValue},{Manager_Category1.Category1})"
CR1.SortFields(0) = "{@ABSWeightedValue}"
CR1.PrinterStartPage = 1
CR1.PrinterStopPage = 1

Also can you tell me what GroupSortFields and SortFields map into the report?

Posted By: keithf1138
Date Posted: 26 Jun 2015 at 5:03am
Wow is this such a hack that no one knows how to accomplish the same thing with .NET code. I am just asking not being critical. I inherited this code base and never did a great deal of Crystal Reports work so just looking for some help to get these final few reports executing properly.

Print Page | Close Window