Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal RDC & VB 2

Status
Not open for further replies.

fwatanabe

Programmer
Jan 16, 2002
82
CA
Hello out there,

To use the Report Designer Component, do I need to have Crystal Developer version? I've been reading the Tutorial and Getting Started guide, but it says to create Standard EXE, goto the Project Menu and click More ActiveX Designers, then select Crystal Reports 8. I don't have this option! Is there something I forgot to do?

I have VB6 Enterprise and Crystal Reports 8.5 Professional.
 
you dont need crystal developer.

follow this

1.-open a new project in vb (click file menu and then click new project). select standard exe and click ok.

2.- click the project menu and then click on components. put a check beside the crystal report viewer control and then click ok.

3.- click the project menu nad then click on references. put a check mark beside crystal report 8 activex designer run time library and then click ok

4.- in form1 in general declarations:

dim appl as new craxdrt.application
dim report as new craxdrt.report

5. in form load event

sub form_load()

set report = appl.openreport("c:\myreport.rpt")
crviewer1.reportsource=report
crviewer1.viewreport.

end sub


source: RDC tutorial and gueting started guide form crystal decision
 
Thanks for your reply.

Using this method, will I be able to export the report to PDF format?
 
yes just omit the next lines

crviewer1.reportsource=report
crviewer1.viewreport

and add this instead

with report.exportoptions
.destinationtype=credtdiskfile
. formattype = crEFTPortableDocFormat
. diskfilename = app.path & "\report.pdf"
end with

report.export false



if you have problems change report.export false for report.export and you will be prompted for missing parameters. the false flag means that you dont want to be prompted

 
Thanks, you've been a great help.

Is your example using RDC, or is that something else entirely? I'm having a hard time understanding what RDC is and what it does, in comparison to the Crystal OCX.

Are they the same thing? If not, what's the difference?
 
yes i'm using rdc, you can download from crystal site. Its very easy
 
yakko, I used this for my problem that you were helping me with yesterday, and I got close. But, it is giving me a "The server is not yet open" error on the crviewer. Here is the code that I have. Any ideas on this one??

Dim appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report

Private Sub Form_Load()
'I just stuck this in here to see if it would help, but nope
Dim conn As New ADODB.Connection
Dim sql As String
Let sql = "select lab, netthick, netden, rollnum, lotnum,_ prod, bound, load, grad, seat, result from comptrans"
conn.ConnectionString = "provider=microsoft.jet.oledb.4.0;persist security info=false;data source=g:\other\trans_ filter\transmissivity.mdb"
conn.Open
Set Report = appl.OpenReport_("c:\home\transfiltervb\trans.rpt")
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
End Sub
 
your report its capable to open the database and have a selection criteria , i think you dont need to do all the connection to database thing.






but if you want to change the database, or the selection criteria saved in report you only need to sepcify to the report the new selction or database.

for this you need to use this properties
report.setdatasource
or
report.setdatatable

to change the source or table.

in the first case you need a recordset example
report.setdatasource ADOrs, 3,1 (where 3 its the datatag and 1 the table index)



 
Ok, thanks, I learn somthing new every day. But I still have not been able to get rid of the "server not yet started" error. I have seen where you might need to pass a password and login before hand, but I have no securtiy set up on the database, so now I am lost. I do have the CR Dev Ed. on the way, should I wait for that, or do you know some kind of workaround for the error??

Thanks For All your Help
 
i found this, may be it helps to you

for i = 1 to report.database.tables.count

report.database.tables(i).setlogoninfo server
name,databasename, user id, password

next i

crviewer1.reportsource=report
crviewer1.viewreport


*** you need to put the server name. databasename, user id and password as text like this

"mmserver","mydatabase",..... etc.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top