Last post Dec 23, 2010 08:58 AM by ignatandrei
Dec 22, 2010 05:38 PM|ItalianCousin|LINK
I am trying to create an ASP.NET MVC 2 web application with VS 2010 and Crystal Reports
Can you help me?
I need a sample app to study and reproduce and didn't find anything googling and searching.
My goals are two:
create and .aspx web page with a CRViewer the user can interact with;
create a web link that lead to downloading a PDF report with no interaction.
Gone not more far than, as in the link up-given:
ReportClass rptH = new ReportClass(); rptH.FileName = Server.MapPath("[reportName].rpt"); rptH.Load(); rptH.SetDataSource([datatable]); Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); return File(stream, "application/pdf");
I don't understand what the report FileName must be, because of MVC routing, and what kind of datasource is expected (I work with ADO.NET Entity Framework)?
Can you provide me some links to how-to and manual to learn more? I'm just starting up.
Already seen these links:
Dec 22, 2010 10:32 PM|ignatandrei|LINK
1. CR does not function in MVC
2. Usually MVC ignores files already on disk
3. You can create a regular WebForms file(do not put into the views folder! - see web.config) and put there the CR
Dec 23, 2010 12:57 AM|edsharp|LINK
I am sorry to get in your thread but what do you mean by "not t place it in the views folder"?, i have been working with CR for a while and this will help me a lot too.
Dec 23, 2010 04:22 AM|ignatandrei|LINK
see the web.config from views folder in MVC. It is an unauthorized handler to aspx files
Dec 23, 2010 07:33 AM|ItalianCousin|LINK
If I don't ask too much, I would need a sample.
How to get that file, after putting it in a new folder?
How to pass data to the report, if I have an Entity?
Dec 23, 2010 08:58 AM|ignatandrei|LINK