Solved

Crystal Report

Posted on 2011-03-16
14
1,070 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 100

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 100

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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 1

Author Comment

by:crystal_Tech
ID: 35164357

Given link is not opening

Problem loading page

0
 
LVL 100

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 100

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 100

Accepted Solution

by:
mlmcc earned 250 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

730 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