Index was outside the bounds of the array

Index was outside the bounds of the array

Forum member · Sep 14, 2007
Hi, I'm a new user of your software and having trouble passing arguments to reports. Here's the dplx: <?xml version="1.0"?> <document xsi:schemaLocation="http://www.DynamicPDF.com http://www.DynamicPDF.com/schemas/DPLX4.xsd" version="4.0" id="Document" author="" keywords="" title="" subject="" xmlns="http://www.DynamicPDF.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <report id="Report1" pageSize="custom" pageHeight="792" pageWidth="612"> <query id="Query" dataProvider="msSql" connectionString="Pwd=thousandoaks;Persist Security Info=True;User ID=thousandoaksdbadmin;Initial Catalog=ThousandOaks;Data Source=sql350.mysite4now.com"><sql> select top 10 ItemID, ItemDesc from uProducts where ItemID = #ID# </sql></query><header id="Header" height="78"> <label id="Label1" text="Sample Report" fontSize="28" width="302" height="36" x="63" y="22" font="TimesBold"/> </header> <body id="Body" height="40"> <recordBox id="RecordBox1" dataFormat="" height="14" field="ItemID" x="17" y="14" width="123"/> <recordBox id="RecordBox2" dataFormat="" height="14" x="148" y="13" width="300" field="ItemDesc"/> </body> <footer id="Footer" height="50"/> </report> </document> ...And here's the VB.NET code I'm using to run the report with a parameter: Imports ceTe.DynamicPDF Imports ceTe.DynamicPDF.ReportWriter Partial Class LibertyBags_Test Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim parameters As New ParameterDictionary() parameters.Add("ID", "SOIL-34110") Dim report As New DocumentLayout("C:\_Clients Local\Thousand Oaks\sequel_thousandoaks\LibertyBags\ReportTest.aspx.dplx") Dim document As Document = report.Run(parameters) document.DrawToWeb() End Sub End Class When this runs, I receive this error: Index was outside the bounds of the array. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array. Source Error: Line 9: parameters.Add("ID", "SOIL-34110") Line 10: Dim report As New DocumentLayout("C:\_Clients Local\Thousand Oaks\sequel_thousandoaks\LibertyBags\ReportTest.aspx.dplx") Line 11: Dim document As Document = report.Run(parameters) Line 12: document.DrawToWeb() Line 13: End Sub If I remove the where clause from the query it runs fine, but that does me no good. What am I missing here? Thanks! Kevin S.

Re: Index was outside the bounds of the array

Support · Sep 17, 2007
Hello Kevin, Please make sure that the parameter name you are using is correct and also make sure that you are passing all the parameters required by the query. If you still have problem then please send over the dplx file to our [^a|mailto:support@cete.com|Support Team^] so that they can take a look at it. Thanks, ceTe Software Support Team.