cancel
Showing results for 
Search instead for 
Did you mean: 

Value does not fall within the expected range. .SetParameterValue("@BEGIN",

08-01-2011 10:55 PM
967 views 1 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

I must have ABILITY TO LOGON TO 1 OF 9 similar DBs

so my users can have 1 report with DYNAMIC ACCESS TO ANY of the 9 DBs

so I have to pass the parameters into to the objReport

try

CrystalReport1 objReport = new CrystalReport1();

// database login ????

strDBLogon= "TRUX7_" + cboCompany.SelectedValue.ToString() + "_COMP";

dbSrvr ="DESQL1//TRUX7"; // reversed the backslash so it previews here better

objReport.SetDatabaseLogon("", "", dbSrvr, strDBLogon); // C1 is what is in cboCompany

crystalReportViewer1.ReportSource = objReport;

objReport.SetParameterValue("@BEGIN", (object)dateTimePicker1);

catch (Exception err)

err.Message --> " Value does not fall within the expected range."

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

DateTime datBegin = DateTime.Parse(dateTimePicker1.Value.ToString());

DateTime datEnd = DateTime.Parse(dateTimePicker2.Value.ToString());

objReport.SetParameterValue("@BEGIN", datBegin);//(object)

objReport.SetParameterValue("@END", datEnd); // dateTimePicker2 .Value

Answers (0)