Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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:
 

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 28-Jun-13 1:10am
Comments
Mike Meinz at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
sachin bhise at 28-Jun-13 7:07am
   
thanks Maciej Los.
Maciej Los at 28-Jun-13 7:10am
   
You're welcome.
If your problem is solved, please, mark this answer as a solution (green button).
sachin bhise at 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 at 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 at 28-Jun-13 8:07am
   
try this:
subcryRpt.SetParameterValue("fromdate", date2, "Sub Cumulative MIS") (without @) ;)
sachin bhise at 29-Jun-13 0:13am
   
still its giving error not supported within sub reports
Maciej Los at 29-Jun-13 8:31am
   
Which document/report do you open first? The sequence should be: subreport, subreport, main report.
sachin bhise at 1-Jul-13 8:08am
   
ok maciej thnx..
Maciej Los at 1-Jul-13 11:19am
   
You're welcome ;)

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

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 28 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100