My question is why you pass parameter for SP and report both. Pass the parameter to SP and bind result to the Report. Whatever to get rid of parameter prompting use " ". But i am not getting ur requirement.
no may i explain badly...i was meant that i have a crystal report bind to a storeprocedure and of course i have to pass those parameters at runtime so that report will be displayed correctly...
i was passing parameters like this but two of my parameters wereoptional...
shumailaAjk
Member
620 Points
380 Posts
HOW TO PASS OPTIONAL PARAMETERS IN CRYSTAL REPORT
Mar 26, 2012 07:37 AM|LINK
hi i have to pass three parameters to my crystal report..two of them are optional for my store procedure
but when miss to pass those parameters to my crystal report it start giving me parameter missing msg..i just want to know how to
make it work with these optional parameters.
any idea??
cnranasinghe
Star
8899 Points
1800 Posts
Re: HOW TO PASS OPTIONAL PARAMETERS IN CRYSTAL REPORT
Mar 27, 2012 09:59 AM|LINK
My question is why you pass parameter for SP and report both. Pass the parameter to SP and bind result to the Report. Whatever to get rid of parameter prompting use " ". But i am not getting ur requirement.
shumailaAjk
Member
620 Points
380 Posts
Re: HOW TO PASS OPTIONAL PARAMETERS IN CRYSTAL REPORT
Mar 28, 2012 04:05 AM|LINK
no may i explain badly...i was meant that i have a crystal report bind to a storeprocedure and of course i have to pass those parameters at runtime so that report will be displayed correctly...
i was passing parameters like this but two of my parameters wereoptional...
string reportpath = Server.MapPath("AssigmntsReport.rpt"); rpt.Load(reportpath); ConnectionInfo connectionInfo = new ConnectionInfo(); string[] ConnStringKey = ConfigurationManager.AppSettings.GetValues("NestleConnString"); string ConnStr = ConfigurationManager.ConnectionStrings[ConnStringKey[0]].ConnectionString; System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder(ConnStr); rpt.SetDatabaseLogon(builder.UserID, builder.Password, builder.DataSource, builder.InitialCatalog, false); rpt.DataSourceConnections[0].SetConnection(builder.DataSource, builder.InitialCatalog, false); rpt.DataSourceConnections[0].SetLogon(builder.UserID, builder.Password); rpt.SetParameterValue("@Type", Type);cnranasinghe
Star
8899 Points
1800 Posts
Re: HOW TO PASS OPTIONAL PARAMETERS IN CRYSTAL REPORT
Mar 28, 2012 04:08 AM|LINK