Click here to Skip to main content
11,580,926 members (67,379 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET SQL-Server HTML MySQL , +
I would like to try Crystal Reports for asp.net web applications.

I have done it with Windows application, but for Web application i don't know how to use naming and reference.
I am not able to get reference from system. I do have question like whether we will be able to do Crystal Reports in Web application only if we add some dll or not?
Whether we need to have vs2010 for adding Crystal Reports in web application?
So I am confused, not getting any idea.

If possible please try to give me some sample code with clear explanations.

I tried Googling, but its not enough to find an answers

Thanks
Regards
velu
Posted 30-Mar-12 22:09pm
Edited 30-Mar-12 23:02pm
v2
Comments
André Kraak at 31-Mar-12 5:03am
   
Edited question:
Formatted text/code
Removed unnecessary tags
Laxmikanta Pradhan at 10-Feb-14 5:06am
   
I have also a question that in my web application in asp.net 4.0 there is no such option for crystal report viewer. please give some idea.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This code is working in my web application try it.
rpt = new ReportDocument();
CrystalReportViewer1.Enabled = true;
string str = "rptInvoiceDetails.rpt";
rpt.Load(Server.MapPath(str));
 
DataTable dt = new DataTable();
string strConn = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
SqlConnection MyCon = new SqlConnection(strConn);
SqlDataAdapter adp = new SqlDataAdapter("ProcedureName", MyCon);
 
adp.SelectCommand.CommandType = CommandType.StoredProcedure;
adp.SelectCommand.Parameters.Add("@Param1", SqlDbType.Int).Value = ParamValue1;
adp.SelectCommand.Parameters.Add("@Param2", SqlDbType.Int).Value = ParamValue2;
adp.SelectCommand.Parameters.Add("@Param3", SqlDbType.Int).Value = ParamValue3;
adp.SelectCommand.Parameters.Add("@Param4", SqlDbType.Date).Value = ParamValue4;
adp.Fill(dt);
 
rpt.SetDatabaseLogon(SqlUser, SqlPassword, SqlServer, SqlDatabase);
rpt.SetDataSource(dt);
CrystalReportViewer1.ReportSource = rpt;
CrystalReportViewer1.Visible = true;
  Permalink  
v2
Comments
André Kraak at 31-Mar-12 5:03am
   
Edited solution:
Added pre tags
Joanna Teyew at 24-Apr-12 21:40pm
   
where is ParamValue from?
Member 11316802 at 18-Dec-14 9:13am
   
ReportDocument.Load Method causing it to fail and results in Invalid file name. I have also added permission to temp folder still it doesn't solve the problem.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
v2
Comments
pashad at 6-Apr-12 0:24am
   
Links formatted
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

For Web Applications just go through the post posted by tarun, Refer this-

Generate a Report using Crystal Reports in Visual Studio 2010[^]

At the basic,you need to have Typed Dataset, A Report Viewer, Report document to display the Report...
Refer the above document, It will surely Help,

All the BestSmile | :)
  Permalink  
Comments
Member 11605049 at 25-Apr-15 3:09am
   
in application use a crystal report but in that i want to pass a parameter to crystal report so tell me the solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Frankie-C 195
1 OriginalGriff 184
2 F-ES Sitecore 80
3 Andy Lanng 75
4 Afzaal Ahmad Zeeshan 75
0 OriginalGriff 1,108
1 Sergey Alexandrovich Kryukov 785
2 Abhinav S 622
3 F-ES Sitecore 500
4 Suvendu Shekhar Giri 433


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 6 Apr 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100