Solved

Crystal Report

Posted on 2009-07-02
2
507 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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