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!

CRW32 4.6.1 doesnot clear the Formulas(x) array.

Status
Not open for further replies.

Vimatogo

Programmer
May 10, 2000
1
0
0
DO
Helo.<br><br>I made 2 reports for a visual basic 5.0 aplication. Let say<br>report 'A' and 'B'. Report 'A' does not have any formula, but report 'B' does. I run both reports using code with only one crystal.ocx objet in my form. The first time&nbsp;&nbsp;I call report 'A' and print it to a window the report works right then i print report 'B' (with the formulas) and works fine too. But if try to print report 'A' again i have a runtime error (20510) &quot;Invalid Formula Name&quot;. I'm thinking that thing is when i pass from report 'B' to 'A' Crystal Report is searching for formulas from report 'B' that were not cleared. I'm right?. is there other solution rather than put another Crystalreport object in my form?.<br><br>Thanks for any help that may come from you.&nbsp;&nbsp;&nbsp;&nbsp;<br>
 
Dear Vimatogo,<br><br>Here's how I normally do it,<br>1. create i CReport object at main screen,<br>2. do a global function at module as follow :<br><br>Function PrintReport() As Boolean<br>&nbsp;&nbsp;&nbsp;mMain.MousePointer = vbHourglass<br>&nbsp;&nbsp;&nbsp;mMain.CReport.ReportFileName = RptPath + RptName ' report name<br>&nbsp;&nbsp;&nbsp;mMain.CReport.SelectionFormula = gString<br>&nbsp;&nbsp;&nbsp;mMain.CReport.Formulas(0) = gFormula0<br>&nbsp;&nbsp;&nbsp;mMain.CReport.Formulas(1) = gFormula1<br>&nbsp;&nbsp;&nbsp;mMain.CReport.PrintReport<br>&nbsp;&nbsp;&nbsp;If mMain.CReport.LastErrorNumber &lt;&gt; 0 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PrintReport = False<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mMain.MousePointer = vbDefault<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgBox mMain.CReport.LastErrorNumber &
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top