Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Crystal Report

Posted on 2011-03-16
14
Medium Priority
?
1,073 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
Suggested Courses

596 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