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

crystal report - msdn help

P: n/a
Hello, I can't find a way to bind a dataset at runtime as
a source for my report source.

I looked into msdn and found some sample :
ms-
help://MS.VSCC/MS.MSDNVS/crystlmn/html/crtskaccessingsecure
databases.htm

' Declare require variables.
Dim logOnInfo As New TableLogOnInfo()
Dim i As Integer

' Loop through every table in the report.
For i = 0 To report.Database.Tables.Count - 1
' Set the connection information for current table.
logOnInfo.ConnectionInfo.ServerName = serverNameTxt.Text
logOnInfo.ConnectionInfo.DatabaseName = dbNameTxt.Text
logOnInfo.ConnectionInfo.UserID = userNameTxt.Text
logOnInfo.ConnectionInfo.Password = passwordTxt.Text
report.Database.Tables.Item(i).ApplyLogOnInfo(logO nInfo)
Next i

I can't figure what is report ? (as in report.database.
[...], last line)
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"PlumeProg" <pl*******@hotmail.com> schrieb
Hello, I can't find a way to bind a dataset at runtime as
a source for my report source.

I looked into msdn and found some sample :
ms-
help://MS.VSCC/MS.MSDNVS/crystlmn/html/crtskaccessingsecure
databases.htm

' Declare require variables.
Dim logOnInfo As New TableLogOnInfo()
Dim i As Integer

' Loop through every table in the report.
For i = 0 To report.Database.Tables.Count - 1
' Set the connection information for current table.
logOnInfo.ConnectionInfo.ServerName = serverNameTxt.Text
logOnInfo.ConnectionInfo.DatabaseName = dbNameTxt.Text
logOnInfo.ConnectionInfo.UserID = userNameTxt.Text
logOnInfo.ConnectionInfo.Password = passwordTxt.Text
report.Database.Tables.Item(i).ApplyLogOnInfo(logO nInfo)
Next i

I can't figure what is report ? (as in report.database.
[...], last line)


"report" is an intance of a report class you added to the project using
"Project -> Add new item -> CrystalReport". Then you can use

Dim report as new CrystalReport1
report.setdatasource(YourDataset)
CrystalReportViewer1.ReportSource = report
See also:
ms-help://MS.VSCC/MS.MSDNVS/crystlmn/html/crtsksettingupanado.netreportinavi
ewer.htm

(watch for wrapping)
--
Armin

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.