Report with custom data guidance

Stimulsoft Reports.NET discussion
Post Reply
jmiller
Posts: 91
Joined: Mon Sep 20, 2010 12:18 pm

Report with custom data guidance

Post by jmiller »

I need some guidance on how to best meet the below requirements. I've been playing with different methods in Stimulsoft and I can't seem to get what I want.
1. My application exposes data as public classes derived from IEnumerable and IEnumerator.
2. These classes have properties that can be used to specify parameters on the data produced by the class.
3. As the class is enumerated, data is produced on an as requested method.

I want to provide a solution to my clients so that they can see my classes in the report dictionary and be able to use Stimulsoft forms to define parameters for those classes.

Example:
class People : IEnumerable
{
public string LastNameStartSearch {}
public string LastNameEndSearch {}
}
class PeopleEnum : IEnumerator {}
class Person
{
public string FirstName {}
public string LastName {}
}

Using the example class names above, I would like to see "People" as a data source in Stimulsoft with "FirstName" and "LastName" as columns.
I would also like to be able to create a form with 2 text fields and somehow bind "People.LastNameStartSearch" and "People.LastNameEndSearch" to them.

I can easily do all of this if the data source was a SQL connection, but I do not know how to do this with my application's data.

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

Report with custom data guidance

Post by Alex K. »

Hello,

If we understand your problem correctly, you can use the RegBusinessObject() method for registration data for your report.

Thank you.
jmiller
Posts: 91
Joined: Mon Sep 20, 2010 12:18 pm

Report with custom data guidance

Post by jmiller »

I've been trying that but have been running into problems.
#1: It looks like if I don't define the columns in code, Stimulsoft will enumerate through my object and determine the columns. It is very possible to take an hour for my application to calculate all of its records (lot of history and complex calculations).

#2: I could not figure out the best way to implement parameters. I tried using dictionary variables. I placed a text field in a Stimulsoft form and I added event code when the form closed to set the variable to the value of the text control. The variable seemed to re-initialized when the report was being rendered.

Here is what I am trying to accomplish:
- Define a schema for the business objects. Stimulsoft is not able to extract the columns from IEnumerable itself. It needs to enumerate through. I don't mind writing code to create the columns if that stops Stimulsoft from attempting to read the data. Remember, it could an hour and the report didn't even enter the design phase.
- Call the report designer to allow the end user to design a report around my business objects. Again report was not designed so it should not be attempting to read the data.
- User creates a form with fields that will be used to drive the filters in my business objects. I do not know the best way to get the values from the fields to my business object.
- When the user previews or runs the report, then it should start determining the actual data. Users will likely enter appropriate filters in the form so that the rendering does not take that long.
- The user can save the report template and load it later.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Report with custom data guidance

Post by Andrew »

Hello,

Theoretically, it can be done with scripts.
We will try to prepare for you a simple example.

Thank you.
jmiller
Posts: 91
Joined: Mon Sep 20, 2010 12:18 pm

Report with custom data guidance

Post by jmiller »

Any luck with an example?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Report with custom data guidance

Post by HighAley »

Hello.
jmiller wrote:Any luck with an example?
Sorry, we was busy with other problems. We'll prepare an answer for you in a few days.

Thank you.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Report with custom data guidance

Post by Ivan »

Hello,

Sorry for the delay with response, all the efforts are put on preparing the release.

Please check the simple sample project in attachment.
There is main script in the Click event of ButtonControl1 on Form1 and initialization script in the LoadForm event of the Form1.

Thank you.
Attachments
1728.TestSolution.zip
(94.35 KiB) Downloaded 314 times
Post Reply