473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Regarding Crystal Reports in Asp.net 2.0

Hi,

I have a .aspx page and a crystal report named prernaweb.rpt.

.aspx page
Page_Load

{
CrystalDecisions.CrystalReports.Engine.ReportDocum ent crReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocum ent();

crReportDocument.Load("d:\\webrptprerna\\prernaweb .rpt");
SqlConnection conn = new SqlConnection("Data Source=AS4;Initial Catalog=Prerna;User Id=sa");
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "select * from view1";
da.SelectCommand = cmd;
da.Fill(ds, "view1");

crReportDocument.SetDataSource("view1");
Crystalreportviewer.ReportSource = crReportDocument;
Crystalreportviewer.DataBind();

}

I have called crystal report in .aspx page load. But I am unable to see the data when I run the web page.
I need sample code and help regarding this.

Thanks
Sravanthi
Jun 25 '07 #1
1 1159
dip_developer
648 Expert 512MB
Hi,

I have a .aspx page and a crystal report named prernaweb.rpt.

.aspx page
Page_Load
{
CrystalDecisions.CrystalReports.Engine.ReportDocum ent crReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocum ent();

crReportDocument.Load("d:\\webrptprerna\\prernaweb .rpt");
SqlConnection conn = new SqlConnection("Data Source=AS4;Initial Catalog=Prerna;User Id=sa");
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "select * from view1";
da.SelectCommand = cmd;
da.Fill(ds, "view1");

crReportDocument.SetDataSource("view1");
Crystalreportviewer.ReportSource = crReportDocument;
Crystalreportviewer.DataBind();

}

I have called crystal report in .aspx page load. But I am unable to see the data when I run the web page.
I need sample code and help regarding this.

Thanks
Sravanthi
I recommend you to change only one line
crReportDocument.SetDataSource("ds");

lets see what happens....
Jun 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
3
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data...
0
by: Swaroop Bhattacharyya | last post by:
I want to access IBM DB2 CLP from Crystal Reports.This is for schedueling a job in Crystal Reports. How will i link the Crystal Reports and the IBM DB2 CLP ?
1
by: mahesh123 | last post by:
Hi, I am using the VB6.0 and for report crystal reports 8.0. the reports are not openning(means its openning but immediately it is closed the report) when we installed the reports in other system....
3
by: Miro | last post by:
Hi, Just wondering what a good book is on visual studios 2008 ( or 2005 if no 2008 ) that teaches you how to properly use crystal reports with it. Or im assuming that as long as I can create a...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
by: akshaycjoshi | last post by:
Most of you people are already familier with the working of crystal reports unlike me.I am working on an application when I have no other option but to use CR. It is very diff. for me to read an...
0
by: swatii | last post by:
I am developing application in c#.net and I am using crystal reports. I want to dynamically load crystal report in report document so that from the same form I can access all the reports. for this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.