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="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="CorpKYCDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="CorpKYCReportFile">
<xs:complexType>
<xs:sequence>
<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" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
The C# Code:
ReportDocument NRep = new ReportDocument();
public void filler(String table, int ind)
{
if (ind == 0)
myDataSet.Clear();
myAdapter.Fill(myDataSet, table);
}
public DataSet corDetail(string RecordID, int source)
{
using (SqlConnection myConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
{
myConn.Open();
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;
myAdapter = new SqlDataAdapter() ;
myDataSet = new DataSet();
myAdapter.SelectCommand = cmd;
if (source == 1)
{
filler("PersonalKYCRep", 0);
}
else
{
filler("SubReportFile", 0);
}
return myDataSet;
}
}
}
Please any assistance will be appreciated. Thanks in advance