c# databand and DataRelation

Stimulsoft Reports.WPF discussion
Post Reply
rzanardini
Posts: 11
Joined: Fri Feb 11, 2011 8:41 am
Location: Italia

c# databand and DataRelation

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

c# databand and DataRelation

Post 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.
rzanardini
Posts: 11
Joined: Fri Feb 11, 2011 8:41 am
Location: Italia

c# databand and DataRelation

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

c# databand and DataRelation

Post 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.
rzanardini
Posts: 11
Joined: Fri Feb 11, 2011 8:41 am
Location: Italia

c# databand and DataRelation

Post by rzanardini »

Hi,
I have tested your new version (2011.04.12) but I have the same problem.

Riccardo.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

c# databand and DataRelation

Post 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.
Post Reply