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?
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 Afzaal Ahmad Zeeshan 259
1 Maciej Los 240
2 BillWoodruff 240
3 OriginalGriff 220
4 Sergey Alexandrovich Kryukov 195
0 OriginalGriff 6,419
1 Sergey Alexandrovich Kryukov 6,008
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 4,070


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.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