ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dorin Manoli" <Dorin.Man...@dataireland.ie>
Subject RE: report tool
Date Thu, 26 Apr 2007 13:24:15 GMT
Well, have no idea how you could do this: 
report.SetDataSource(listOfObjectsFromIbatis);
if it was done with VS2005 it looks ok. 
But it doesn't work with VS2003 :(

Because it always ask me for a database login.
instead of binding object list directly to report I had to create a
dataset then add data row by row to it, I think it will create
performance troubles.

Thank you for example. I felt very happy when I found solution myself :)

-----Original Message-----
From: Dustin Aleksiuk [mailto:Dustin.Aleksiuk@huskyenergy.ca] 
Sent: Wednesday, April 25, 2007 4:55 PM
To: user-cs@ibatis.apache.org
Subject: RE: report tool

No problem.

Crystal is pretty difficult to use for sure, and the .NET api is not
intuitive. 

We wanted custom parameter forms too, which adds a bit of complexity. By
parameters I don't mean the search parameters, because those go to the
ibatis call to get the data. I mean the Crystal ones. For example,  we
select data for a specific day and want to display that day on the
report.

- I created 1 object per report. It's a simple DTO which has a field for
each column in the report. If numerous reports are pretty similar then
they could of course share this object
- this object gets mapped to a view in iBatis.net in the usual way
- using the crystal designer, I map this same object to the report. You
can do this with Field Explorer -> Database Fields -> <right click> ->
Database Expert. Select .NET objects and map it. The problem here is
that I can't get Crystal to see .NET objects outside of my current
project which really sucks. It means in my case I have to put my Crystal
reports in my "common" project which gets deployed to the client and the
server.

My code looks kind of like this. It's actually abstracted all over the
place, but here's the idea:

GeneratedCrystalReportClass report = new GeneratedCrystalReportClass();
// this is the .cs file that gets generated when you make a .rpt.

report.SetDataSource(listOfObjectsFromIbatis);

// here's the part where you owe me lunch:

ParameterValues parameter1 = new ParameterValues();
ParameterDiscreteValue parameterValue = new ParameterDiscreteValue();
parameterValue.Value = DateTime.Now;
parameter1.Add(parameterValue);

 // "theFieldNameInCrystal" is a Parameter Field you make with the field
explorer in crystal. If you don't set it here then crystal will pop up
its own ugly dialog
// so the user can set it.
report.DataDefinition.ParameterFields["theFieldNameInCrystal"].ApplyCurr
entValues(parameter1r);

Hopefully that gets you on your way. It's not hard code but the
documentation and error reporting is garbage. 

Regards,
Dustin


>>> "Dorin Manoli" <Dorin.Manoli@dataireland.ie> 4/25/2007 8:11 AM >>>
To Dustin: Can you share with us a few samples/ideas? Because I am
beginner with Crystal Reports, I found difficult to create a report at
runtime and design-time too. :(  

-----Original Message-----
From: Dustin Aleksiuk [mailto:Dustin.Aleksiuk@huskyenergy.ca] 
Sent: Tuesday, April 24, 2007 8:48 PM
To: user-cs@ibatis.apache.org 
Subject: Re: report tool

We use iBatis.NET and Crystal. Works fine. iBatis maps a view to a
DTO-type object. We give a list of these to the report object as a
datasource and it works great.

I'm just doing one right now.

Regards,
Dustin


>>> "Dorin Manoli" <Dorin.Manoli@dataireland.ie> 4/24/2007 9:39 AM >>>
Hi Dose anyone use iBATIS in combination with a report tool?

I'm willing to use Crystal reports. but I am not familiar with it. Does
anyone try this combination?


Precision Marketing Information Limited, trading as Data Ireland,
registered in Ireland, registered number 224335, Registered Office:
General Post Office, O'Connell Street, Dublin 1. 

Kompass Ireland Publishers Limited, registered in Ireland, registered
number 98432, Registered Office: General Post Office, O'Connell Street,
Dublin 1.




Precision Marketing Information Limited, trading as Data Ireland,
registered in Ireland, registered number 224335, Registered Office:
General Post Office, O'Connell Street, Dublin 1. 

Kompass Ireland Publishers Limited, registered in Ireland, registered
number 98432, Registered Office: General Post Office, O'Connell Street,
Dublin 1.




Mime
View raw message