Some newbie questions

Stimulsoft Reports.NET discussion
Post Reply
Tobias Grimm
Posts: 19
Joined: Tue Oct 23, 2007 9:16 am
Location: Germany

Some newbie questions

Post by Tobias Grimm »

Hello,

today I had some time again for playing around with the Reports.Net demo and so far I am quite impressed. But I still have some questions:

1. I have some user defined functions, like checksum calculations or a gettext-like translation function, which I would like to use from within the designer. Is there a way to make e.g. Common.I18N.translate() available to the designer?

2. The report data I use is retrieved from NHibernate and usually is a bunch of lists / IEnumerables of domain objects or DTO's. Let's take for example this class:

Code: Select all

public class ProductSalesReportData
{
    public Product Product  {...}
    public decimal Quantity {...}
    public decimal Amount {...}
}
I now register an IEnumarble list of ProductSalesReportData: report.RegData("Report", reportData);

In the designer I now see:

Code: Select all

+Report
    +Report
        Quantity
        Amount
        +Product
            Number
            Text
            Price
            +Vat
                Number
                Value
            +Department
                Number
                Name
So far so good, but there's also a Report_Product, Report_Vat and Report_Department in the datasource. What's the difference between "Report.Product.Number" and "Report_Product.Number"?

3. The domain objects and DTO's mentiond in my second question are defined in a separate assembly. The designer complains about not finding the namespace the domain classes are defined in. I tried:

Code: Select all

report.ReferencedAssemblies = new string[] { "MyApp.Domain.dll" };
...but this didn't help. How do I need to add the required assembly references?

4. Is there a way to use Stimulsoft.Report.Web.dll somehow to provide reports from a built-in webserver in a WinForms application, maybe with Cassini?

s/MikeT/Tobias/
Tobias Grimm
Posts: 19
Joined: Tue Oct 23, 2007 9:16 am
Location: Germany

Some newbie questions

Post by Tobias Grimm »

Ok, you can skip question #3. I haven't seen, that ReferencedAssemblies ar stored in the mrt, so of course I need to configure ReferencedAssemblies AFTER loading the mrt.
s/MikeT/Tobias/
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Some newbie questions

Post by Edward »

MikeT wrote:1. I have some user defined functions, like checksum calculations or a gettext-like translation function, which I would like to use from within the designer. Is there a way to make e.g. Common.I18N.translate() available to the designer?
Yes, it is possible. Please see the following flashing tutorial on how to do it:

http://www.stimulsoft.com/livedemos/Rep ... ction.html

So just provide a namespace required.
MikeT wrote:2. The report data I use is retrieved from NHibernate and usually is a bunch of lists / IEnumerables of domain objects or DTO's. Let's take for example this class:

Code: Select all

public class ProductSalesReportData
{
    public Product Product  {...}
    public decimal Quantity {...}
    public decimal Amount {...}
}
I now register an IEnumarble list of ProductSalesReportData: report.RegData("Report", reportData);

In the designer I now see:

Code: Select all

+Report
    +Report
        Quantity
        Amount
        +Product
            Number
            Text
            Price
            +Vat
                Number
                Value
            +Department
                Number
                Name
So far so good, but there's also a Report_Product, Report_Vat and Report_Department in the datasource. What's the difference between "Report.Product.Number" and "Report_Product.Number"?
All the data which is registered in the Reports Dictionary are converted into DataSet. So the "Product" is the name of the Relation in the "Report.Product.Number" expression. Via this relation Report and Product datasources can be linked together.
Report_Product represents the second level of the hierarchy in the registered DataSet.

So the 'Number' has the same value, but it could be referenced from two different DataSources.

Thank you.
Tobias Grimm
Posts: 19
Joined: Tue Oct 23, 2007 9:16 am
Location: Germany

Some newbie questions

Post by Tobias Grimm »

Thanks for the link - adding a function this way, works fine!

About the Reports Dictionary:

If I get you right, then what I see in the reports dictionary are instances of StiBusinessObjectSource, one for each relation between a parent object and it's child.
But why do I need all these datasources? What's the point in having a Report_ProductDataSource, when I get the same information from ReportDataSource? IMHO this would only make sense, when the relation is between a parent and a list of childs.

I think here only one datasource is needed:

Code: Select all

public class Parent
{
    string ParentField { get; }
    Child ChildField { get; }
}
But here two are needed, when e.g. printing a master/detail report.

Code: Select all

public class Parent
{
    string ParentField { get; }
    IList ChildsField { get; }
}
Am I missing something?
s/MikeT/Tobias/
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Some newbie questions

Post by Edward »

Having relations between different DataSources helps to build Master-Detail reports like in the following flashing tutorial:

http://www.stimulsoft.com/livedemos/Rep ... ort_2.html

Also you can limit the number of the nesting in complex business objects by setting the following static property:

Stimulsoft.Report.StiOptions.Dictionary.BusinessObjects.MaxLevel

before the object is registered with RegData()

Thank you.
Tobias Grimm
Posts: 19
Joined: Tue Oct 23, 2007 9:16 am
Location: Germany

Some newbie questions

Post by Tobias Grimm »

Ok, the MaxLevel setting is exactly what I was looking for. It works fine if I don't need an Master/Detail reporting.
s/MikeT/Tobias/
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Some newbie questions

Post by Edward »

Please let us know if any help is required.

Thank you.
Post Reply