Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 14th, 2006, 10:14 PM
Registered User
 
Join Date: Feb 2006
Location: , , Hong Kong.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing parameters to subreport (C#)

I am passing parameters to both the main report and sub-report. I tried to pass the parameters to the main report like this,

ReportDocument oRpt = new ReportDocument();
ParameterFieldDefinition paramField;
ParameterDiscreteValue mainValue = new ParameterDiscreteValue();
ParameterValues currentValues;

oRpt.Load(Server.MapPath("./Statement_top.rpt"));
oRpt.SetDatabaseLogon(USERID, PWD, SERVER, DB);

paramField = oRpt.DataDefinition.ParameterFields["accountID"];
currentValues = paramField.CurrentValues;
mainValue.Value = accountID;
currentValues.Add(mainValue);
paramField.ApplyCurrentValues(currentValues);

paramField = oRpt.DataDefinition.ParameterFields["fromDate"];
mainValue = new ParameterDiscreteValue();
mainValue.Value = fromDate;
currentValues.Clear();
currentValues.Add(mainValue);
paramField.ApplyCurrentValues(currentValues);

paramField = oRpt.DataDefinition.ParameterFields["toDate"];
mainValue = new ParameterDiscreteValue();
mainValue.Value = toDate;
currentValues.Clear();
currentValues.Add(mainValue);
paramField.ApplyCurrentValues(currentValues);

and then, I tried this,

rOpt.OpenSubreport("Statement_details.rpt");
paramField = oRpt.DataDefinition.ParameterFields["accountID1", "Statement_details.rpt"];
currentValues = paramField.CurrentValues;
mainValue.Value = accountID;
currentValues.Add(mainValue);
paramField.ApplyCurrentValues(currentValues);

it, however, seems the programme tried to pass the parameter to the main report, but not subreport.. Am I do it a wrong way? How can I pass the parameters to subreport in this case?? Thanks mate..
Reply With Quote
  #2 (permalink)  
Old June 11th, 2006, 02:29 AM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am also facing same problem.Any one can help me?

TIA

Reply With Quote
  #3 (permalink)  
Old June 13th, 2006, 01:07 PM
Registered User
 
Join Date: Jun 2006
Location: Scranton, PA, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am also having this problem....but just with a report not a subreport.........
My original posting.......
I am trying to integrate a crystal report into a classic asp application using Visual Studio 2005. I am having trouble passing the active client variable to the report to be used as a parameter.
Can anyone help?

Rob
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing parameter to subreport lathika Visual Studio 2005 0 January 11th, 2008 12:53 PM
Passing parameter values to subreport pvalade Crystal Reports 0 November 21st, 2006 12:30 PM
Passing parameters from main report to subreport Swati_Jain Crystal Reports 0 May 24th, 2006 09:04 AM
Subreport parameters always zero low_entropy Crystal Reports 0 August 6th, 2005 07:05 PM
Passing parameters to subreport KathyW Crystal Reports 0 January 24th, 2005 10:33 PM



All times are GMT -4. The time now is 03:36 AM.


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