CrystalReport with LLBLGEN

Posts   
 
    
rai
User
Posts: 41
Joined: 25-Jan-2007
# Posted on: 13-Feb-2008 02:16:29   

I want to design crystalreports which is in visual studio 2005 and use llblgen. Has anyone got any idea how to go about using this two. Has anyone done this..... I want to use in my next project....please guide me

Thanks in advance

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Feb-2008 10:10:26   

Please check these simialr questions: http://llblgen.com/TinyForum/Messages.aspx?ThreadID=7797 http://llblgen.com/TinyForum/Messages.aspx?ThreadID=7692

If you still need help, please reply here.

rai
User
Posts: 41
Joined: 25-Jan-2007
# Posted on: 15-Feb-2008 02:12:32   

Is there any example which i can study and get a fair idea . At the moment iam very much confused...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39905
Joined: 17-Aug-2003
# Posted on: 15-Feb-2008 19:32:36   

Report engines in general are often hardcoded to use datasets. Have you tried a simple report with llblgen pro? Our code is written to obey the databinding standard as much as possible (as in: what's described by MS, not everything is public knowledge unfortunately) so whatever control is bindable to a collection, it should work with our collections as well.

Frans Bouma | Lead developer LLBLGen Pro
jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 15-Feb-2008 21:27:44   

you need a report file, schema file, datatable which adheres to schema. there is a schema generator in the 3rd party section of the website.

steps. 1. create TypedList 2. create schema 3. create report 4. report references schema as the datasource 5. put code in place

ReportDocument rpt = new MyReport();
MyTypedList results = new MyTypedList();
new DataAccessAdapter().FetchTypedList(results);
rpt.SetDataSource(results);
//then display report using your method of choice

I usually create my schemas manually, so I don't know the details of using the tool in the 3rd party section. as you can see most of this is design work, not coding work, so it's difficult to explain without images.

rai
User
Posts: 41
Joined: 25-Jan-2007
# Posted on: 16-Feb-2008 03:46:07   

Hi jmeckley

I was following your steps as u told.

  1. create TypedList ---ok
  2. create schema ---ok
  3. create report ---ok
  4. report references schema as the datasource ---ok
  5. put code in place ---not ok Code: ReportDocument rpt = new MyReport(); MyTypedList results = new MyTypedList(); new DataAccessAdapter().FetchTypedList(results); rpt.SetDataSource(results);

Error 1 The call is ambiguous between the following methods or properties: 'CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(System.Collections.IEnumerable)' and 'CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(System.Data.DataTable)' C:\Documents and Settings\jchand\My Documents\Practicals\crystalreport\Project\CrystalReports\CrystalReports\Default.aspx.cs 30 13 CrystalReports

Please tell me how to solve this.......

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 16-Feb-2008 04:41:36   

I haven't used typed lists in a while. If a typed list is defined as: MyTypedList : DataTable, ITypedList, IEnumerable<MyTypedRow> or something like that then this would explain why it's a problem. try casting the typed list to a datatable explicitly

rpt.SetDataSource((DataTable)results);
rai
User
Posts: 41
Joined: 25-Jan-2007
# Posted on: 16-Feb-2008 06:54:50   

Hi jmeckley

Thanks for your great support finally my code is working. Now only i cant see the crystal report toolbar images....

Just wanted to ask can i used stored procedure also.....

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39905
Joined: 17-Aug-2003
# Posted on: 16-Feb-2008 10:43:15   

Usign retrieval stored procedures result in a datatable fetch, so yes you can.

Frans Bouma | Lead developer LLBLGen Pro
jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 16-Feb-2008 16:35:23   

i don't work with crystal directly. instead i export the report to pdf and display to the user.

ReportDocument rpt = new MyReport();
rpt.SetDataSource(myDataTable);
rpt.SetParameter("name", value);
return rpt.ExportToStream(ReportExportFormat.ProtableDocumentFormat);

from here I can either pass directly to the HttpResponse.Stream, save to a file, or convert to a byte array and save to a database.

rai
User
Posts: 41
Joined: 25-Jan-2007
# Posted on: 25-Feb-2008 03:33:14   

Thanks for the support people.