Dear Brother.
I never Worked on PHP, but i am working on DOtnet .
In Dotnet i used Crystal REport viewer, and i worked on dynamic creation of reports also.
so i think its my duty to show u how i worked in that,
Firstly , ur problem is in Login department.
So it means that , ur code may not be having enough logon info. splly in crystal reports we have to provide the logon info for every table and then for the report.
i will show u a sample here..............
Dim Rport As New CryRpt20
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
For Each myTable In Rport.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.ServerName = ServerName
myLogin.ConnectionInfo.DatabaseName = DatabaseName
myLogin.ConnectionInfo.Password = Password
myLogin.ConnectionInfo.UserID = UserName
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.Visible = True
Rport.SetDatabaseLogon(UserName, Password, ServerName, DatabaseName)
Rport.SetParameterValue("YEAR_ID", lstYear.SelectedValue)
Rport.SetParameterValue("CAT_DESC", lstcat.SelectedValue)
Rport.SetParameterValue("GLOBAL_STATUS", lstGStatus.SelectedValue)
CrystalReportViewer1.ReportSource = Rport
CrystalReportViewer1.DataBind()
Username is the Global variable .and password and so on ... all this info abt the logoin are global variables.
hope u get my point,
bye
Mohammed Raza Ullah Khan
|