Problems faced in calling crystal reports from power builder

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
khadija_saeedAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sandeep_patelCommented:
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
khadija_saeedAuthor Commented:

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
sandeep_patelCommented:
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

namasi_navaretnamCommented:
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
gafoor78Commented:
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
babybirdCommented:
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
babybirdCommented:
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
khadija_saeedAuthor Commented:
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
gafoor78Commented:
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
gafoor78Commented:
hi khadija

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

rgrds
gafoor
0
khadija_saeedAuthor Commented:
Hello Gafoor,

Thanks for the help. my problem was solved.

Regrds
Khadija
0
namasi_navaretnamCommented:
Saeed, Why not award the points  and close the issue.
0
gafoor78Commented:
Hi Khadija

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

 
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Aman SinghCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.