473,508 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.Net/Crystal Reports - CRAXDRT.ConnectionProperties not defined error

I am writing a Windows forms VB.Net/MS SQL application that utilizes
Crystal Reports. I want to be able to dynamically set the report data
source at run time. According to article
"cr_rdc9_connectionproperties.pdf" on the Crystal support web site I
should be able to do the following:

Dim ConnectionInfo As CRAXDRT.ConnectionProperties

I get a "Type CRAXDRT.connectionProperties is not defined" error from
the VS designer when I enter the statement.

I have put in the dll reference in the project to CRAXDRT.

Statements such as the following do work:

Dim objApp As New CRAXDRT.Application
Dim objReport As CRAXDRT.Report

"ConnectionProperties" does not show up as an item for selection in the
dropdown- Application, Report, etc. do

Any help/guidance much appreciated.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
5 12812
good luck. I gave up on Crystal and went to the free Component One reporting
control that is part of .NET Resource Kit.

Shane

"Henry" <an*******@devdex.com> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
I am writing a Windows forms VB.Net/MS SQL application that utilizes
Crystal Reports. I want to be able to dynamically set the report data
source at run time. According to article
"cr_rdc9_connectionproperties.pdf" on the Crystal support web site I
should be able to do the following:

Dim ConnectionInfo As CRAXDRT.ConnectionProperties

I get a "Type CRAXDRT.connectionProperties is not defined" error from
the VS designer when I enter the statement.

I have put in the dll reference in the project to CRAXDRT.

Statements such as the following do work:

Dim objApp As New CRAXDRT.Application
Dim objReport As CRAXDRT.Report

"ConnectionProperties" does not show up as an item for selection in the
dropdown- Application, Report, etc. do

Any help/guidance much appreciated.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2
Hi Henry,

Don't give up on crystal; it's a great if not perfect report writer.

I've written apps that call on hundreds of crystal reports and they too had
to have connection info appropriate for my test server and different
connection info for the client's server. There are numerous articles on
this issue at crystal, but I will list below a sub I use to convert the
connection before a report runs. First, remember to make all of your
reports integrated security false (datasource location in the report menu),
so that the connection you are using is not hard coded into it.

Then, when you run the report, run them first against a routine such as that
below; my variables globalservername, globalusername, etc are set when the
app begins by accessing a simple text file that contains this info (like an
ini file) and assigning the appropriate global string with the necessary
info.

HTH - let me know if you have any questions.

Bernie Yaeger
PS - here's the code:
Public Sub connectionchange()

'Dim crreportdocument As New ReportDocument

Dim crtablelogoninfos As New TableLogOnInfos

Dim crtablelogoninfo As New TableLogOnInfo

Dim crconnectioninfo As New ConnectionInfo

Dim crtables As Tables

Dim crtable As Table

Dim tablecounter As Integer

crreportdocument.Load(gl_browseprintvar,
OpenReportMethod.OpenReportByTempCopy)

With crconnectioninfo

..DatabaseName = "IMC"

..ServerName = globalservername

..UserID = globalusername

..Password = globalpwd

End With

crtablelogoninfo.ConnectionInfo = crconnectioninfo

crtables = crreportdocument.Database.Tables

For Each crtable In crtables

If (Mid(crtable.Name, 1, 4) = "magt" Or Mid(crtable.Name, 1, 4) = "magb" Or
Mid(crtable.Name, 1, 4) = "magf") And gl_browseprintvar =
"f:\imcapps\hvsum.rpt" Then

crconnectioninfo.DatabaseName = "imc_extra"

crtablelogoninfo.ConnectionInfo = crconnectioninfo

Else

crconnectioninfo.DatabaseName = "IMC"

crtablelogoninfo.ConnectionInfo = crconnectioninfo

End If

crtable.ApplyLogOnInfo(crtablelogoninfo)

crtable.Location = crtable.Name

Next

Dim subRepDoc As New ReportDocument

Dim crSection As Section

Dim crReportObject As ReportObject

Dim crSubreportObject As SubreportObject

For Each crSection In crreportdocument.ReportDefinition.Sections

For Each crReportObject In crSection.ReportObjects

If crReportObject.Kind = ReportObjectKind.SubreportObject Then

crSubreportObject = CType(crReportObject, SubreportObject)

subRepDoc = crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

For Each crtable In subRepDoc.Database.Tables

crtable.ApplyLogOnInfo(crtablelogoninfo)

crtable.Location = crtable.Name

Next

End If

Next

Next

CrystalReportViewer1.ReportSource = crreportdocument

End Sub
"Henry" <an*******@devdex.com> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
I am writing a Windows forms VB.Net/MS SQL application that utilizes
Crystal Reports. I want to be able to dynamically set the report data
source at run time. According to article
"cr_rdc9_connectionproperties.pdf" on the Crystal support web site I
should be able to do the following:

Dim ConnectionInfo As CRAXDRT.ConnectionProperties

I get a "Type CRAXDRT.connectionProperties is not defined" error from
the VS designer when I enter the statement.

I have put in the dll reference in the project to CRAXDRT.

Statements such as the following do work:

Dim objApp As New CRAXDRT.Application
Dim objReport As CRAXDRT.Report

"ConnectionProperties" does not show up as an item for selection in the
dropdown- Application, Report, etc. do

Any help/guidance much appreciated.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3
Henry <an*******@devdex.com> wrote in news:udxXx4PdEHA.1048
@tk2msftngp13.phx.gbl:
Any help/guidance much appreciated.


Why don't you pass the report an ADO Dataset instead?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #4
Hi Bernie,

Tks for the quick response and sample code. I will work on it today.

.....Henry
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5

Bernie,

I'm trying to change the the reports "integrated security" from TRUE to
FALSE with no success. It is not intuitive ( at least not to me.)

How do I go about doing the change?

....Henry
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1353
by: jeremylim2000 | last post by:
Hi! I try to preview a crystal report using asp, it prompt 'CRAXDRT error Occured on server. -2147189176 : login failed Details : IM002: Data sourcename no found and no default driver specified'....
2
6608
by: jeremylim2000 | last post by:
Hi! I try to preview a crystal report using asp, it prompt 'CRAXDRT error Occured on server. -2147189176 : login failed Details : IM002 : Data sourcename not found and n default driver speci...
1
5808
by: Ron Holmes | last post by:
I posted this question on the Crystal Reports Support site and I am still waiting for an answer. Using Crystal Reports 9.0 Developer Full edition: My Crystal report .RPT file has a Picture box...
6
13099
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel...
3
12907
by: kenneth xg | last post by:
Hi, I have problem on passing parameters to subreports' stored procedures which require parameters, from an asp.net web form. I ve tried to use the stored procedures on the main report it...
1
2299
by: Peri | last post by:
Dear All, Can any one help me out to call a crystal reports designed in 8.0 version in ASP.NET ? Crystal reports has given an asp page called rptserver.asp from which we can call the crystal...
2
1798
by: Yammy | last post by:
What is the meaning of the following error : Exception Details: System.Runtime.InteropServices.COMException: COM object with CLSID {3C9CFE1E-389F-4118-9FAD-365385190329} is either not valid or...
3
14924
by: Mudcat | last post by:
I am not that familiar with Crystal Reports, but having read some other posts I know that the way to integrate the API with Python is through the COM interface provide by win32all. However, I...
3
7651
by: raaman rai | last post by:
Guys, i have created reports in crystal report 10 for my VB application. Now how sud i open the report from my application. Infact i have tried opening the report but i get the following error:...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.