Solved

Retrieve the number of pages of a group with Crystal Report and VB(S)

Posted on 2009-07-14
2
475 Views
Last Modified: 2013-12-25
The Crystal Reports consists of a group with approximatively 500 elements.
For each of these elements I want to get the number of pages.
(Each element stands for a client for which a couple of pages have to be printed separately)

Sub main

Dim Application

Dim Report

Dim objPageGen

Dim varGroupPath

 

' Export nach CSV mit VB-Script:

 

Set Application = CreateObject("CrystalRuntime.Application.9")

Set Report = Application.OpenReport("C:\CH\Test\Neu\Test1.rpt",1)

	

	varGroupPath = Array(0,1)

	

	' this should retrieve the numbers of pages of this specific group, but 

	'which it does not

	Set objPageGen = Report.PageEngine.CreatePageGenerator(varGroupPath)

    MsgBox objPageGen.Pages.Count

      

       

       

End sub

Open in new window

0
Comment
Question by:Solu
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 50 total points
ID: 24856286
As far as I know there is no way to determine that value.

You could run the report for each client individually and get the number of pages.

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now