By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,638 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,638 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

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 discussion thread is closed

Replies have been disabled for this discussion.