Page 1 of 2

DataSource from an Assembly

Posted: Thu May 03, 2012 10:28 am
by JobaDiniz
I have a class that works as DataAccess layer in my application. It has a method with this signature: IEnumerable List(string filter).
Is it possible to within the report design call this method?

I want that my DataSource comes from an Assembly, specifically from a method.
I don't want to, from code behind, call this List method and set the RegBusinessObject with the returned IEnumerable. I just wan to tell the Stimul where to find the source.

Is it possible?

DataSource from an Assembly

Posted: Fri May 04, 2012 2:28 am
by HighAley
Hello.
JobaDiniz wrote:I have a class that works as DataAccess layer in my application. It has a method with this signature: IEnumerable List(string filter).
Is it possible to within the report design call this method?

I want that my DataSource comes from an Assembly, specifically from a method.
I don't want to, from code behind, call this List method and set the RegBusinessObject with the returned IEnumerable. I just wan to tell the Stimul where to find the source.

Is it possible?
We can't imagine what do you want to do.
Could you describe it more detailed?

Thank you.

DataSource from an Assembly

Posted: Mon May 07, 2012 10:18 am
by JobaDiniz
Inside Stimul, can I add a DataSource from assembly, and within that assembly choose which method to call specifying its parameters?
The only thing I want to do in code is:

Code: Select all

StiReport report = new StiReport();
report.Load(path);
report.ShowWithWpf();
All my settings regarding the DataSource and parameter have to be inside StimulReport itself.
Can it be done?

DataSource from an Assembly

Posted: Tue May 08, 2012 7:27 am
by HighAley
Hello.
JobaDiniz wrote:Inside Stimul, can I add a DataSource from assembly, and within that assembly choose which method to call specifying its parameters?
The only thing I want to do in code is:

Code: Select all

StiReport report = new StiReport();
report.Load(path);
report.ShowWithWpf();
All my settings regarding the DataSource and parameter have to be inside StimulReport itself.
Can it be done?
You should use RegBusinessObject() method to register your Business Object before showing it.

Thank you.

DataSource from an Assembly

Posted: Tue May 08, 2012 1:40 pm
by JobaDiniz
That's the whole point: I don't want to call this method to register my Business Objects.
I want to tell the Stimul where to find my Business Objects when it is rendering.

Example: inside MyAssembly.dll exists a class MyClass, and inside it exists a method IEnumerable MyMethod(string parameters).

So, Stimul: this is the assembly you'll be using, this is the class within that assembly, this is the method of the class and those are the parameters you'll need. They are all there, so when it is needed use them to render the report.

I can't be more clear than that.

DataSource from an Assembly

Posted: Fri May 11, 2012 10:24 am
by HighAley
Hello.
JobaDiniz wrote:That's the whole point: I don't want to call this method to register my Business Objects.
I want to tell the Stimul where to find my Business Objects when it is rendering.

Example: inside MyAssembly.dll exists a class MyClass, and inside it exists a method IEnumerable MyMethod(string parameters).

So, Stimul: this is the assembly you'll be using, this is the class within that assembly, this is the method of the class and those are the parameters you'll need. They are all there, so when it is needed use them to render the report.

I can't be more clear than that.
Please, send us your assembly with Business Object and information how to create the report for analysis.

Thank you.

DataSource from an Assembly

Posted: Thu May 17, 2012 10:22 am
by JobaDiniz
Similar to these links:

http://www.thescarms.com/dotnet/DLLDatasource.aspx (Crystal Reports)
http://support.microsoft.com/kb/920769 (Reporting Services)

They invoke a specified method to get the data.

DataSource from an Assembly

Posted: Fri May 18, 2012 8:39 am
by HighAley
Hello.

We couldn't help you without library with Business Objects that you use.

We could show you code how to connect xml data in the report. You should write this code at the design time in the code tab.

Code: Select all

public Report()
        {
            this.InitializeComponent();

            DataSet ds = new DataSet();
            ds.ReadXml("d:\\Demo.xml");

            Categories.DataTable = ds.Tables["Categories"];
        }
Other way you should use RegBusinessObject() method.

Thank you.

DataSource from an Assembly

Posted: Wed Jun 27, 2012 9:37 am
by denis.bredikhin
In our project we had almost the same problem. And it was solved with custom data provider. But it was not very easy...
But now we actually can run any code as data source. We even can run method inside the report as data source!

You need to create your own class, derived from StiSqlAdapterService, and override method ConnectDataSourceToData (and may be some other methods).

If you are interested, I can post some parts of code here.

DataSource from an Assembly

Posted: Fri Jun 29, 2012 2:00 am
by HighAley
Hello.
denis.bredikhin wrote:In our project we had almost the same problem. And it was solved with custom data provider. But it was not very easy...
But now we actually can run any code as data source. We even can run method inside the report as data source!

You need to create your own class, derived from StiSqlAdapterService, and override method ConnectDataSourceToData (and may be some other methods).

If you are interested, I can post some parts of code here.
OK. It will be useful to see your code.

Thank you.