Solved

VB coding for Crystal report version 6  and above.

Posted on 2001-08-08
6
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

732 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