grimmersnee Posted February 27, 2003 Posted February 27, 2003 Hi, I have a problem. I have used the readxml method to read the contents of an xml file into a dataset using vb.net and I now want to pass this datasource into a crystal report. Upon creating the crystal report it asks from which datasource I want to base the design, do I point the datasource to a schema.xsd file? I would think that I would and then by passing the xml datasource at runtime it would populate the report. But this is not working. Does anyone have some understanding of this and can critic my code, this would be much appreciated, as I am fairly to new to .net. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim crReportDocument As New CrystalReport4() Dim dsXMLDataset As New DataSet() Dim myTable As DataTable Dim myRow As DataRow Dim myColumn As DataColumn Dim strFilePath As String strFilePath = "c:\myData.xml" dsXMLDataset.ReadXmlSchema(strFilePath) crReportDocument.Database.Tables(0).SetDataSource (dsXMLDataset) CrystalReportViewer1.ReportSource = crReportDocument End Sub Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load End Sub End Class Quote
*Experts* Bucky Posted February 27, 2003 *Experts* Posted February 27, 2003 The XML Schema (.xsd) is just an outline for an XML file, telling how nodes and attributes should be applied. The XSD file does not actually hold any data. The XML file that uses this schema is what contains the data. Instead of using the ReadXmlSchema() method, try the ReadXml() method. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
grimmersnee Posted February 27, 2003 Author Posted February 27, 2003 Thanks for the reply, sorryI accidentlt posted the wrong code, it should of contained xmlread instead, I was jus' playing around with different ideas before I posted. Has anyone used a runtime xml datasource for crystal????? Quote
zzdv Posted March 12, 2003 Posted March 12, 2003 I trying to do the same and all works fine. But when i deploy the solution the report in not Shown. Any Idea Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.