Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends i am getting an error for "Index was outside the bounds of the array."
for the following code which is in bold plesae needed help to resolve the error:


VB
cryRpt.Load("C:\sachin\AutoCrystal1\AutoCrystal1\Daily MIS 28-02-13.rpt")
       cryRpt.SetDatabaseLogon("sa", "admin-123", "testvm", "sgujdt")
       cryRpt.SetParameterValue("@date", Date.Now)
       cryRpt.SetParameterValue("@fromdate", date2, "Sub Cumulative MIS")
       cryRpt.SetParameterValue("@date", date3, "Sub Cumulative MIS")
       cryRpt.SetParameterValue("@fromdate", date4, "Diff_mis")
Posted
Comments
Mike Meinz 28-Jun-13 6:26am    
What is SetParameterValue?
Use the Visual Studio Debugger to step through SetParameterValue to see where the error occurs.

Why set @date and @fromdate twice?
sachin bhise 28-Jun-13 6:44am    
ok actually i have one report in which i have a sub report and in that sub report i have another sub report so @fromdate,@date are in both sub report that's why @date and @fromdate twice

1 solution

 
Share this answer
 
Comments
sachin bhise 28-Jun-13 7:07am    
thanks Maciej Los.
Maciej Los 28-Jun-13 7:10am    
You're welcome.
If your problem is solved, please, mark this answer as a solution (green button).
sachin bhise 28-Jun-13 7:24am    
sure...i am checking the second link in the solution but its not showing the solution to the problem Maciej do u have any other link?
sachin bhise 28-Jun-13 7:53am    
Dim subcryRpt As New ReportDocument
subcryRpt = cryRpt.OpenSubreport("Sub Cumulative MIS")
subcryRpt.SetParameterValue("@fromdate", date2, "Sub Cumulative MIS")
subcryRpt.SetParameterValue("@date", date3, "Sub Cumulative MIS")

i did according to the syntax mentioned in the solution but it's giving error that not supported within subreport
Maciej Los 28-Jun-13 8:07am    
try this:
subcryRpt.SetParameterValue("fromdate", date2, "Sub Cumulative MIS") (without @) ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900