can I read like datasource to MSSQL xml datatype on fastreport.

edited 7:03AM in FastReport .NET
I have xml datafield in my table.
my report have a lot of litle table different size, columns, rows.
and I save table name, cols, rows and data in xml data field and read with a query.
how I print in my databand with table object this xml datas.

Comments

  • edited 7:03AM
    I found solution

    private void Table1_ManualBuild(object sender, EventArgs e)
    {
    DataSourceBase data = Report.GetDataSource("TESTKALEM");
    data.Init();

    DataSet DS=new DataSet();
    XmlDocument doc=new XmlDocument();
    doc.LoadXml(data["XMLDATA"].ToString());
    DS.ReadXml(new XmlNodeReader(doc));
    int colCount = DS.Tables[0].Columns.Count;
    Table1.PrintRow(0);
    for (int i = colCount-1; i >=0; i--)
    if(DS.Tables[0].Columns.ColumnName!="SIRA")
    {
    Cell1.Text = DS.Tables[0].Columns.ColumnName;
    Table1.PrintColumn(0);
    }
    for(int j=0;j<DS.Tables[0].Rows.Count;j++)
    {
    Table1.PrintRow(1);
    for (int i = colCount-1; i >=0; i--)
    if(DS.Tables[0].Columns.ColumnName!="SIRA")
    {
    DataRow dr=DS.Tables[0].Rows[j];
    Cell2.Text = dr[DS.Tables[0].Columns].ToString();
    Table1.PrintColumn(0);
    }
    }

    }

Leave a Comment