Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 14th, 2003, 02:13 AM
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default subreports not working in ASP.NET

Ok, people, here is what I am trying to do, but am not having any luck so far.

I have a stored proc called FI_DIR_COMPILE, this proc has 6 select statements in it.
Each of the select statements are stored in a table in a dataset called dataset1.

The Data in each table has no relation to data in any other table.
I have created a Crystal Report called test.rpt.
I have added a strong typed report class to test.aspx for test.rpt called test1
I have a Crystal Report viewer called CrystalReport1 on test.aspx

In test.rpt I have 6 sub reports, on for each table.
I have the complete dataset1 mapped into test.
Each subreport only has 1 table from test in it.

The issue is I am getting no data in any of the subreports when I view the main report via test.aspx.

Below is the code I am using, Anyone have a clue ????

Begin c# code

public class WebForm7 : System.Web.UI.Page

{

protected System.Data.SqlClient.SqlConnection connection;

protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;

protected SPROC.test test1 = null;


private void Page_Load(object sender, System.EventArgs e)

{

SqlCommand command = connection.CreateCommand();

command.CommandText="FI_DIR_COMPILE";

command.CommandType=CommandType.StoredProcedure;


fl_dir dataset1;

try

{

SqlDataAdapter adapter = new SqlDataAdapter(command);

dataset1 = new fl_dir();

adapter.Fill(dataset1, "FI_DIR_COMPILE");

adapter.Fill(dataset1, "NUO60");

adapter.Fill(dataset1, "NUOALL");

adapter.Fill(dataset1, "VEHCLASS");

adapter.Fill(dataset1, "fl_recap");

adapter.Fill(dataset1, "bank_total");

adapter.Fill(dataset1, "bank_lease");

}

finally

{

command.Dispose();

connection.Close();

}

test1.SetDataSource (dataset1);

CrystalReportViewer1.ReportSource = test1;


}

#region Web Form Designer generated code

override protected void OnInit(EventArgs e)

{

InitializeComponent();

test1 = new SPROC.test();

base.OnInit(e);

}





 
Old June 17th, 2005, 06:35 PM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you will need to bind the subreports to thier respective data tables, then show the report...

example:

rpt.SetDataSource(rptDs.Tables(0))
rpt.Subreports.Item("subOrgAddresses").SetDataSour ce(rptDs.Tables(1))
rpt.Subreports.Item("subAutoMakersUsed").SetDataSo urce(rptDs.Tables(2))

 
Old August 15th, 2005, 03:31 PM
Registered User
 
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How come I cann't access "Item" in
rpt.Subreports.Item

Is there any library that I should include?
Plz let me know
Thanks in advance.







Similar Threads
Thread Thread Starter Forum Replies Last Post
working with CMS from ASP.NET naidukap ASP.NET 1.0 and 1.1 Professional 0 April 2nd, 2006 05:38 AM
Subreports in asp.net ceema Crystal Reports 0 April 2nd, 2006 01:06 AM
ASP.Net not working astronaut_10 ASP.NET 1.0 and 1.1 Basics 1 August 27th, 2004 02:50 AM
C# code not working with ASP.NET socoolbrewster ASP.NET 1.0 and 1.1 Basics 6 August 25th, 2003 09:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.