Solved

Crystal Report

Posted on 2011-03-16
14
1,063 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
  • 6
  • 5
  • 2
14 Comments
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
Comment Utility

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
Comment Utility
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
 
LVL 1

Author Comment

by:crystal_Tech
Comment Utility

Given link is not opening

Problem loading page

0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
I uoloaded the file here

mlmcc
splitrpt.zip
0
 
LVL 1

Author Comment

by:crystal_Tech
Comment Utility

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 16

Expert Comment

by:JohnBPrice
Comment Utility
>>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
Comment Utility

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

Expert Comment

by:mlmcc
Comment Utility
What do you mean how do you add reports to the project?

mlmcc
0
 
LVL 1

Author Comment

by:crystal_Tech
Comment Utility
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
Comment Utility
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
Comment Utility

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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

763 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

6 Experts available now in Live!

Get 1:1 Help Now