Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problems faced in calling crystal reports from power builder

Posted on 2003-10-23
14
Medium Priority
?
1,531 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
ID: 9612384
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
ID: 9613051

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
ID: 9613360
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9618127
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
ID: 9656801
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
ID: 9660526
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
ID: 9660527
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
 

Author Comment

by:khadija_saeed
ID: 9663119
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
ID: 9663377
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
ID: 9682909
hi khadija

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

rgrds
gafoor
0
 

Author Comment

by:khadija_saeed
ID: 9695090
Hello Gafoor,

Thanks for the help. my problem was solved.

Regrds
Khadija
0
 
LVL 15

Expert Comment

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

Accepted Solution

by:
gafoor78 earned 375 total points
ID: 9708459
Hi Khadija

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

 
0
 

Expert Comment

by:Aman Singh
ID: 41776068
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

927 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