DataSource Relations are Not working on tamplate with Code.

Stimulsoft Reports.NET discussion
Post Reply
roomy
Posts: 61
Joined: Mon May 06, 2013 12:34 pm

DataSource Relations are Not working on tamplate with Code.

Post by roomy »

With my report datasource relations create issue when I use C# code. I have a template with controls, datasource and relation,
when i use XML file all relations are working file. please find an exampls with attachment.

But with Code all relations are fail. Code I use :

Code: Select all

    StiReport report1 = new StiReport();
    report1.Load(templatePath);
    DataSet ds = new DataSet();
    DataReportFunction(ref ds);
   // ds.Relations.Add("Prod_Comp_Info",ds.Tables["P"].Columns["productid"], ds.Tables["Child"].Columns["productid"]);
    report1.Dictionary.DataSources.Clear();
    report1.RegData(ds);
    report1.Dictionary.Synchronize();
    report1.Compile();
    ds.Dispose();
[/color]
Attachments
Weds.xml
(56.03 KiB) Downloaded 176 times
Compare1.mrt
(32.36 KiB) Downloaded 165 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: DataSource Relations are Not working on tamplate with Co

Post by Alex K. »

Hello,

Can you please send us a sample project which reproduce the issue for analysis.

Thank you.
roomy
Posts: 61
Joined: Mon May 06, 2013 12:34 pm

Re: DataSource Relations are Not working on tamplate with Co

Post by roomy »

I got the solution here..

I need to remove report1.Dictionary.DataSources.Clear();
Thanks Aleksey.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: DataSource Relations are Not working on tamplate with Co

Post by HighAley »

Hello.

Let us know if you will need any additional help.

Thank you.
Post Reply