Skip to Content
0
Apr 27, 2018 at 03:05 PM

How do I populate a Formula Field?

93 Views Last edit May 01, 2018 at 06:06 PM 2 rev

I have a BASIC program that contains some Crystal Reports and I’m getting ready to add some more. Since all of the new reports use the same fields in the SQL database I would like to create one report and change the report title to match the data being retrieved by the LINQ query. For example: one report might be titled “AFL Systems Report” containing the “AFL System information” and another might be titled “PAF System Report” containing the “PAF System information.” On the report I created a Formula field named “SpecialReportTitle”. I placed the field on the report, but how do populate it?

I have the following code in the Main form which is called from a menu. CRV references the form containing the Report Viewer.

With CRV

.ReportData = arlReportData

Dim strTEMP As String = String.Format("{0}\Reports\{1}.rpt", My.Application.Info.DirectoryPath, strReportName)

.ReportName = strTEMP

.ShowDialog()

.Dispose()

End With