remjith
April 22nd, 2003, 06:25 AM
i have got 4 reports displaying same fields but the values change according to the parameter passed to the report.i want to do it in a single .rpt file by passing the sql query to it.i am using sql server as backend and i have to do the following code to do the logon process from asp.net to sql server through crystal report.if i haven't did this logon failure exception is thrown
Dim rtDoc As ReportDocument
Dim coninfo As New ConnectionInfo()
Dim crtlinfo As New TableLogOnInfo()
Dim crTables As Tables
Dim crtable As Table
rtDoc = New CrystalReport1()
With coninfo
.ServerName = "server"
.DatabaseName = "db"
.UserID = "uid"
.Password = "pwd"
End With
crTables = rtDoc.Database.Tables
For Each crtable In crTables
crtlinfo = crtable.LogOnInfo
crtlinfo.ConnectionInfo = coninfo
crtable.ApplyLogOnInfo(crtlinfo)
Next
CrystalReportViewer1.ReportSource = rtDoc
to stisfy the criteria i created a dataset which contains the required values and set the setdatasource property of the crystalreport to the dataset.but the report is still showing the value that has been specified at design time.if i remove the above mesioned login code it is giving logon failed message.
remjith
Dim rtDoc As ReportDocument
Dim coninfo As New ConnectionInfo()
Dim crtlinfo As New TableLogOnInfo()
Dim crTables As Tables
Dim crtable As Table
rtDoc = New CrystalReport1()
With coninfo
.ServerName = "server"
.DatabaseName = "db"
.UserID = "uid"
.Password = "pwd"
End With
crTables = rtDoc.Database.Tables
For Each crtable In crTables
crtlinfo = crtable.LogOnInfo
crtlinfo.ConnectionInfo = coninfo
crtable.ApplyLogOnInfo(crtlinfo)
Next
CrystalReportViewer1.ReportSource = rtDoc
to stisfy the criteria i created a dataset which contains the required values and set the setdatasource property of the crystalreport to the dataset.but the report is still showing the value that has been specified at design time.if i remove the above mesioned login code it is giving logon failed message.
remjith