CapableObjects forum



Reports from ECO.VS Applications

Posted By guest00 2008-06-11 18:46:12
Add to Favorites0
Author Message
guest00
 Posted 2008-06-11 18:46:12
Supreme Being

Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)

Group: Forum Members
Last Active: 2012-04-18 21:25:33
Posts: 143, Visits: 424
925
Hi All,

I am busy with ECO and rdlc (MS Report) integration. The XmlQueryService is good (Peter, thank you!), but it is quite difficult to generate input query string in xml for non ECO developers. I created for them the DataSource for the ReportViewer.
But the solution is not elegant and flexible.

Will ECO have any Export functionality? For example - I run any OCL against my ECOSpace and then do something like this DataSet ds = ECOSpace.Export() ? (Sorry for the DataSet. I spent more than decade with Microsoft products...) :-)

Thanks a lot ECO Team!

Regards,
Alex
guest00
 Posted 2008-06-12 23:06:01
Supreme Being

Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)

Group: Forum Members
Last Active: 2012-04-18 21:25:33
Posts: 143, Visits: 424
925
I found how to integrate RDLC and ECO in ASP.net
Thank you for the GetAsIList<> method!

If somebody wants to know HOWTO:

1. Create method in your aspx

public IList<NameSpace.Model.Class1> MethodName()
{
string ocl = "Class1.allInstances";
IElement res = this.EcoSpace.Ocl.Evaluate(ocl);
return.GetAsIList<ECO_Reports.Model.Class1>();
}

2. Add reportviewer
3. Design rdlc file -> webSite DataSources ->select Class1
4. Do report's design itself
5. Open ReportViewer SmartTag -> Choose Data Sources -> Data Source Instance slect Class1 and put here you ECODataSource name (EcoDataSource1 by default for WebPage1.aspx). This step is VERY IMPORTANT. I spent 2 days to find this solution :-)
6. Run your application and enjoy. I opened two forms - webform1.aspx and autoform.aspx. Cool

CapableObjects, you did a great tool!
Thanks a lot!

P.S. Next step is SharePoint...
mtiede
 Posted 2009-02-06 21:46:21
Supreme Being

Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)

Group: Forum Members
Last Active: 2011-06-28 16:42:26
Posts: 487, Visits: 1 277
guest00 (2008-06-12)
I found how to integrate RDLC and ECO in ASP.net
Thank you for the GetAsIList<> method!

If somebody wants to know HOWTO:

1. Create method in your aspx

public IList MethodName()
{
string ocl = "Class1.allInstances";
IElement res = this.EcoSpace.Ocl.Evaluate(ocl);
return.GetAsIList();
}



And which aspx would that be? The page aspx the report is to go on?

Can the EcoDataSource somehow be used instead of having to do this?

And how do I do this.EcoSpace.Ocl.Evaluate(ocl) in Eco5? I don't seem to have the same methods.

I have tried something like this:

method _Default.IList: System.Collections.IList;
var
ocl : String;
res : Eco.ObjectRepresentation.IElement;
APersonnel : ORCPersonalPlan.Personnel;
oclService : Eco.Services.IOclService;
begin
oclService := Eco.Services.EcoServiceHelper.GetOclService( EcoSpaceManager1.EcoSpace );
ocl := "Peronnel.allInstances";
res := oclService.Evaluate( ocl );
result := res.GetAsIList;
end;

but compiler complains that "Generic parameter "T" for this method call could not fully be resolved".

What do I need to do?


/mtiede
Environment:
Windows 7 Ultimate 64 bit
Delphi 6
Rad Studio 2010 Enterprise with Prism 2011
2009-02-06 23:00:54 by mtiede
Jonas Hogstrom
 Posted 2009-02-07 00:35:10
Supreme Being

Supreme Being - (7 956 reputation)Supreme Being - (7 956 reputation)Supreme Being - (7 956 reputation)Supreme Being - (7 956 reputation)Supreme Being - (7 956 reputation)Supreme Being - (7 956 reputation)Supreme Being - (7 956 reputation)Supreme Being - (7 956 reputation)Supreme Being - (7 956 reputation)

Group: Administrators
Last Active: 2010-11-30 13:17:13
Posts: 1 230, Visits: 1 382
I have updated the original post with some missing angle brackets, please reread it and see if it makes more sense...

/Jonas Hogstrom [CapableObjects]
mtiede
 Posted 2009-02-07 14:57:22
Supreme Being

Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)

Group: Forum Members
Last Active: 2011-06-28 16:42:26
Posts: 487, Visits: 1 277
It would make more sense if it were in Pascal :-)

But I'll try poking the code again and see if the compiler can make sense of my pokes.


/mtiede
Environment:
Windows 7 Ultimate 64 bit
Delphi 6
Rad Studio 2010 Enterprise with Prism 2011
mtiede
 Posted 2009-02-07 15:13:13
Supreme Being

Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)

Group: Forum Members
Last Active: 2011-06-28 16:42:26
Posts: 487, Visits: 1 277
Here is what I tried after re-reading the first post with code. And that still didn't make sense to me :-)

I don't know what the ECO_Reports.Model.Class1 is. And, in my case, the eco class is Personnel, but the compiler wouldn't let me use ORCPersonalPlan.Model.Personnel. But, after adding the uses for ORCPersonalPlan.*, it let me put in Personnel.

Here's my code:


function _Default.IList<Personnel> : System.Collections.IList;
var
ocl : String;
res : Eco.ObjectRepresentation.IElement;
oclService : Eco.Services.IOclService;
begin
oclService := Eco.Services.EcoServiceHelper.GetOclService( EcoSpaceManager1.EcoSpace );
ocl := "Peronnel.allInstances";
res := oclService.Evaluate( ocl );
result := res.GetAsIList<Personnel>;
end;


Now it complains:

Error 1 (CE15) Type mismatch, cannot assign System.Collections.Generic.IList<Personnel> to System.Collections.IList C:\Users\mtiede\Documents\Visual Studio 2008\WebSites\WebSite8\Default.aspx.pas 61


/mtiede
Environment:
Windows 7 Ultimate 64 bit
Delphi 6
Rad Studio 2010 Enterprise with Prism 2011
2009-02-07 15:19:07 by mtiede
mtiede
 Posted 2009-02-07 16:35:01
Supreme Being

Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)

Group: Forum Members
Last Active: 2011-06-28 16:42:26
Posts: 487, Visits: 1 277
Okay, this compiled.

function _Default.PersonnelList :  System.Collections.Generic.IList<Personnel>;
var
ocl : String;
res : Eco.ObjectRepresentation.IElement;
oclService : Eco.Services.IOclService;
begin
oclService := Eco.Services.EcoServiceHelper.GetOclService( EcoSpaceManager1.EcoSpace );
ocl := "Peronnel.allInstances";
res := oclService.Evaluate( ocl );
result := res.GetAsIList<Personnel>;
end;


Now on to the other step of SOMEHOW getting the report to recognize this as a datasource...

... time passes...

Okay, step 3, I can design the report, but there is not WebSite DataSources anywhere?

... time passes ...

I finally found that I had to open up the report file in design view, then select the solution, then I could show the datasources window. Hurray! That only took an hour yesterday and an hour today...

Now let's see if I can hook it up to Eco...

... time passes ...

Nope, I don't see my class as a datasource to use for the report... Now what?


/mtiede
Environment:
Windows 7 Ultimate 64 bit
Delphi 6
Rad Studio 2010 Enterprise with Prism 2011
2009-02-07 17:24:16 by mtiede
mtiede
 Posted 2009-02-07 17:36:16
Supreme Being

Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)Supreme Being - (3 170 reputation)

Group: Forum Members
Last Active: 2011-06-28 16:42:26
Posts: 487, Visits: 1 277
Do I have to do something with the datasource dataset to hook it up?

I'm stumped.


/mtiede
Environment:
Windows 7 Ultimate 64 bit
Delphi 6
Rad Studio 2010 Enterprise with Prism 2011
guest00
 Posted 2009-06-16 13:00:39
Supreme Being

Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)Supreme Being - (925 reputation)

Group: Forum Members
Last Active: 2012-04-18 21:25:33
Posts: 143, Visits: 424
925
Hi All,

some ideas and tricks. Can be useful. For embedded reports.

If you have ASP.Net WebForm1.aspx with EcoDataSource1 you can add ReportViewer control and then use the EcoDataSource1 as a datasource for the report.

Steps are:

1. Add rdlc file to the ASP.Net project (Add->New Item->Visual C#->Reporting->Report)
2. Add new dataset to the project. This dataset is a definition of the "container" for the data from EcoDataSource1
3. Add tables, columns, etc to the dataset. You should have the "stable" model before reports design
4. Design your report using the dataset
5. Add reportviewer control to the WebForm1.aspx
6. Select ReportViewer1 SmartTag and choose your report (*.rdlc)
7. Then click on "Choose Data Source" link and then select EcoDataSource1 as a "Data Source Instance" for your "Report Data Source"
8. run and enjoy

should work Smile

+ is that OCL in the Expression of the EcoDataSource is the real source of the report instead of direct query from the DB
+ real DB independent solution. So you can forget about first two characters from the abbreviation "MS RSS" Smile
- be careful with the datasets. Some guys copies all the db in to the session. Smile
2009-06-16 13:02:11 by guest00

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top