ConnectionString property exception

ConnectionString property exception

Forum member · May 10, 2008
I am using the evaluation copy of DynamicPDF Suite to see if it will meet my needs. I am trying to create a blank pdf, but I keep getting the following exception: System.InvalidOperationException: The ConnectionString property has not been initialized I am using VisualStudio 2005 with an ASP.NET 2.0 Application. The page has only a text box and button and I try to create a pdf on the click event of the button. Here is my code: using ceTe.DynamicPDF.ReportWriter; using ceTe.DynamicPDF.ReportWriter.Data; using ceTe.DynamicPDF.ReportWriter.ReportElements; using ceTe.DynamicPDF; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Document doc = GetDoc(); doc.Draw(@"C:\MyTest.pdf"); } private Document GetDoc() { //ParameterDictionary paramaters = new ParameterDictionary(); //paramaters.Add("Message", TextBox1.Text); DocumentLayout report = new DocumentLayout(@"C:\Sandbox\PDFReport\Templates\TestReport.dplx"); return report.Run(); } }

Re: ConnectionString property exception

Support · May 12, 2008
Hello, The reason for the error you are getting is because you have not provided the connection string in the dplx file. You can refer to the Simple Report topic on our help documentation for this. Thanks, ceTe Software Support Team.

Re: ConnectionString property exception

Forum member · Jul 1, 2008
Hi - is it correct to say that the Report Writer MUST be connected to a database to generate a report? I am currently evaluating it's use for report writing directly from domain entities. My intention was to use the GetReportElementById method to populate various text lables on the report from a domain object. Am I wasting my time?

Re: ConnectionString property exception

Support · Jul 1, 2008
Hello, You can use the ReportWriter product if you are going to create the PDF reports using the data from the database. ReportWriter needs a connection string specified in the dplx file. You can also use the data from some objects to create the report using the ReportWriter. You will have to use the event driven query for this. You will have to create a DataTable object using the data from an object and add it to the record set. You can refer to the Event Driven Queries topic on our help documentation. You can also use the Generator product in order to create PDF reports where you will have more control over the elements you are adding to the PDF document. You can add different Page Elements to the PDF by specifying the X, Y position for the element. Thanks, ceTe Software Support Team.

Re: ConnectionString property exception

Forum member · Jul 1, 2008
Thanks for the swift reply - I'm looking at the Event-Driven Queries now. My motivation for using the DPLX tool is so non-programmers can update the document format on an ongoing basis. It would be nice if the ReportWriter worked in data-bound and object-bound scenerios more intuitively though. Creating a DataTable from my entities is OK, but a bit of a pain. Could the binding not work more like e.g. DataGrid binding where i can bind to an IList<Entity> or a DataView transparently.

Re: ConnectionString property exception

Support · Jul 1, 2008
Hello, It's not possible to bind the report to the IList or the DataView data. You will have to use the DataTable and add the data to the Recordset. Thanks, ceTe Software Support Team.