473,406 Members | 2,273 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,406 software developers and data experts.

generate crystal reports

Hi i am new to .Net.I am developing a portal in asp.net2.0.How to generate crystal reports in asp.net.Please provide me a detailed step for this..Please guide me in this matter...If possible provide me some link regarding this.
May 14 '07 #1
4 2426
dip_developer
648 Expert 512MB
Hi i am new to .Net.I am developing a portal in asp.net2.0.How to generate crystal reports in asp.net.Please provide me a detailed step for this..Please guide me in this matter...If possible provide me some link regarding this.

A small snippet..........try this.........

Add a Report to the project. say rptReport
Add a CrystalReportViewer object to the webform

add a button and in the click event write the following code

Expand|Select|Wrap|Line Numbers
  1.  Dim rptDailyCollection As New rptReport()
  2.  
  3.        Dim dsDailyCollection As New DataSet()
  4.  
  5.            con = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("dsn"))
  6.     'Dim sql As String = "Select * from dbo.DailyCollection(" & CDate(lblCollectionDate.Text) & ")"
  7.  
  8.     Dim sql As String = "Select * from dbo.DailyCollection(@CollectionDate)"
  9.  
  10. Dim daDailyCollection As New SqlDataAdapter(sql, con)
  11.            daDailyCollection.SelectCommand.Parameters.Add(New SqlParameter("@CollectionDate", SqlDbType.SmallDateTime, 4, "CollectionDate"))
  12.            daDailyCollection.SelectCommand.Parameters("@CollectionDate").Value = CDate(lblCollectionDate.Text)
  13.  
  14. daDailyCollection.Fill(dsDailyCollection)
  15. rptDailyCollection.SetDataSource(dsDailyCollection)
  16. CrystalReportViewer1.ReportSource = rptDailyCollection
  17. CrystalReportViewer1.DataBind()
May 15 '07 #2
hi
I tried the above programe and I'm getting two errors before debugging..

One is @ Dim rptDailyCollection As New rptReport()

here I tried with my rpt file

'DailyBalance.rpt' --> report name

here I'm getting 'Daily Balance is not defined'

The second one is @ Dim daDailyCollection As New SqlDataAdapter(sql, con)

here I'm getting 'Overload resolution failed because no accessible 'New' can be called without a narrowing conversion....

Please help me ... I'm using Oracle database...

A small snippet..........try this.........

Add a Report to the project. say rptReport
Add a CrystalReportViewer object to the webform

add a button and in the click event write the following code

Expand|Select|Wrap|Line Numbers
  1.  Dim rptDailyCollection As New rptReport()
  2.  
  3.        Dim dsDailyCollection As New DataSet()
  4.  
  5.            con = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("dsn"))
  6.     'Dim sql As String = "Select * from dbo.DailyCollection(" & CDate(lblCollectionDate.Text) & ")"
  7.  
  8.     Dim sql As String = "Select * from dbo.DailyCollection(@CollectionDate)"
  9.  
  10. Dim daDailyCollection As New SqlDataAdapter(sql, con)
  11.            daDailyCollection.SelectCommand.Parameters.Add(New SqlParameter("@CollectionDate", SqlDbType.SmallDateTime, 4, "CollectionDate"))
  12.            daDailyCollection.SelectCommand.Parameters("@CollectionDate").Value = CDate(lblCollectionDate.Text)
  13.  
  14. daDailyCollection.Fill(dsDailyCollection)
  15. rptDailyCollection.SetDataSource(dsDailyCollection)
  16. CrystalReportViewer1.ReportSource = rptDailyCollection
  17. CrystalReportViewer1.DataBind()
Oct 1 '07 #3
jaymin
1
which tool i have to use for crystalreport
Feb 25 '08 #4
dip_developer
648 Expert 512MB
hi
I tried the above programe and I'm getting two errors before debugging..

One is @ Dim rptDailyCollection As New rptReport()

here I tried with my rpt file

'DailyBalance.rpt' --> report name

here I'm getting 'Daily Balance is not defined'

The second one is @ Dim daDailyCollection As New SqlDataAdapter(sql, con)

here I'm getting 'Overload resolution failed because no accessible 'New' can be called without a narrowing conversion....

Please help me ... I'm using Oracle database...
the code i gave is for SQL-Server....not for oracle.....from your query how can anyone understand about your database...????
.NET has a class oraClient same as sqlClient .......

use this class to connect oracle.......
Feb 25 '08 #5

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

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
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: jijo kuruvila | last post by:
How we can Dynamically generate a MS Word document using ASP.Net? -- Jijo kuruvila trivandrum,Kerala,India
0
by: Richard Lister | last post by:
Hello, I need my ASP.NET application to generate a few PDF documents, such as Purchase Orders, Payment Receipts etc. I thought one easy way to do it might be to use Crystal Reports which I...
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....
0
by: Robert Warnestam | last post by:
Hello, I have some problems deploying Crystal Reports. I'm using Visual Studio 2005 Beta 1. In this version Crystal Reports (9.7.3500.0) is included. I created a small test application...
6
by: Just D. | last post by:
All, Do we have some service/app/control to generate in our WebApplication the downloadable RTF/PDF file. The original data can be provided in the DataSet or DataView, plus some text like...
1
Coldfire
by: Coldfire | last post by:
Problem background: I am developing a windows application (in VisualStudio.Net 2005) that inserts an Institute Info and based on the query I need to generate a report featuring the Detailed...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.