c# databand and DataRelation
Posted: Wed Apr 06, 2011 10:33 am
Hi,
I have, on my report, a "DataBand".
in my databand I have save the DataRelation and I have save the report file in a Blob.
It run correctly because the code:
using (StiReport report = new StiReport())
{
report.RegData(myDataSet);
report.Load(myBlob);
report.ShowWithRibbonGUI(true);
}
show correctly my report.
The problema appear when I execute the code:
using (var report = new StiReport())
{
report.Load(myBlob);
report.DataSources.Clear();
report.RegData(myDataset);
StiOptions.Designer.DontAskSaveReport = true;
report.DesignWithWpf();
myBlob = report.SaveToByteArray();
}
whit this code my databand lost the DataRelation.
I think the problem is in the istruction "report.DataSources.Clear();" but if I remove this istruction I find in the DataSource list most then one Table!
You can help me?
Thanks in advanced, Riccardo.
I have, on my report, a "DataBand".
in my databand I have save the DataRelation and I have save the report file in a Blob.
It run correctly because the code:
using (StiReport report = new StiReport())
{
report.RegData(myDataSet);
report.Load(myBlob);
report.ShowWithRibbonGUI(true);
}
show correctly my report.
The problema appear when I execute the code:
using (var report = new StiReport())
{
report.Load(myBlob);
report.DataSources.Clear();
report.RegData(myDataset);
StiOptions.Designer.DontAskSaveReport = true;
report.DesignWithWpf();
myBlob = report.SaveToByteArray();
}
whit this code my databand lost the DataRelation.
I think the problem is in the istruction "report.DataSources.Clear();" but if I remove this istruction I find in the DataSource list most then one Table!
You can help me?
Thanks in advanced, Riccardo.