I am using VB6.0 with Crystal Reports 8.5 on WIN2000.
What I am trying to do is during runtime import string statement into the report using a recordset or without loading records in the report viewer.
On the report viewer, I have the following code:
This is posted in the declaration section of the form.
Dim Report As New CRAXDRT.Report
I have the following code in the Form_Load event of the report viewer form.
Dim StatusMsg1, StatusMsg2, StatusMsg3, StatusMsg4, StatusMsg5, StatusMsg6
Select Case selection 'Form name selected in the forms
'which is stored in the
set Report = new rpt_ManufacturerReport
me.caption = " Manufacturer's Report
Set Report = new rpt_StatusReport
Me.caption = "Status Report"
StatusMsg1 = "Process is complete"
StatusMsg2 = "There were 500 Manufacturer's."
StatusMsg3 = "There were 600 Price Check's."
StatusMsg4 = "There were 200 Return's."
StatusMsg5 = "There are 800 customer's."
StatusMsg6 = "There are 100 prospects."
Report.FormulaFields(1).Text = "'" & StatusMsg1 & "'"
Report.FormulaFields(2).Text = "'" & StatusMsg2 & "'"
Report.FormulaFields(3).Text = "'" & StatusMsg3 & "'"
Report.FormulaFields(4).Text = "'" & StatusMsg4 & "'"
Report.FormulaFields(5).Text = "'" & StatusMsg5 & "'"
Report.FormulaFields(6).Text = "'" & StatusMsg6 & "'"
rst.open SQLStatement, strConn, adOpenKeyset, adLockBatchOptimistic
I also set some properties for displaying the report viewer.
Report.PaperOrientation = 2
CRviewer1.ExableExportButton = true
Then load and display the CRviewer.
CRviewer1.ReportSource = report ,etc.
I would like to send the text fields to Crystal Report. This code works when I use only the first three text fields. I if use all six fields, I get a blank report with the error "This does not seem be a formula. Cannot process the remaining items."
On the report viewer, I name each formula with the variable names (StatusMsg1, StatusMsg2, etc.) above. So the report has six formulas with the same name. The index value after the field property is the sequence of the formula in the Crystal Report. I also have to put a "placeholder" string value for each formula field in the reportEditor screen.
How can I make this work so that all six string statements are transferred directly into and displayed in the Cystral Report not using a recordset to popoulate the CRviewer and then, using a recordset to populate the CRViewer?
Is there a better way?
Thanks, for your help.