Solved

Crystal Report

Posted on 2009-07-02
2
505 Views
Last Modified: 2012-05-07
Dear, i have 1 main report and 1 sub report.
I want to pass parameter to my subreport using vb.net. i know how to pass parameter to main report but how can we pass the value to the subreport's parameter.
Note:
i want to explain my problem, i have one report having two column Agent name and Creditlimit, and i have subreport having Buyer name and due amount.
i want to pass my agent name throught vb.net2005 (in main report i know how to pass). but i want to pass to sub-report's parameter,  please one point keep in mind, i dont' have Agent name column in subreport. hope so u understand my point.

my sub-report depends on one procedure which is havine one parameter
0
Comment
Question by:mahmood66
2 Comments
 
LVL 5

Expert Comment

by:dhobale
ID: 24763267
Use a selection criteria for your subreport as:

({SUBREPORT TABLE.AGENTNAME} = {?Pm-MAINTABLE.VALUEOFTHEFIELD})

OR

({SUBREPORT TABLE.BUYERNAME} = {?Pm-MAINTABLE.VALUEOFTHEBUYERFIELD})
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24765758
ONe way to do this would be with a shared variable.

In the main report add a formula to the report header.
WhilePrintingRecords;
Shared StringVar AgentName;
AgentName := {?AgentParameter};

In the subreport you can use the value in formulas
WhilePrintingRecords;
Shared StringVar AgentName;


mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now