Click here to Skip to main content
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 23:09pm
Edited 31-Mar-12 0:02am
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 2 days ago
   
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  

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

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 6 Apr 2012
Copyright © CodeProject, 1999-2014
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