Solved

VB coding for Crystal report version 6  and above.

Posted on 2001-08-08
6
163 Views
Last Modified: 2010-05-02
Hi,
How can I code in VB to let the user know how many pages for that particular report? And also allow user to select from start page to end page for user to preview or print?
Help appreciated.

Thanks.
0
Comment
Question by:coolkgy
6 Comments
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6366768
Are you using Report OCX in VB to access CR6. If so, the report itself will have all these options, when you do,

CrystalReport1.Action = 1

You could be able to preview, and also print clicking the print button either all pages or selected pages.

You dont need to code these things.

If you need details, let me know.
0
 
LVL 1

Expert Comment

by:frankylew
ID: 6366948
perhaps he/she want to know the details even before the report is loaded.
0
 

Expert Comment

by:ibrahim-darahem
ID: 6367594
I suggest to make a test report with the margines you specified, and then find the max. no. of records per page.
fix this no. in your application, then evry time you output a report, you have to get the no. of records in the recordset that will be supplied to the crystal report, use the max. recs/page and the no. of records in the recordset to find the no. of page for the report.

if you try this solution you have to include all filters you needed in the recordset you will supply to crystal report, and not use any filters with the crystal report itself.

i hope it helps.
0
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.

 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6367604
frankylew,
I was waiting to get response from coolkgy regarding that.

coolkgy,
Ok, if that is the case, you do the following. Hope you already have created the report using Crystal report and say, the report name is report1.rpt and is located in your VB application path. To open it from VB do this.:


1) Click Project/Components menu option.
   Select Crystal Report Control.

2) Put the Crystal Report Control to a form, from the toolbox.

3) Add a Command Button to form.

4) Put the code to Command1's Click Event as below:
'*******

Private Sub Command1_Click()
    CrystalReport1.ReportFileName = App.Path & "\report1.rpt"
    CrystalReport1.ReportTitle = "The Title you want"
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.Action = 1
End Sub

'*******


Hope This Helps.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7199851
Hi coolkgy,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.
    *** we don't know if Crystal Reports is the issue, so can't really say anyone is correct.

coolkgy, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7213417
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

930 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

10 Experts available now in Live!

Get 1:1 Help Now