Problem with multi-hierachy object dataSource

Stimulsoft Reports.WEB discussion
Post Reply
Rajesh Tanwar
Posts: 14
Joined: Thu May 14, 2009 2:06 am

Problem with multi-hierachy object dataSource

Post by Rajesh Tanwar »

Hi All,

I am binding the report with object datasourse as shown below:

Code: Select all

StiReport report = new StiReport();
report.Load(Server.MapPath("TestReports/" + Session["FileName"].ToString()));
StiOptions.Dictionary.BusinessObjects.MaxLevel = 2;
string[] references = report.ReferencedAssemblies;
            // Converting the the array to a collection
            List newReferences = references.ToList();
            // Add your Assembly to the list
            newReferences.Add("MyProject.BusinessLib.dll");
            newReferences.Add("Csla.dll");
            // Reset the array of referenced assembly with the converted collection
            report.ReferencedAssemblies = newReferences.ToArray();
BusinessLib.ReportCMHospAssignList rha = BusinessLib.ReportCMHospAssignList.GetReportCMHospAssignList();
            report.RegData("MySource", rha);
            
            report.Dictionary.DataSources.Clear();
            report.Dictionary.Synchronize();
            try
            {
                report.Dictionary.Connect();
                report.Render();
                StiReportResponse.ResponseAsPdf(this.Page, report, true);
                }
            catch (Exception ex)
            {
                ex = null;
            }
Here 'ReportCMHospAssignList' has alias name 'MySource' and members ('TlId','TlName' and 'TlTerritoryList'). Where 'TlTerritoryList' is again a user defined type.
'TlTerritoryList' has members ('TerId' and 'TerName'). So there is two level hierachy.
When I view this report with stimulsoft designer, then there comes two data sources (named 'MyDataSource' and 'MySource_TlTerritoryList') in the 'Dictionary' tab.

When I use any member from 'MySource', then report is rendered successfully and gives expected result.
But when I use any member of 'MySource_TlTerritoryList', then there comes following error:

Code: Select all

c:\Documents and Settings\HSS-116\aspnet~1.hss\Local Settings\Temp\zwbmx98o.0.cs(64,40) : error CS0103: The name 'MySource_TlTerritoryList' does not exist in the current context
As you can see the problem comes with just two levels of hierarchy of business objects, while I've to drill down to 4 levels of hierarchy as well.

I did lot of RnD and still stuck with this issue. Please give me the solution asap to fix the above issue.
Rajesh Tanwar
Posts: 14
Joined: Thu May 14, 2009 2:06 am

Problem with multi-hierachy object dataSource

Post by Rajesh Tanwar »

After further RnD and few of the changes, suddenly things have started working.
So now that error is gone.
But I'm facing another issue in the same scenario.
As I've already explained that 'ReportCMHospAssignList' has alias name 'MySource' and members ('TlId','TlName' and 'TlTerritoryList'). Where 'TlTerritoryList' is again a user defined type.
'TlTerritoryList' has members ('TerId' and 'TerName'). So there is two level hierachy.
'TerId' on the report(after render) is shown correct, but 'TerName' comes empty.
I've checked by debugging that there is data in the source, but after rendering it is not shown on the report.
I am surprized that 'TerId' is shown while 'TerName' is not shown, while both are part of 'MySource_TlTerritoryList'.

Do you've any idea?
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Problem with multi-hierachy object dataSource

Post by Andrew »

Dear, Rajesh.

It is very hard to say some thing without a sample project. Can you please send it to support@stimulsoft.com

Thank you.
Rajesh Tanwar
Posts: 14
Joined: Thu May 14, 2009 2:06 am

Problem with multi-hierachy object dataSource

Post by Rajesh Tanwar »

Hi Andrew,

I've sent images and detailed explanation on "support@stimulsoft.com" (my ticket id is "FCZ-317678").

I did lot of RnD in this regard and is now fed up... Please reply me asap.

Thanks & Regards,
Rajesh Tanwar
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Problem with multi-hierachy object dataSource

Post by Jan »

Hello Rajesh,

We have sent answer to you. Screnshot is not enough to check this problem. We need sample project which illustrate it.

Thank you.
hadisaadat_du
Posts: 35
Joined: Tue Nov 09, 2010 2:43 pm
Location: iran

Problem with multi-hierachy object dataSource

Post by hadisaadat_du »

Hi every body.
I sea allmost all topic in forum and seem int all of them posit that we know what is our tables and columns in dataset of our reportbut allways not thus
1-sometime we may want to edit the report in webdesigner that we dont know any thing about its data set but we sure it works with our data base , so befor call the design() function we pass what data set to our report via regdata(//what_dataset) ??
2- or we may want to set full access to data base to one user to create the every report that need to design well we pass a full data base to designer dictionary and he/she design every report by every columns in every tables or viwes in database and save it , in viwe report mode namely after load our report and we want to pass it to stiwebviewer we pass what data set to it since we cant pass all data base to our report ??!
anuviswan
Posts: 21
Joined: Mon May 02, 2011 6:29 am
Location: india

Problem with multi-hierachy object dataSource

Post by anuviswan »

Hi

Am facing the same issues with Multilevel Hierarchy.
Rajesh, Can you please tell me how you solved it ?

Cheers
Anu
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with multi-hierachy object dataSource

Post by Alex K. »

Hello,

Can you please describe your issue in details? And, if possible, send us a report sample with data.

Thank you.
Post Reply