Ok, I've redone the whole thing. Created a SqlDataAdapter, from which, generating a new dataset. Created a new .rpt file, pointing the Database fields to my dataset under Project Data, but there are no fields being dragged onto the details section. Created
a .aspx page with a crystalreportviewer control(same page as my adapter and dataset) Here's the code on page load:
Dim comm As String = "Select * from vew_leave_report"
Dim MyCommand As New SqlCommand()
MyCommand.Connection = SqlConnection1
MyCommand.CommandText = comm
MyCommand.CommandType = CommandType.Text
SqlDataAdapter1.SelectCommand = MyCommand
Dim ds As New DataSet1()
SqlDataAdapter1.Fill(ds, "vew_leave_report")
Response.Write(ds.Tables("vew_leave_report").Rows.Count)
Dim myReport As New CrystalReport1()
myReport.SetDataSource(ds)
CrystalReportViewer1.ReportSource = myReport
response.write returns me 70, and i just get a blank page.
I dragged a few Datafields onto my .rpt file, it's working now. I was under the impression that everything will be displayed based on my SQL command, thus not having to touch anything over on the .rpt
You can use a wizard when creating a report that will do most of the data placement for you but it is best to do it yourself. Now you can add groups, graphs, sub reports, etc. Ryan
Thanks for the help, I have successfully managed to pushed a dataset, and my .rpt file is able to display the data. So, now, how do I go about doing the drilled down version?
Leave Type Leave Entitled Leave Taken Leave Left
Medical 20 days 2 days 18 days
Medical 20 days 1 day 19 days
Maternity 14 days 4 days 10 days
The above view is by default of what my .rpt file outputs(Similar example to that of my first post)
So if I push in such a dataset into my .rpt file, how do I get the Leave Type column to be distinct, and displaying a summary of the details.
Leave Type Leave Entitled Leave Taken Leave Left
Medical 20 days 3 days 17 days
Maternity 14 days 4 days 10 days
And upon clicking 'Medical' the report will be 'drilled down' in to the 2 lines
of details under Medical
Thx for sharing the ideas. I had followed the sequence of EXtension' code and drag the field in the details sections of rpt. However, I only display the ds.Table("XXX").Rows.Count and a blank page. I had made sure that there are records in my tables. What's
happen?? Can anyone help me?
In the section expert use the suppress tab to programatically hide sections using the DrillDownGroupLevel variable. When the report is first shown the DrillDownGroupLevel is equal to 0 and every group that is drilldown to increments the DrillDownGroupLevel
value. For example you have a report with 1 group and a detail section, you only want to show the detail section when drilling down on a group so on the suppress tab for the detail section put this formula: if DrillDownGroupLevel >=1 then formula = false else
formula = true Let me know idf this doesn't make sense Ryan I don't really get this part How do I access the surpress tab, and the DrillDownGroupLevel property? Maybe you could explain in a little more detail with my example as reference? Appreciate all the
help so far
eXtension, I have created a new dataset and drag the table i needed into it. Here is my code : Dim comm As String = "Select * from FoodOrderIndex, FoodOrderingItem" Dim MyCommand As New SqlCommand MyCommand.Connection = New SqlConnection(ConfigurationSettings.AppSettings("DSN"))
MyCommand.CommandText = comm MyCommand.CommandType = CommandType.Text Dim da As New SqlDataAdapter da.SelectCommand = MyCommand Dim ds As New Dataset1 da.Fill(ds, "Foodreport") Response.Write(ds.Tables("Foodreport").Rows.Count) Dim myReport As New CrystalReport2
myReport.SetDataSource(ds) CrystalReportViewer2.ReportSource = myReport CrystalReportViewer2.DataBind() What's wrong with me?
eXtension
Contributor
2015 Points
747 Posts
Re: Displaying in Crystal Reports
Jan 31, 2005 06:04 AM|LINK
Dim comm As String = "Select * from vew_leave_report" Dim MyCommand As New SqlCommand() MyCommand.Connection = SqlConnection1 MyCommand.CommandText = comm MyCommand.CommandType = CommandType.Text SqlDataAdapter1.SelectCommand = MyCommand Dim ds As New DataSet1() SqlDataAdapter1.Fill(ds, "vew_leave_report") Response.Write(ds.Tables("vew_leave_report").Rows.Count) Dim myReport As New CrystalReport1() myReport.SetDataSource(ds) CrystalReportViewer1.ReportSource = myReportresponse.write returns me 70, and i just get a blank page.eXtension
Contributor
2015 Points
747 Posts
Re: Displaying in Crystal Reports
Jan 31, 2005 07:44 AM|LINK
RyanSmith
Participant
1944 Points
374 Posts
Re: Displaying in Crystal Reports
Jan 31, 2005 08:54 AM|LINK
RyanSmith
Participant
1944 Points
374 Posts
Re: Displaying in Crystal Reports
Jan 31, 2005 10:37 PM|LINK
eXtension
Contributor
2015 Points
747 Posts
Re: Displaying in Crystal Reports
Feb 02, 2005 01:10 AM|LINK
RyanSmith
Participant
1944 Points
374 Posts
Re: Displaying in Crystal Reports
Feb 02, 2005 03:13 AM|LINK
simon_missyo...
Member
485 Points
97 Posts
Re: Displaying in Crystal Reports
Feb 02, 2005 04:46 AM|LINK
eXtension
Contributor
2015 Points
747 Posts
Re: Displaying in Crystal Reports
Feb 02, 2005 05:33 AM|LINK
eXtension
Contributor
2015 Points
747 Posts
Re: Displaying in Crystal Reports
Feb 02, 2005 08:47 AM|LINK
simon_missyo...
Member
485 Points
97 Posts
Re: Displaying in Crystal Reports
Feb 02, 2005 12:51 PM|LINK