Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a parameter to a Crystal Report 1

Status
Not open for further replies.

Alkemac

IS-IT--Management
Jun 3, 2003
23
0
0
ZA
I have a VB6 Application, using Crystal Reports 10 and SQL Svr 2000.

In the Crystal Report (GH3A) Group header, I have a formula (@FinancialSummary), which calculates a date string based on a field in the table. However, I'd like to pass it the value from my code. The code I use to call the report is as follows:-

Set rptMain = rptApp.OpenReport("\\sdnwres01\statements\CrystalReports\Statement.rpt")
rptMain.DiscardSavedData
rptMain.ExportOptions.DiskFileName = "\\Joh-d001460\statements\" & RTrim(Text6.Text) & "\Bakwena\Acc 100000 to 199999 - " & Text6.Text & ".pdf"
rptMain.RecordSelectionFormula = ExclStr
rptMain.ExportOptions.DestinationType = crEDTDiskFile
rptMain.ExportOptions.FormatType = crEFTPortableDocFormat
rptMain.Export False
rptMain.DiscardSavedData
Set rptMain = Nothing
Screen.MousePointer = vbDefault

What do I need to add to the above code to pass @FinancialSummary a string that I want printed on the report ?

Thanks
 
strFormulaText = "blah, blah, blah"
rptMain.FormulaFields.GetItemByName("FinancialSummary").Text = Chr(34) & strFormulaText & Chr(34)

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top