Error: System.NullReferenceException: Object reference not set to an instance of an object.

Error: System.NullReferenceException: Object reference not set to an instance of an object.

Forum member · Aug 6, 2007
I can't find the error ... This is my code: public partial class SimpleReport : System.Web.UI.Page { private void Page_Load(object sender, System.EventArgs e) { DocumentLayout report = new DocumentLayout(@Server.MapPath("dlpx/transport_details.dplx")); ParameterDictionary parameters = new ParameterDictionary(); parameters.Add("TitlePage", "Transportbon " + DateTime.Now.ToString("dd/MM/yyyy")); parameters.Add("ClientContact", ""); parameters.Add("doDeliveryId", "196"); parameters.Add("doClientId", "413"); Document document = report.Run(); document.Draw(@Server.MapPath("pdf/test.pdf")); this is the dplx <?xml version="1.0"?> <document id="SimpleReport" xsi:schemaLocation="http://www.DynamicPDF.com http://www.DynamicPDF.com/schemas/DPLX.xsd" author="" keywords="" title="" subject="" version="4" xmlns="http://www.DynamicPDF.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <report id="Report1" pageOrientation="portrait" pageSize="a4" bottomMargin="35" leftMargin="35" rightMargin="35" topMargin="35"> <query id="Query1" dataProvider="msSql" connectionString="Data Source=wwserver;Initial Catalog=ww-sql;User ID=Webservices;Password=1f58t8f5d"> <sql>SELECT * FROM tbl_ww_leveringsbon WHERE leveringsbon_id = #Parameters["doDeliveryId"]# AND adresid = #Parameters["doClientId"]# </sql> </query> <header id="Header" height="324.5"> <rectangle id="Rectangle1" y="6" height="48" width="511" x="5.5"/> <image id="Image1" x="12" y="11" height="38" width="43" path="D:\INTRANET_PUBLICWEBSERVICES\pdfgenerators\images\logo_w100.jpg"/> <label id="Label1" height="14" width="107" text="VERZENDER" font="HelveticaBold" y="60" x="7" fontSize="8"/> <label id="Label2" height="78" fontSize="8" width="208" text="Woods & Willow Kernenergiestraat 53 2610 Wilrijk Belgium Contact tel.: +32 (0)3 740 06 91 Contact fax: +32 (0)3 740 06 99" y="60" x="97"/> <label height="14" width="107" font="HelveticaBold" id="Label3" text="AFHAALADRES" y="59.5" x="252" fontSize="8"/> <label height="61" id="Label4" fontSize="8" width="179.5" x="353.5" y="60" text="Magazijn Woods & Willow Kernenergiestraat 53 2610 Wilrijk Belgium Contact tel.: Michael +32 (0)3 740 06 93"/> <label height="14" width="107" font="HelveticaBold" id="Label5" text="ONTVANGER" x="7.5" y="134" fontSize="8"/> <label height="14" width="107" font="HelveticaBold" id="Label6" text="LEVERINGSADRES" x="251.5" y="131.5" fontSize="8"/> <line id="Line3" x1="5.5" y1="126" y2="126" x2="516"/> <label width="107" font="HelveticaBold" id="Label7" height="26.5" fontSize="8" x="7" y="195" text="SLUITINGSDAG EN/OF OPMERKINGEN"/> <label width="107" font="HelveticaBold" height="26.5" fontSize="8" y="195" id="Label8" x="253.5" text="ANDERE OPMERKINGEN"/> </header> <body id="Body" splittable="true" height="18"> <recordBox id="RecordBox1" dataFormat="" height="14" width="100" x="6" y="1.5" field="[tr_aantal_europalet]"/> </body> <footer id="Footer" height="57.5"> <rectangle height="48" width="511" id="Rectangle2" y="5" x="5"/> <image x="12" height="38" width="43" path="D:\INTRANET_PUBLICWEBSERVICES\pdfgenerators\images\logo_w100.jpg" id="Image2" y="10"/> <label id="LabelAdresBottom" fontSize="8" width="377" height="35.5" y="11.5" x="59" text="Woods & Willow - @Comm.linx bvba Kernenergiestraat 53 - 2610 Wilrijk - Belgium Tel.: +32 (0)3 740 06 91 - Fax: +32 (0)3 740 06 99"/> </footer> </report> </document>

Re: Error: System.NullReferenceException: Object reference not set to an instance of an object.

Forum member · Aug 6, 2007
found it ... ! Document document = report.Run(); must be Document document = report.Run(parameters);