 |
| VB Components Issues specific to components in VB. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 7th, 2004, 03:28 AM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Urgent PLZ,Crystal Report With VB6 problem
Hi,
PLZ help me,I form the a table in the SQL Server DB at run time, and I need to report it,so I have to use SetDataSource procedure from CRAXDRT.report.Database object, now how can I show the data at run time in deails section, cuz no data shown, plz help me
this is my code:
Set rs = New ADODB.Recordset
rs.Open "SELECT ...", conn, adOpenStatic,adLockReadOnly 'Suppose the SQL is true
Set crystal = New CRAXDRT.Application 'MANAGES REPORTS
Set report = crystal.OpenReport(App.Path & "\report2.rpt") 'OPEN OUR REPORT
report.Database.SetDataSource rs 'LINK REPORT TO RECORDSET
CRViewer.ReportSource = report 'LINK VIEWER TO REPORT
CRViewer.EnableExportButton = True
CRViewer.ViewReport 'SHOW REPORT
Do While CRViewer.IsBusy 'ZOOM METHOD DOES NOT WORK WHILE
DoEvents 'REPORT IS LOADING, SO WE MUST PAUSE
Loop 'WHILE REPORT LOADS.
|
|

July 9th, 2004, 12:10 AM
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Wrox answer
Hai there
Good to see your question is in detail.
i will try to help it may or maynot work.
Cr.Query = "select * form emp where x='1a' y="1
now show the report it will automatically come
no need to set the datasource.
i think the datasource is a conneciton like and not the data itself.
Regards
Vinay
|
|

July 18th, 2004, 10:54 AM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
I find a solution, and I would like to tell you.
When u want to report any table, and this table is created and formed at run time,you can create Crystal report file at run time, and also design it by an API that Crystal Reports support,this API Called CRD(Crystal Run time design),
and I'm ready to give a full example about it.
|
|

September 16th, 2004, 05:17 AM
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
I saw your problem and how u solved it.
I have a similar problem. I am trying to make my users select the fields they want to report at run time.. that is create a report at run time depending on the fields the user want from my visual basic (6.0) program. The user will also select the width of the fields. The error message i keep getting is that "Creation feature no enabled" I tried the sample code in cystal 9.0 and the message is the same. How can I achieve this. I will like you to give me the codes to do this.
Thanks in anticipation.
Bola
|
|

November 12th, 2004, 05:48 AM
|
|
Registered User
|
|
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi,
I have encountered the same problem too, does anyone replied on your problem or do you resolve the problem. Ive tried different approach yet I still need the pattern of creating an ADOcommand to lessen my code. Thanks in advance.
|
|

December 31st, 2006, 03:28 AM
|
|
Registered User
|
|
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I've had this problem too. I find a way for solving this problem and I use it in my program. When you want to use SetDataSource method you should also provide datatag parameter too. I dont know what the datatag parameter is but when I set it to 3 it will work. So you should type this code:
Dim ac As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim Report As New [CrystalReportDesigner]
call ac.open(["connection string"])
call rs.open(["SQL Query"],ac)
call Report.SetDataSource(rs,3)
...
|
|
 |