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 October 12th, 2006, 04:25 PM
Authorized User
 
Join Date: Oct 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default .net C# crystal reports filtering records

I have a webform1.aspx in which I get employee ID and permissions. I store both values in Session variables. Then I call another webform2.aspx with crystalReportViewer. This consists of a OracleReport1.rpt that has several columns from two different tables: empTbl and permissionsTbl, joined via empid

I created the report by draggin-n-dropping empname and empid from empTbl
and permissions from permissionsTbl, into the OracleReport1.rpt
This works fine as it is.

However, in my webform2.apsx I want to filter the records based on the empid received from the previous webform1.aspx page.
Here is my code in webform2.apsx to do that:

protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
OracleReport1 crReportDocument = new OracleReport1();
TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
protected CrystalDecisions.CrystalReports.Engine.Database crDatabase;
protected CrystalDecisions.CrystalReports.Engine.Tables crTables;
private void Page_Load(object sender, System.EventArgs e)
{
string empid, perm;
empid = (string)Session["empid"];
perm = (string)Session["perm"];

crDatabase = crReportDocument.Database;
crTables = crDatabase.Tables;

No I am completely lost :
Based on the empid, I want to retrieve and display only those rows that match the empid.
How can I Create a sql statement and pass it to ParameterFields ?? to get the filtered values
OR
Write a stored procedure - if so, how to call the stored procedure and pass the values returned from stored procedure to the OracleReport1.rpt?

}

I will really appreciate your help.






Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 1.1,VB.NET,crystal reports, SQl server gvi Crystal Reports 1 September 11th, 2008 02:55 AM
Filtering data in Crystal reports psarr Crystal Reports 1 March 3rd, 2008 04:29 PM
filtering records Vince_421 Access VBA 3 April 2nd, 2007 04:19 PM
ASP.Net with Crystal Reports jazzcatone ASP.NET 1.0 and 1.1 Basics 1 March 1st, 2006 01:11 AM





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