Home » Asp.net

ASP.NET MVC Crystal Reports


I am using MVC for a reporting website for our company. I figured out that MVC doesn't support Crystal Reports but Asp.net webforms can be added to it and then there is a workout.

Please suggest me two things..

1) I have 25 Crystal reports to add to the website. Is it a good idea to add webforms and make crystal reports. If somebody can give me an example that would be great.

2) Is there a way that I can use one Report viewer and 25 Crystal reports display according to the condition?

Thanks in Advance. 


3 Answers Found


Answer 1

1. This is a web form question, not asp.net mvc. Please next time do it in appropiate forums


Inayat Rasool:
If somebody can give me an example that would be great

If this


is not good, try



Inayat Rasool:
I can use one Report viewer and 25 Crystal reports  display according to the condition

If the 25 crystal  display same data , but with differnet condition( such a where) ,  put the condition in the data source


Answer 2

Its sounds to be a good answer. Thanks!!!Cool 


Answer 3

If needed for your project it is pefrectly possibly to combine ASP.NET MVC with ASP.NET Web Forms.




I am also very interested to know, when the first service pack of Visual Studio 2010 will be released, because I encountered a serious bug when remote debugging an asp.net or asp.net mvc application.

This bug is reported, see:

Without beeing able to remote debug I cannot develop my next (big) project.
So when there is "no service pack timeline for Visual Studio 2010" I need another way to get this bug fixed as soon as possible, because I simply cannot wait an indefinite time.

What can I do for a solution of this problem?

Horst Seyfried


I was tested "Expanding the Range of Allowable URLs" for this ASP.NET 4 new feature.  The maxUrlLength attribute under <httpRuntime> section in the web.config is only apply to ASP.NET 4 Web Form files.  I couldn't use this feature in ASP.NET MVC 2 that run under ASP.NET 4 application pool.  Does anyone know this problem? 


Can anyone please explain why will anyone go in for asp.net MVC since we can easily implement in asp.net 

While I have heard a lot of discussions about the pros and cons of ASP.NET MVC and webforms, and that there are cases where either one will be a good fit, I think this is ambigious and only reflects a dilemma facing technical decision makers: ASP.NET MVC is politically correct architecturally, but it is still too primitive for real world development, webforms 4.0 has kind of eliminating the weakness of previous web forms, but it is still a Page Controller.

So for enterprise environment where we are talking about large scale projects serving tens of thousands of users, should we adopt ASP.NET MVC today? It is kind of disappointing that the so called 2.0 of ASP.NET MVC is still so primitive. I like to seek feedback from Architects on this issue and your decision points, any comment will be deeply appreciated.



Can anybody help.

I have SSRS running for generating reports.

I want to use report viewer control on my asp.net mvc view. but dont know how to do it.

Is it possible ot use reportviewer on asp.nte mvc view??/



Thanks in advance



I have a web portal which i want to use to expose some SQL Server 2008R2 SSRS Reports to my users who will login.

I want a situation where the users will click on a link and a dialog box will pop up , asking the user to save the generated PDF Report.

A parameter would have been used to generate this report.

Any ideas on this would be appreciated..Thanks.




We are using crystal report 11.5 in vs. 2008 to display report in one of my projects, when I try to display a report in crystal report viewer reports are displayed properly but the toolbar icons (First, Prev, Next, print, etc..) images are not getting displayed and on click of any of these buttons the report vanishes giving a blank page. the images for the same are also available at the path C:\Inetpub\wwwroot\aspnet_client\system_web\2_0_50727\crystalreportviewers115 Please let me know if there any other thing to be done. 

<CR1:CrystalReportViewerid="CrystalReportViewer1"style="Z-INDEX: 102; LEFT: 8px; POSITION: absolute; TOP: 32px" runat="server"Height="50px"Width="350px"></CR1:CrystalReportViewer>






Hi Programmers and Developers,

While calling the crystal report from my web form the following screen is coming before the report.:

We are using VS2005, ASP.NET, VB-Code, Oracle 10g and Crystal Report 2008

The report you requested requires further information.

Server name: 
Database name: 
User name: 
Use Integrated Security 

after entering the Password it is giving the report whereas I have written the Database connection information in my filename.aspx.vb file. the code snippet is as follows:

Sub setDBConnection(ByVal rName As String)

        Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
        Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
        Dim dbConn As TableLogOnInfo = New TableLogOnInfo
        Dim oRpt As ReportDocument = New ReportDocument
        Dim arrTables As Object() = New Object(0) {}
        ReDim arrTables(2)
        crDatabase = oRpt.Database
        crDatabase.Tables.CopyTo(arrTables, 0)

        crTable = DirectCast(arrTables(0), CrystalDecisions.CrystalReports.Engine.Table)
        dbConn = crTable.LogOnInfo
        dbConn.ConnectionInfo.DatabaseName = "MyDatabase"
        dbConn.ConnectionInfo.ServerName = "MyServer"
        dbConn.ConnectionInfo.UserID = "MyUser"
        dbConn.ConnectionInfo.Password = "MyPwd"

        myCrystalReportViewer.ReportSource = oRpt
    End Sub

So after execution of all Why the Password entry screen is coming?

How to skip that screen and get output?

If I am setting the CrystalReportViewer EnableDatabaseLogonPrompt to False, Then it gives the following message.

 "Database logon failed."

If even once the Password entered, after that it never asks for the Password and displays the report.

So, Please sugget me what should I do?

Should I pass the Password once for all reports ?

Your Suggestion will be appreciated

Thanks and regards

Md. Mushtaque



I am developing an application in ASP.net 3.0 and MY SQL database . I want to display column names & values in crystal report as user selects in ASP.net application  and column names and corresponding values will be changed dynamically.

Any help/suggestions and sample code would be appreciated.

Thanks in advance....



I'm using Visual Web Developer 2010 Express, and I'm at the point in my web application where the data from my database (SQL Server 2008 express) needs to be put in a nice format.  So I decided that I want to use Crystal Reports, and I see some online tutorials on how to implement them in ASP.NET/VWD, but I don't see any way to create a .rpt file or add any instance of Crystal Reports into my application.

How does this work?  What exactly do I need to configure/setup so that I can use Crystal Reports in my web application and just in general, Visual Web Developer?

Thanks in advance! :)


I have been trying from the past two weeks to integrate crystal reports into my web application. The problem is "We created some reports using Crystal Reports 2008(Sp2) and we are trying to integrate those reports into webpage. Everything works fine on my local machine but when it is deployed to the production server i ran into a lot of problems..

Problem-1 : First time I load the report it comes to the screen where it prompts for DB  credentials and stucks up there..I mean those are non editable and doesn't go to next screen. On my local machine the report even didn't prompt for DB credentials. Why it prompts when moved to prod'n Box? How to avoid that?

Problem-2: How about the images on parameters screen?


Can somebody please help me out with this issue..Can some body have the code for doing all these stuff


We recently purchased a Crystal Reports Server 2008. Is it possible to integrate the Crystal Report Server Infoview into an ASP.NET application without prompting the user the login credentials and navigating to the particular folder.





I need to generate almost 73 reports using Crystal reports using SQL SERVER. I might get more data from XML so opted ASP.NET MVC2.

I have 2 questions:

1) I have a lot of tables to generate Data Context around 35 ( I was thinking to write more stored procedures). Any help with that?

2) Is it possible to create one Report viewer/Crystal report  to display these reports ( I just need to  Read data by querying on input No CRUD operations)

If somebody can explain me the best process to use. Thanks in Advance. 


Hi Everyone,

Sorry couldn't think of any better Subject..

I am developing a User Reports Module using C#.Net using Visual Studio 2005. Basic purpose of this module is to allow user to be able to run their own Crystal Reports. i.e. if Users have their own Crystal Reports specific to their needs then we allow them to save them and view them from our user reports module.

So when user saves any report we save it on server and save the Physical path of that report in database. Now when user tries to view the report I get the location from database and load it. Which works ok. The issue now is those reports which have got parameters. 

I am not saving any information about parameters in their reports. So I do not have any information about Report Parameters.

This same application exists in VB6. What that VB application does is opens the Crystal Report and then Crystal report asks for needed parameters exactly as it will do if we try to open a crystal report using crystal report and preview it from there it asks for parameter values. 

How can I do that in C#.Net.

VB has got code like this

Global Appl As New CRAXDRT.Application
    Global ViewerReport As New CRAXDRT.Report

 Global Appl As New CRAXDRT.Application

Global ViewerReport As New CRAXDRT.Report

Set ViewerReport = Appl.OpenReport(ReportName)

 Load frmCrystalViewer

 frmCrystalViewer.ViewReport ViewerReport

frmCrystalViewer.Show vbModal

I have no idea what  is "frmCrystalViewer" in above code. Could that be CrystalViewer?

I hope it all make sense to you guys and I am not confusing you.

Any ideas on this? or any suggestions would be very much appreciated.



CR reports take too much of processing time for our web app. I have modified the process to generate reports in the background using ASP.NET asynchronus pages concept.

But now, the reports do NOT render at all. This makes me wonder whether they support background processing at all.


CR reports take too much of processing time for our web app. I have modified the process to generate reports in the background using ASP.NET asynchronus pages concept.
But now, the reports do NOT render at all. This makes me wonder whether they support background processing at all.

CR reports take too much of processing time for our web app. I have modified the process to generate reports in the background using ASP.NET asynchronus pages concept.

But now, the reports do NOT render at all. This makes me wonder whether they support background processing at all.



I'm using crystal report 9 in asp.net 2.0 web site. i couldn't display the image in report.

is anyone having idea about this?

i put the image using Insert Picture.

in my web config , i put following codes,

<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add key="CrystalImageCleaner-AutoStart" value="true" />
<add key="CrystalImageCleaner-Sleep" value="60000" />
<add key="CrystalImageCleaner-Age" value="120000" />




Hi, all:

It is pretty straight forward to export Crystal Report to PDF file, or other files.

protectedvoid btnCrystalReport_Click(object sender, EventArgs e)


   string pID;

   string filePath;

   string sDate;

   ReportDocument rd = newReportDocument();

   pID = tbPID.Text;

   filePath = Request.ServerVariables["APPL_PHYSICAL_PATH"];

   sDate = DatePicker.SelectedDate.ToShortDateString();

   rd.Load(filePath + "FiberMaster.rpt");

   rd.SetParameterValue("Rev", sDate);

   rd.SetParameterValue("PID", pID);

   rd.SetDatabaseLogon("myUser", "myPassword");

   rd.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "ExportedReport");

   //rd.ExportToDisk(ExportFormatType.PortableDocFormat, @"C:\ASP.NET\temp\myfirstCR.pdf"); //OK, it works.


Enjoy and good luck.

Stanley Huang


I just upgraded my web app to ASP.NET 2010 and it now uses Crystal Reports 14.  After I publish it to the server I am able to access the web site and print reports from it on my machine but the reports will not print on any other machine.

All of the required Crystal dlls are in the bin folder on the server.

Any advise?





We've got several Crystal Reports which we have in an older ASP.NET app.  We started this app when ASP.NET 2.0 was first out.  We did all of the reports in Crystal Reports, and have moved up with each version of Crystal until we got to Crystal Reports XI Release 2.  At that time we were using Visual Studio 2005, with Crystal, and this application has been at that version of .NET and Crystal ever since.  I'd really like to move the app to VS 2010, but am not at all certain if it will work with Crystal XI Release 2, or not?  Does anyone know, one way or another?

I'm fairly certain that Crystal XI Release 2 will work with VS 2008. 

The big issue with all of this is installing the Crystal modules (I think they're the .MSM files in Setup and Deployment.)  It is the only way I know of getting CRystal onto the server, so that's why we've done it this way. If I can't go to VS 2010, but can go to VS 2008, then that's OK.  I just want to know which version will play nice with Crystal XI R 2.

This ASP.NET app is a web forms app. 


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure