?
Solved

Crystal Report

Posted on 2011-03-16
14
Medium Priority
?
1,072 Views
Last Modified: 2012-08-13
I have designed a report into Crystal report7.0 and add in my vb6.0 project.
But when i add this report into my project, automatically a form created name form1 and CRVIEWER in it. now what must i do to use my report
Please assist me
0
Comment
Question by:crystal_Tech
[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
  • 5
  • 2
14 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 35149613
Which edition of CR7 do you have?
You need the developer edition to have the tools to call reports from the application.

What references and components for Crystal did you add to VB?

Check here for examples using the RDC
http://wiki.sdn.sap.com/wiki/display/BOBJ/Report+Designer+Component+SDK+COM+Samples

mlmcc
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35156000

crw32

Seagate Crystal Reports Pro Upgrade   7.0.0.0

component adding in vb project is  crystal report control


0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35159121
You can use the OCX - crystl32.ocx
https://smpdl.sap-ag.de/~sapidp/012002523100006015072008E/splitrpt.zip

OR the RDC - CRAXDRT.DLL - link above

I would recommend the RDC if you have it.

mlmcc
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:crystal_Tech
ID: 35164357

Given link is not opening

Problem loading page

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35165851
I uoloaded the file here

mlmcc
splitrpt.zip
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35166044

Sir
Currently i am Connecting crystal report like this

        CrystalReport1.ReportFileName = App.Path & "\LedgerPort.rpt"
        CrystalReport1.Connect = con
        CrystalReport1.DiscardSavedData = True
        CrystalReport1.RetrieveDataFiles        
        CrystalReport1.SelectionFormula = "{BDl.G_Name} = '" & Text1.text & "'"
       
            CrystalReport1.Password = Chr(10) & "******"
            CrystalReport1.Destination = crptToWindow
            CrystalReport1.Action = 1

and its working fine

But how to add this reports into vb project.
so no need to install seagate crystal report to the machine

I am gonna deploy this project.

0
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 35191613
>>so no need to install seagate crystal report to the machine

If you are deploying to machines, you must install the Crystal Reports runtime ( the DLL's that it needs to run).  You can bundle that with your app when you build your install.  If you are not using the limited version of crystal reports that comes with VB6, I believe you also need a development license, not a Pro license, so you get a deployment key (at least In the current versions).  If you are using the version included with VB6 (I forget what that was), you can deploy that version's runtime.

Google for deploying crystal reports VB6 and you will find lots of stuff, but very little for version 7 which is quite old (so is VB6).  Here is one.  http://www.vbmonster.com/Uwe/Forum.aspx/vb-crystal/1677/Deploying-a-VB6-crystal-report-app
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35191682

Thanks for reply
Please assist me to
how to add this reports into vb project.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35191787
What do you mean how do you add reports to the project?

mlmcc
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35197279
Project > Crystal Report 7 > Import Report (Select Report)
Now Report is in the project,
and Form1 also created automatically,
Crviewer1 is In the Form1
How to use Crviewer1
Normally i am using following code from another form to call "LedgerPort.rpt"

CrystalReport1.ReportFileName = App.Path & "\LedgerPort.rpt"
CrystalReport1.Connect = con
CrystalReport1.DiscardSavedData = True
CrystalReport1.RetrieveDataFiles        
CrystalReport1.SelectionFormula = "{BDl.G_Name} = '" & Text1.text & "'"      
CrystalReport1.Password = Chr(10) & "******"
CrystalReport1.Destination = crptToWindow
CrystalReport1.Action = 1

How to use Crviewer1..?
Instead of App.Path what must i write..?
0
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 35198192
The report object is a non-visual container for opening the file, reading records, etc., not a viewable control.  The CRViewer is the viewable control you place on a form.  In general you do this after you do the code you have to open and prepare the report.

    rpt.ReadRecords
    CRViewer.ReportSource = rpt
    CRViewer.ViewReport
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35198325

so
Instead of following code what must i write to view the report

CrystalReport1.ReportFileName = App.Path & "\LedgerPort.rpt"
CrystalReport1.Connect = con
CrystalReport1.DiscardSavedData = True
CrystalReport1.RetrieveDataFiles        
CrystalReport1.SelectionFormula = "{BDl.G_Name} = '" & Text1.text & "'"      
CrystalReport1.Password = Chr(10) & "******"
CrystalReport1.Destination = crptToWindow
CrystalReport1.Action = 1
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 1000 total points
ID: 35198384
Since the report is now in the project you don't use the RPT file at all.

You now have a DSR in the application.

I used that method when we first started with Crystal but because there were over 70 reports and whenever a report changed the application had to be recompiled and reinstalled on all 500+ users we dropped that method in foavor of the RDC which is much the same as the OCX you currently use.

I believe you use code like

Dim crRpt as DSRName

You can then use that to assign to the viewer.  I believe you also need to change the references to use the newer dlls like CRAXDRT but I don't recall.

I'll look to see if the samples use the DSR or ROT method.

mlmcc
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 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