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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass formula(0) from VB6 to a subreport of crystal report

Status
Not open for further replies.

143Aroul

Programmer
Jul 17, 2003
16
FJ
Hi,

i am calling a report from VB6 like the below
============================================================
strSQL = ""
strSQL = "{Tour_Detail.RefCode} = " & "'" & txtRefCode.Text & "'"
strSQL = strSQL & &quot; AND {Tour_Detail.Status} <> &quot; & &quot;'&quot; & &quot;DE&quot; & &quot;'&quot;

crpt1.Connect = &quot;DSN=Tour;UserId=;Password=;&quot;

crpt1.SelectionFormula = strSQL
crpt1.ProgressDialog = False
crpt1.Formulas(1) = &quot;flag = &quot; & &quot;'&quot; & &quot;Y&quot; & &quot;'&quot;
crpt1.ReportFileName = App.Path & &quot;\rptAgentCost.rpt&quot;
crpt1.PrintFileType = crptWinWord
crpt1.Destination = crptToFile
crpt1.PrintFileName = &quot;C:\Temp\&quot; & Trim(txtRefCode.Text) & &quot;.doc&quot;
crpt1.PrintReport
========================================================
the rptagentcost.rpt contain a subreport. In the subreport , i created a formula &quot;flag&quot;. when i run the program the &quot;flag&quot; value is not displaying in the subreport.

anyone can u give a solution to me?
 
Havent used sub reports for a while but try

crpt1.SubreportToChange = &quot;subreportname&quot;
crpt1.Formulas(1) = &quot;flag = &quot; & &quot;'&quot; & &quot;Y&quot; & &quot;'&quot;
crpt1.SubreportToChange = &quot;&quot;


Hope this helps.

 
thanks for your suggestion, but it does not work. But i changed the logic .
Instead of using formula, i used Parameter.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top