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

Crystal Reports and VB 6 - Conditional NewPageAfter 1

Status
Not open for further replies.

jessicabailey

Programmer
Joined
Jul 24, 2003
Messages
14
Location
US
Hi,

I have a crystal report that I am generating using vb. In my code, when printing the report I suppress certain sections based on criteria the user has chosen. Here's my problem, the report has a NEWPAGEAFTER condition set on one of my groups, however, there are times that I will not need this NEWPAGEAFTER. The condition for my newpageafter is "not onlastrecord" does anyone know of a way to pass this condition to VB? I've tried and the only thing I've been able to do is set the newpageafter to true/false.

Here is an example of what I'm doing:

crxReport.Sections(11).Suppress = True 'GF5
crxReport.Sections(12).Suppress = True 'GF4
crxReport.Sections(13).Suppress = True 'GF3
crxreport.Sections(14).Suppress = False 'GF2
crxReport.Sections(14).NewPageAfter = True
crxReport.Sections(14).BackColor = vbWhite 'set dept footer color to white

I need to set a condition for section(14).newpageafter to read not onlastrecord when newpageafter is set to TRUE.

If anyone has any ideas I would love to hear them.

Thanks!

 
Have a look here: thread768-870989.

-dave
 
Thanks Dave, but looking at that post it appears that the conditional formulas are only available with CR9. I'm using 8.5. There is no reference to conditionalformulas when I look for them. Any other suggestions?
 
I think they included them in a hotfix. I've got version 8.5.0.674 of craxdrt.dll on my machine, and they're available. You could try downloading and installing the last developer hotfix they released for 8.5:

To test it, the call would look something like:
Debug.Print crxRpt.Sections(14).ConditionFormula(crSectionAreaEnableNewPageAfterConditionFormulaType)

-dave
 
After setting my values like this:

crxreport.sections(14).conditionformula(crsectionareaenablenewpageafterconditionformulatype) = "not onlastrecord"

my report formatted perfectly.

Thanks again for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top