crystal report - msdn help

  • Thread starter Thread starter PlumeProg
  • Start date Start date
P

PlumeProg

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(logOnInfo)
Next i

I can't figure what is report ? (as in report.database.
[...], last line)
 
PlumeProg said:
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(logOnInfo)
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)
 
Back
Top