Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Crystal Report with XML at run time?? Post Reply Post New Topic
Author Message
avnkkishore
Newbie
Newbie


Joined: 12 Mar 2007
Location: India
Online Status: Offline
Posts: 5
Quote avnkkishore Replybullet Topic: Crystal Report with XML at run time??
    Posted: 09 Apr 2007 at 4:23am

Hi,

I have very simple requirement.

I would like to create a crystal report using XML. This XML file will be decided at run time (not at design time).

Hence i have added a crystal report viewer control to my windows form and did not choose any data source (i left it blank currently). Now i am trying to load XML file with the following simple code.

            PropertyBag crLogOnDetails = new PropertyBag();
            crLogOnDetails["Local XML File"] = @"C:\Hosts.xml";
            crLogOnDetails["Local Schema File"] = @"C:\Hosts.xsd";

            ConnectionInfo conn = new ConnectionInfo();
            conn.Attributes = crLogOnDetails;
           
            // create "Host" table
            CrystalDecisions.ReportAppServer.DataDefModel.Table tbl;
            tbl = new CrystalDecisions.ReportAppServer.DataDefModel.Table();
            tbl.Name = "Host";
            tbl.ConnectionInfo = conn;

            rcDoc.DatabaseController.AddTable(tbl, null);

I am getting exception exactly at the above line (i.e. when adding table to Database Controller) saying "COMException was unhandled" with error code 0x80004005 Unspecified error.

Can any one please help me regarding how to resolve this.

Thanks in advance,
Kishore

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.