elsacarlsson
Programmer
When I try to insert a selection formula (group selection) from visual basic to my report, I get error msg 20515 : error in formula, the remaining part of the text doesn't seem to be a part of the formula, but when I paste it into the report, the formula works.
this is what the code looks like:
Public Sub ShowCrystalReport(CrystalCtrl as CrystalReport, StrReportName as String, StrHeading as String, Optional StrSelectionFormula as string)
Dim IntRunner as Integer, IntTemp as Integer
Dim StrDataFiles as String
StrDataFiles = App.Path & "\mydb.mdb"
With CrystalCtrl
.ReportFilename = App.Path & StrReportName
.DataFiles(0) = StrDataFiles
.IntTemp = .GetNSubreports
For IntRunner = 0 to IntTemp - 1
StrTemp = .GetNthSubreportName(IntRunner)
.SubreportToChange = StrTemp
.DataFiles(0) = StrDataFiles
Next
.SubreportToChange=""
.Destination = crptToWindow
.WindowTitle = StrHeading
.ParameterFields(1) = "RprtHeading;" & StrHeading & ";true"
.GroupSelectionFormula = StrSelectionFormula
.PrintReport
End With
End Sub
why doesn't it work?
furthermore, I want to have two pictures in the report header that the user of my application should be able to change at runtime (by setting the path). How do I solve this?
thanks in advance
this is what the code looks like:
Public Sub ShowCrystalReport(CrystalCtrl as CrystalReport, StrReportName as String, StrHeading as String, Optional StrSelectionFormula as string)
Dim IntRunner as Integer, IntTemp as Integer
Dim StrDataFiles as String
StrDataFiles = App.Path & "\mydb.mdb"
With CrystalCtrl
.ReportFilename = App.Path & StrReportName
.DataFiles(0) = StrDataFiles
.IntTemp = .GetNSubreports
For IntRunner = 0 to IntTemp - 1
StrTemp = .GetNthSubreportName(IntRunner)
.SubreportToChange = StrTemp
.DataFiles(0) = StrDataFiles
Next
.SubreportToChange=""
.Destination = crptToWindow
.WindowTitle = StrHeading
.ParameterFields(1) = "RprtHeading;" & StrHeading & ";true"
.GroupSelectionFormula = StrSelectionFormula
.PrintReport
End With
End Sub
why doesn't it work?
furthermore, I want to have two pictures in the report header that the user of my application should be able to change at runtime (by setting the path). How do I solve this?
thanks in advance