Solved

Problems faced in calling crystal reports from power builder

Posted on 2003-10-23
14
1,473 Views
Last Modified: 2016-08-30
hi,

I need help on how to call crystal reports 9.2 from Power builder 7.0. Is there any other method other than OLE ? If not then which type of OLE control should i use for the purpose?

Khadija
0
Comment
Question by:khadija_saeed
  • 4
  • 3
  • 2
  • +3
14 Comments
 
LVL 14

Expert Comment

by:sandeep_patel
Comment Utility
hi,

i don't know other methods, but i worked with crystal32.ocx in PB. Using this ocx u can use crystal reports with pb. Perhaps this ocx comes with setup of crystal report.

$regards.
0
 

Author Comment

by:khadija_saeed
Comment Utility

For Sandeep Patel,

The crystal32.ocx ....what is this ...an OLE control or what?  and what is the complete method of using it?  i have searched for this ocx in the setup of crystal reports 9.2 that i'm using but cant find.

Can u give me some explaination?

i'd be grateful!
Thanks

Khadija
0
 
LVL 14

Expert Comment

by:sandeep_patel
Comment Utility
sorry its crystl32.ocx,

u can use it like any ole control. I have crystal report pro and this ocx is along with it. Just put it on your window and use it's properties and functions like any other object. If you don't have any idea about using ole in pb then tell me again i will explain in detail.

-sandeep.


0
 
LVL 15

Expert Comment

by:namasi_navaretnam
Comment Utility
1) Select "OLE" control from control list
2) Select "Crystal Report Viewer Control" from "Insert Object/Create New" tab. (This control will show only if Crstral Reports installed on your PC or the ocx control installed and registeredd in your PC.
3) Drop this control on your window
4) Add a command button and add the code below (ole_1 is the name of the control)

ole_1.object.ReportName = 'Report'
ole_1.object.ViewReport()

5) You can view all available functions and properties by selecting object browser from PB toolbar and the selecting "OLE" tab.
6) Once selecting OLE tab, look for your control and you can see all available functions and properties for this control.

HTH

Namasi Navaretnam
0
 
LVL 5

Expert Comment

by:gafoor78
Comment Utility
Hi

Y u need cystal report in powerbuilder !!. u can very well use datawindow for any sort of reporting very effectively...what i recomend u is use datawindow instead of crystal report. if u hav any pblm on datawindow let me know i can help u.

 
but if u need crystal report itself then connect with database b4 calling the report

ole_rep.object.Connect = "ODBC;DSN=hamish;UID=sa;PWD=put_ur_pwd_here"

then call

ole_rep.object.ReportName = ls_rep_path + as_report_name
ole_rep.object.ViewReport() // or ole_rep.object.action = 1

rgrds
gafoor
0
 

Expert Comment

by:babybird
Comment Utility
When we went to crystal 8.5, my understanding was that crystal was going to be providing limited support and updates for the ocx so we choose to use their RDC (report designer component) feature.  We were using ocx and converted to RDC. I would assume this would be available in 9.2 but we are not on that version.  It's something you may want to check out.  We wrote a user object to handle generation of reports as they were passed to it that uses RDC programming and it works quite well.  We use crviewer to view the reports and their export feature to generate them to print or files as requested.

We do have some issues with the viewer if the your desktop settings are less then 1024x768 so that is now our standard for running this app.
0
 

Expert Comment

by:babybird
Comment Utility
When we went to crystal 8.5, my understanding was that crystal was going to be providing limited support and updates for the ocx so we choose to use their RDC (report designer component) feature.  We were using ocx and converted to RDC. I would assume this would be available in 9.2 but we are not on that version.  It's something you may want to check out.  We wrote a user object to handle generation of reports as they were passed to it that uses RDC programming and it works quite well.  We use crviewer to view the reports and their export feature to generate them to print or files as requested.

We do have some issues with the viewer if the your desktop settings are less then 1024x768 so that is now our standard for running this app.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:khadija_saeed
Comment Utility
hi Gafoor,

Thanks for the help but actually it is our client's requirement to develop the reports in Crystal Report writer.

Now i have used the connect property of the crystal report viewer control to connect to the database, but it gives error as there is no such property or function. There is another function called 'ReportSource()' but it is used as such:

ole_rep.object.ReportSource(lunknown dsip member)

now there is no help in PB about this function, neither about the datatype lunknown. How can i use it?

0
 
LVL 5

Expert Comment

by:gafoor78
Comment Utility
Hi kadeeja

i didn't noticed that u r using crystal report viewer...instead i will tell u the approch

1. delete that crystal report viewer from ur window
2. click the ole control
3. then click the tab ' insert control '  from the opened window
4. from the control list select ' crystal report control '. ( if u cudn't see, then u hav to register its ocx crystal32.ocx with regsvr32 or from that window itself by clicking register new ). this will be automatically registered if u installed crystal report in ur system

5. put the control in ur window
6. then code this to view the report

   //connect report with dsn
   ole_1.object.Connect = "ODBC;DSN=hamish;UID=sa;PWD=put_ur_pwd_here"

   ole_1.object.ReportFileName = ls_rep_path + as_report_name // report file

   // view report
   ole_1.object.action = 1

7. run ur application, then u can see the report .


rgrds
gafoor
0
 
LVL 5

Expert Comment

by:gafoor78
Comment Utility
hi khadija

ur problem solved ?..... any more doubts, let me know then

rgrds
gafoor
0
 

Author Comment

by:khadija_saeed
Comment Utility
Hello Gafoor,

Thanks for the help. my problem was solved.

Regrds
Khadija
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
Comment Utility
Saeed, Why not award the points  and close the issue.
0
 
LVL 5

Accepted Solution

by:
gafoor78 earned 125 total points
Comment Utility
Hi Khadija

if ur problem solved, why don't u accept the helped comment answer ???

 
0
 

Expert Comment

by:Aman Singh
Comment Utility
I want to call Crystal RPT(Crystal 8.5) files from Power builder 11.2. I tried above steps but not able to call. I have Crystal Viewer.
Please let me know what needs to be done for the same
0

Featured Post

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

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

744 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

15 Experts available now in Live!

Get 1:1 Help Now