Page 1 of 1

c# databand and DataRelation

Posted: Wed Apr 06, 2011 10:33 am
by rzanardini
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.

c# databand and DataRelation

Posted: Thu Apr 07, 2011 2:47 am
by Alex K.
Hello,

As a way, please add the necessary relations to the myDatset and then register it in the report dictionary.

Thank you.

c# databand and DataRelation

Posted: Thu Apr 07, 2011 3:46 am
by rzanardini

My dataset have the correctly relations and I have register correctly it in the report Data.
The problem is this:
when I call the method "report.DataSources.Clear();" and then the method "report.RegData(myDataset);" my DataBand1 lost the property "DataRelation".
Curiously my DataBand1 do not lost the property "DataSource".

My Dataset have 2 tables:
1) Table Customers
2) Table CustomersDetails
My DataSet have a relation when the master table is Customers and the child table is CustomersDetails.
Report Data I can see the two table correctly with the correcly relation.

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();
}

my DataBand1 lost the property "DataRelation" and do not lost the property "DataSource".


When I execute the code:

using (var report = new StiReport())
{
report.Load(myBlob);
report.RegData(myDataset);
StiOptions.Designer.DontAskSaveReport = true;
report.DesignWithWpf();
myBlob = report.SaveToByteArray();
}

my DataBand1 do not lost the property "DataRelation" and do not lost the property "DataSource" but in the list of available DataRelations I can se the old table CustomersDetails and a table name "CustomersDetails_2 [CustomersDetails]".


Can you help me?
Thanks in advanced, Riccardo.

c# databand and DataRelation

Posted: Fri Apr 08, 2011 2:44 am
by Alex K.
Hello,

We made some improvements in that direction.
Please check the last release and let us know about the result.

Thank you.

c# databand and DataRelation

Posted: Wed Apr 13, 2011 7:49 am
by rzanardini
Hi,
I have tested your new version (2011.04.12) but I have the same problem.

Riccardo.

c# databand and DataRelation

Posted: Thu Apr 14, 2011 4:15 am
by Ivan
Hello,

We couldn't reproduce this bug on last build.
Please check that you correctly install the last build.
If the issue is still present, please send to us a simple test project with all necessary dll, which reproduces the issue.

Thank you.