Reading around the net lead me to think this was likely to be with something to do with database security or firewall settings. However, after lots of trial and error I found that I had to do the following:-
1) Explicitly fill the datasets that were used in the report.
2) Go through each table in the report and set its data source.
3) Set the report source to the report with the modified tables.
The code I used was as follows:
private void MyForm_Load(object sender, EventArgs e)
{
this.myTableAdapter1.Fill(this.myDataSet1.
MYTABLE);
myReport crtp = new myReport();
foreach (CrystalDecisions.
CrystalReports.Engine.Table
tb in crtp.Database.Tables)
{
tb.SetDataSource(myDataSet1);
}
crystalReportViewer1.ReportSource = crtp;
}
This wasn't anything to do with security settings.
No comments:
Post a Comment