Click here to Skip to main content
13,505,493 members
Rate this:
Please Sign up or sign in to vote.
See more:
i am trying to load and display report from xml file, i was able to do this using crystal report, i am having some difficulties doing this with microsoft report. please anyone know how to do this?

here is my code using crystal report:

The XML File:

 <pre><xs:schema id="PersonalKYCRep" xmlns="" xmlns:xs="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="CorpKYCDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="CorpKYCReportFile">
              <xs:element name="ContactName" type="xs:string" minOccurs="0" />
              <xs:element name="ContactPhone" type="xs:string" minOccurs="0" />
              <xs:element name="ContactEmail" type="xs:string" minOccurs="0" />
              <xs:element name="CurrentAddress1" type="xs:string" minOccurs="0" />
              <xs:element name="CurrentAddress2" type="xs:string" minOccurs="0" />
              <xs:element name="CurrentCity" type="xs:string" minOccurs="0" />
              <xs:element name="CurrentState" type="xs:string" minOccurs="0" />

The C# Code:

ReportDocument NRep = new ReportDocument();

public void filler(String table, int ind)
        if (ind == 0)
        myAdapter.Fill(myDataSet, table);

public DataSet corDetail(string RecordID, int source)

using (SqlConnection myConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
            SqlCommand cmd = new SqlCommand("AVS_usp_GetPhcnByIDReport", myConn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@RecordID", SqlDbType.VarChar).Value = RecordID;
            cmd.Parameters.Add("@source", SqlDbType.Int).Value = source;
            //SqlDataReader rdr = new SqlDataReader();

            myAdapter = new SqlDataAdapter() ;
            myDataSet = new DataSet();
            myAdapter.SelectCommand = cmd;
            if (source == 1)
                filler("PersonalKYCRep", 0);
                filler("SubReportFile", 0);
            return myDataSet;

Please any assistance will be appreciated. Thanks in advance
Posted 7-May-14 21:35pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180417.1 | Last Updated 8 May 2014
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100