Reputation: 891
I have some information in a DataTable and want show them in report. I use stimulsoft for reporting.
now I want change value of some columns and show changed value in report.
this is my code:
SqlCommand sqlcom = new SqlCommand();
SqlDataAdapter sqladap = new SqlDataAdapter();
DataTable dt = new DataTable();
sqlcom.Connection = main.sqlcon;
sqladap.SelectCommand = sqlcom;
sqlcom.CommandText = "select * from table ...";
sqladap.Fill(dt);
dt.TableName = "userhusband";
StiReport rpt = new StiReport();
rpt.Load(Application.StartupPath + @"\data\Report.mrt");
rpt.RegData(dt);
rpt.Dictionary.Synchronize();
rpt.Show();
now how change value of some columns and show in report ?
Upvotes: 0
Views: 1147
Reputation: 2739
You need to reset your report before binding again to it!
Just use rpt.Reset()
in top of your report code. and in asp.net use StiWebViewer1.ResetReport()
(assuming StiWebViewer1
is the element in your asp page).
Upvotes: 1
Reputation: 885
You can change the dt value like below then show it in your report
for(int i = 0; i < dt.Rows.Count; i++)
{
dt.Rows[i][columnNumber] = "newValue"; }
}
Upvotes: 0