Linking 2 subreports?

Hi can any tell me what is the procedure to link 2 sub reports.

hi Ganesh,
if you want to link main report and sub-report,
there are 3 scenarios
1) Passing the information from main report to sub report
2) Passing the information from sub-report to main report
3) Linking main report field and sub-report field to get relevant data. (This is generally used to know more details from summary)
For 1) and 2) points, Shared variables can be used to pass the data.
For 3) point, you need to right-click the subreport and select 'change sub-report links' option. (A dialog box will be opened where you specify the linkage between main report field and sub-report field)
Regards,
Vamsee

Similar Messages

  • Urgent help required - linked subreport keeps asking for parameter value

    Greetings,
    I have developed a report in the Crystal Reports bundled with Visual Studio 2005. The data is obtained from a stored procedure. One of the fields in the result set is named "Id".
    I have embedded a subreport in the details row of the main report. The subreport also gets its information from a stored procedure. This stored procedure has one parameter named "OpportunityId". This field is linked to the field named "Id" above. the subreport has been set to supress blank subreports.
    In the development environment and running the executable of the application on the development machine the report works perfectly. The subreport displays as it should and all is well.
    When I deploy the report onto user machines where they have the crystal runtime installed, the report keeps asking for a parameter value for the subreport.
    I cannot get this to stop happening.
    This report is urgently required. PLEASE could someone help me out here.
    I am at my wits end.
    I have attached a zipe file containing the following:
    - the two stored procedure
    - the rpt file
    - a sample report
    - a screen showing the report having just been generated
    Thanks in advance,
    Robert Lancaster

    <p>Hi Robert,</p><p>I see your report template and stored procedures. All seems to be ok. <br /></p><p>The most important is to assign the report parameters for all linked subreports (only one in your case).</p><p> </p><p>Try this (in C#, in VB.NET the code are very similary): </p><p>ReportDocument report = new ReportDocument(@"TopFortyReport.rpt");</p><p>AssignParameters(report, paramCollection);</p><p>// and now assign parameters to all linked subreports </p><p>foreach( CrystalDecisions.CrystalReports.Engine.Section section in report.ReportDefinition.Sections)</p><p>{</p><p>    foreach (CrystalDecisions.CrystalReports.Engine.ReportObject reportObject in section.ReportObjects)<br />    {</p><p>        if (reportObject.Kind == ReportObjectKind.SubreportObject) </p><p>        {</p><p>            SubreportObject subReport = (SubreportObject)reportObject;</p><p>            ReportDocument subDocument = subReport.OpenSubreport(subReport.SubreportName);                                               AssignParameters(subDocument, paramsCollection);</p><p>        }</p><p>} </p><p> </p><p>void AssignParameters(ReportDocument report, object[] paramsCollection)</p><p>{</p><p>    int nParams = paramsCollection.Length;</p><p>    for (int iParamIndex = 0; iParamIndex < nParams; iParamIndex++)</p><p>    {</p><p>        if (report.DataDefinition.ParameterFields[iParamIndex].IsLinked())</p><p>            continue;</p><p>        report.SetParameterValue(iParamIndex, paramsCollection[iParamIndex]);</p><p>    }</p><p>}</p><p> </p><p> </p>

  • How to Create a Linked Subreport in Crystal Report for Enterprise

    Hi All
    I am developing a monthly report grouped by cost centre, I want to create a second table for each cost centre showing year to date, underneath the monthly data for that cost centre.  My thoughts on how to achieve this is to create a linked subreport in the group footer of the cost centre grouping.  However every time I try to set this up the report crashes.  Am I doing something wrong, can this be done in crystal reports for enterprise?  Can anyone give me a pointer on how to set up a linked subreport so that it passes the particular cost centre the report is grouped upon into the subreport so it only shows data relevant to that cost centre?
    Any help will be appreciated as I am going in circles at the moment.
    Thanks
    Neil
    Edited by: SmiddyLad on Feb 6, 2012 2:49 AM

    Hi Neil,
    You are doing right. You can create linked subreport in crystal report for enterprise.  Please refer below link to see the elearning tutorial  in which a simiar scenario is explained step by step. Here its an unlinked subreport. Enable subreport filter to make it linked and try. It should work.
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/200c56fc-5a02-2e10-36a1-ba3d28e31fc2]
    Hope it helps you.
    Regards,
    Nikhil Joy

  • What exactly means Linked Subreport?

    <p>What exactly means Linked Subreport?</p><p>When i create a primary report with fields customer id & Country and subreport with Customer id & Lastyear&#39;sSales and try to link the subreport by selecting Customer id the subreport shows only the data for last record from primary report.</p><p>Not clear about the linking subreports...</p><p>Linking should show all the fields matching for Customer id or only the last record?</p><p>Need an detailed explanation as is it is not clear... </p><p>&#160;</p>

    Firstly,
    Is it on Demand-Subreport?... If not where are you placing the subreport if it is in Report Footer it will show only last record for data from primary report.
    Place the Subreport in Details Section and you will see the corresponding records for the Customer ID but before that you have to link it on Customer ID.
    Thanks
    Rahul

  • Link subreport to the main report in Crystal

    Hi expert,
    I have a Crystal Report with a row that cointais a Total Field.
    Is possible to add a hypertext link, that open a subreport with all the details?
    Exaple: CardCode: C00001 Account Balance: 14120,50. If i click on the Total of account balance, i open a subreport (linked with the key). Is the same of drill down (perhaps), but I can't use drill down.
    Anybody can help me??
    Regards
    Marco

    Marco,
    try the following:
    make the report into the structure of:
    Group: CardCode
    In the group header delete your group name field, and add your subreport.
    Right click on the subreport, and on format subreport.
    On the subreport tab, there is an option: on demand subreport. Check that in.
    After that you can define a formula ( for example your cardcode ) at On-demand Supreport Caption.
    Hope this helps.
    Regards,
    D

  • Linking Subreports based on group in the main report

    Hello,
    I have a main report that groups by department, month, and then employee name.  I put a subreport in at the month and name level (it brings back statistics for a particular employee for the chosen month).  The subreport is based on a completely different set of data.  I want the subreport to pull just the data for the individual month and employee into that employees monthly section.  How do I link the subreport?  It seems like it should be pretty straightforward, but I can't get it to work.  Do I need to set up groups in the subreport?  I am a beginner and appreciate your help.
    Thanks,
    Al

    How I would do it is as follows
    Create a Formula Field and choose the group name e.g.
    GroupName ({migsol_oppact.COMPANY})
    Then link the sub report using that Formula Field

  • Troubles with linking subreport with an SAP Query variable

    Hi there
    I have a main report mith a subreport placed in the detail section.
    Both reports base on an Bex Query and have Query-variables. While linking the subreport i can not select the parameter which is based on the Bex variable in the subreport.
    While connecting other parameters /variables i learned, that Crystal cannot determine the type of data of a Bex variable, right?
    Because of that i built formulas which convert my values into strings and these strings can i connect in the subreport linking.
    Unforntunately this does not work with this on variable. In Bex this is a Number. I tried to link with the corresponding field in the Detail section (which is a number, too) and i tried with the string, but both does not work. I can not select this Parameter.
    Any idea how to determine the datatype of this Parameter (based on Bex Variable) i have to provide?
    Thanks in advance
    Alex

    Hi Ingo
    Well, i knew that thing with the same types already, as i mentioned it in my post.
    In this problematic case I want to connect a field of the detail row to a prameter in the subreport. This Parameter is coming from a Bex Variable. I treid with values of oll types - it doesn't work. How can i determine the type that Crystal assignes to the Be variable?
    Alex

  • Linking subreport and primary report

    Post Author: ScottBarnard
    CA Forum: General
    I'm having trouble linking a field from a primary report to the same field in the subreport.I've followed all the steps outlined in the help section. When I preview the report I get a parameter prompt for the linked fields.  Should this happen?I've posted the report here http://www.box.net/shared/yu59bgeu8k The file is entitled "SPD1541...rpt"

    Post Author: halecakalli
    CA Forum: General
    you need to write the fields to the record selection of the SUBREPORT.
    basically assign the parameter that is coming from the main report to the field on the subreport.
    e.g  ={?mainreportfield}
    then it wont ask for any parameters for your subreport.

  • How can I access/identify the linked subreport parameter fields?

    In my report, I have subreports, which have linked SQL parameters.  How can I identify these linked parameters, and what they are linked to in code?
    Thanks.

    reportClientDoc.SubreportController.GetSubreportLinks("<subreport name>").GetSubreportLinks()<i>.MainReportFieldName and
    reportClientDoc.SubreportController.GetSubreportLinks("<subreport name>").GetSubreportLinks()<i>.SubreportFieldName
    Where i is the ith linked parameter and is indexed from 1.
    Hope this helps.
    Thanks
    Aasavari
    Edited by: Aasavari Bhave on Feb 15, 2011 11:05 AM

  • Linking SubReport Issue

    I have a field in the main report that I want to use to link to a subreport and only display the informaton that meets that fields value. I have the subreport set up and when I go to create the link it can link with either the ?PM-MISC.RUNNUMBER or Select data or subreport based on field. When I just use the first I get all the data (many different run numbers, not just the matched number form the main report.) When I check the second one I get nothing. .
    Any ideas?
    Jim

    Hi..
    Where you are inserting this sub report ?  Try to create a group on the field which you are linking to sub report.  Place sub report on group footer.
    Link sub report with ?P M to sub report field.
    Thanks,
    Sastry

  • Trouble linking subreport

    Post Author: ebry74
    CA Forum: Formula
    Hi,
    I am using BO XI with SQL 2000.
    I am identifying a list of patients on my main report, then using a subreport to pull address based on the medical record numbers on the main report.  I have linked my sub report via the medical record number.  My main report pulls all the medical record numbers that I would expect, but my sub report only pulls the address that coincides with the very last medical record number in the main report, when I need the address for each medical record number.
    Here is what the subreport link looks like:
    {dly_acct_fct_v.med_rec_no} = {?Pm-dly_acct_fct_v.med_rec_no}
    I also tried to edit it with the following:
    {dly_acct_fct_v.med_rec_no} in {?Pm-dly_acct_fct_v.med_rec_no}
    and
    {dly_acct_fct_v.med_rec_no} in split ({?Pm-dly_acct_fct_v.med_rec_no}, ",",-1,1)
    I get the same results no matter what I try.  Any suggestions on how I can get an address for every medical record number in my main report on my subreport?
    Thanks,
    - Bryan

    Post Author: ebry74
    CA Forum: Formula
    Thanks for the response.  Trust me, I would certainly prefer simple.
    Can you explain how I can write a sql statement in Crystal?  I could certainly do this report simply enough by creating a view, then writing my report against it, but unfortunately, that would take a couple of weeks to complete since we have a very structured change control process that I would then need to go through.  I know, it's a view, but I don't make the rules, I just work here.
    Is there something I am overlooking. Being able to some sql in crystal to create a data set would really make my life easier.  Have a misunderstood you?

  • How to pass relative dates (Yesterday, Last week) via Command Parameters in a linked subreport

    I have been struggling with this one and would sure appreciate your help
    I have a report that runs fine but takes to long when running, to optimise it have setup it up as a subreport , created a main report which I linked to it via a relative field ({?ServiceID}) field, this has reduced the report time but I would like to go even further by user selecting date e.g startdate, enddate or relative field eg ‘yesterday’, ‘Last Week’
    I can do the selectable start and end date fine but I’m failing to make use of the ‘Yesterday’,’ last week’ within the command parameters, below is an example of the code I have on the reports select expert but I want a semiliar filtering on the command parameter to avoid the filtering taking place on crystal but straight from the DB.
    IF  {?Relative Date}= "Yesterday" THEN currentdate-1
    ELSE IF {?Relative Date}="Last Week" THEN LastFullWeek

    Good Day Guys,
    Apologies for the late response, I have been looking and trying the different suggestion you pointed out, unfortunately without any success
    Stored Proc
    Nrupal, I tried setting one up but I’m getting a error I cannot seem to get past, below is my condition, any help would be appreciated
    where cd1.Service_ID = @Service_ID
    and cd1.CallStartDt in (
      Case @RelativeDate
      When 'Today' then CONVERT (date, getdate())
      When 'Yesterday' Then DATEADD(DAY,-1,CONVERT (date, getdate()))
      When ‘Last Week’ then between @LastWeekStart and @LastWeekEnd       //sytntax before between, also tried using ‘IN’, same result
      When ‘Last Month’ then between @LastMonthStart and @LastMonthEnd 
    else between @CallStart and @CallEnd
    END )
    End
    Crystal command parameter code
    where cd1.Service_ID in ({?Service_ID}) and
    convert(datetime,cd1.CallStartdt) in (
    Case {?RelativeDate}
    When 'Yesterday' Then GetDate()-1
    else  {?CallStart}
    END)
    Abhilash,
    I have tried both your proposed command parameters but still fail
    I’m getting an invalid column name ‘Yesterday’ error , I’m not sure if Crytsal takes this type of command formatting using the command parameters, would appreciate your help as I would like to stay clear of the SP, unless it’s the only altanative
    Dell
    I will start working in your re
    Thanks Again

  • Optional Parameters in a linked SubReport

    Hi All,
    I'm trying to get something to work, but can't figure out how to do it ! I think that possibly optional parameters will do the trick.
    I have a report that is based on a SQL Server stored procedure takes about 20 parameters and is used as a sub report to display header information on what was selected for the report that it is linked to.
    For example, there is a "Supplier Report" that takes SupplierID, CategoryID and Sub CategoryID. These parameters are linked to parameters in the stored procedure in the header sub-report which then goes off to the database to get the descriptions for those IDs and displays them. This is standard across all reports. Now, other reports may not use the Category ID and Sub CategoryID, so in those reports, a value of -1 is passed to the header sub-report and in the logic for the header sub report, those sections are hidden.
    At the moment, to set the values as -1, I just have a formula in the main report called DummyXXXID which returns -1. For example if CategoryID and SubCategoryID were not used I would have DummyCategoryID and DummySubCategoryID. This works fine.
    However, as more reports are created, the header sub-report gets more parameters to display the descriptions of, which means I have to go  back and add 'dummy' formulas to all the other reports that use the header sub-report. e.g. If I have a new report that takes 'WidgetID' as a parameter, the underlying stored procedure for the header report gets @WidgetID as a new parameter and returns a new column of Widget Information to be displayed in the header. I then have to add a DummyWidgetID set to -1 to all reports that don't use the WidgetID parameter so that the header of those reports doesn't try and show Widget information.
    What I'd like to do is have the sub report default to -1 (or other values as appropriate to indicate no value) for all parameters in it. In that way, if I add a new parameters to the header sub-report, existing reports will not have to be changed and sub-report links refreshed, since the new parameters in the sub report will have default values.
    Is this possible ?? I can't seem to set the parameters in the sub-report to "optional prompt"= true, as they are all fixed at false and there is no drop down to change them.
    I hope that makes sense !

    Moving to the Design Forum, not an DB question.

  • Crystal report Subreport linking error

    Hi, I have a issue with linking subreport to main report in crystal report. I created a main report with BEx query as source and this query had fiscal year/period as variable. I have a another subreport with different BEx query and this query also had fiscal year/period variable.
    I linked main report fiscal year/period parameter to subreport fiscal year/period parameter.I can run the report and see the data, however In the parameter selection screen I have two prompts with fiscal year/paeriod variable. How can I make this report to prompt fiscal year/period once?
    I treid to link main report field and subreport parameter, in this case it is prompting only once but I am getting below error.
    [Mon May 23 11:30:08 2011]     5120     5628     ERROR: .\crdb_bwmdx_execution.cpp [478]: l_bapiSelectData failed with return code RFC_RC = 0 Exception:  BAPI Error: BAPI Error #:0
    For characteristic 0FISCYEAR, enter value in a permitted format
    [Mon May 23 11:30:08 2011]     5120     5628     Caught DbError #1 with Message 'BAPI Error #:0
    For characteristic 0FISCYEAR, enter value in a permitted format'
    [Mon May 23 11:30:08 2011]     5120     5628     Caught DbError #1 with Message 'BAPI Error #:0
    For characteristic 0FISCYEAR, enter value in a permitted format'
    Please advice.
    Thanks
    Sasi

    Hi Sasi
    i had the same issue with main report - subreport linking over Bex Variables. So far i realised a workaround by
    giving the value to the subreport variable in the obviously requested format.
    I had to provide the value with leading zeros (internal Numc format).
    In my case I had a compounded value. By running the rep from CR local I have to give the value as usual like "ED/20080" but when running on infoview the subrep variable demands this format "ED0000020080".
    Veeeeery special, but it works.
    Obviously, when running this thing on infoview the variable in the subrep demands the internal fomat.
    But me to, I'm very interested in an explanation of this behavior and by when it's solved. We have BOE XI 3.1 Sp 3 FB 3.
    Ingo, can you help?
    regards alex

  • How to use object collection with linked objects

    <p>Hi,</p><p>I&#39;m using VS2005 Crystal reports in a c# client app (server has database, but client does not have!). So the use of the objects transfered to the client seemed to me a good solution for showing reports on the client. The objects mostly link to several other objects (properties of type <type> or properties of type [] <type>) and the links are correctly configured in database assistant.</p><p>But: Whenever using one of the linked fields, all of the main fields will never show up in the report.</p><p>So, what is the correct way of showing a master / detail report using linked object collections???</p><p> (A small test sample app can be provided upon request)</p><p> TIA</p><p>BP</p>

    What database and connection type are you using? Are you connecting the report directly to the database, or trying to assign the datasource to object data?
    It sounds like you might be trying to use a linked list, collection or other C# construct to pass your data in. This currently isn't supported by the Crystal Reports SDK. You can use a DataSet or a DataTable, and possibly also an IDataReader depending on which version of Crystal Reports you're referencing in your project. Of course you can also connect directly to the database, even if the database isn't on the same machine as the application.
    The way to show master records with detail information is through the use of subreports and linked subreport parameters. Linked subreports take their parameter value from a record in the main report, so that only the data appropriate to that master record is displayed. The guys over in the [report design|SAP Crystal Reports; forum can help you out with this if you have questions on the specifics.

  • Issues once subreport is added to main report.

    Another question from a new Crystal Reports Developer. I have been battling this one for multiple days. I have built two seperate reports through Crystal Reports that pull their data through an ODBC connection from Remedy ITSM. One report is pulling data through the table AST_AssetPeople. It is pulling the following fields: Asset_ID and Full_Name. The other report is pulling data from the AST_ComputerSystem table showing the following: Name, Category, Type, Item, Model_Number, Serial_Number. I am using the AssetPeople report as the main and the ComputerSystem report as the subreport. When I pull the ComputerSystems report into the AssetPeople report as a subreport, my CR lags very badly. I let CR attempt to pull the data for about 2 hours before I left work the other day and ended up having to leave it overnight. When I came back to work the following day it had finally completed and I was able to view all pages of data. This is with the subreport being added to the details section of my main report. I had sent it to someone else at work that has Crystal Reports on their PC and they were able to run it just fine and it only took a few minutes to get all pages of the data back and viewable. That lead me to think that it was my PC, but when I went over to the other persons PC and logged in with my profile, I had the same problem that I had on my PC. This leads me to believe that it is an issue with the settings. The other person is out for the next week so I cannot verify that my settings match his, so I was wondering if anyone on here might have an idea what may be causing the issues that I am having. Both reports run just fine on their own, as do all my other reports that are simple reports from one table. It is just when I try to pull in a subreport that I have this issue. Any help would be greatly appreciated.

    I have gone in and checked the box next to Perform Grouping on Server. The check box next to Use Index or Servers for Speed was already checked. The Links for the subreport are set up as follows.
    For subreport: Supported vs. Unsupported (This one comes from the ComputerSystem table)
    Container Report fields to link to: AST_AssetPeople.Asset_ID
    AS_AssetPeople.Asset_ID field link-
    Subreport parameter field to use: ?Pm-AST_AssetPeople.Asset_ID_
    Select data in subreport based on field: AST_ComputerSystem.Asset_ID_
    Asset ID is the only field that I found that the two tables have in common. I believe that I have the links set up correctly, but I could be wrong.
    Either way, I am still having the same problems.

Maybe you are looking for

  • Workspace Credential Conflict between Logged-in User and the Authenticated User

    Hi there, I am running LiveCycle ES Update1 SP2 with Process Management component on WIN/JBoss/SQL Server 2005. I have been encountering user credential conflicts from time to time, but it has not been consistent and the problem manifested in various

  • SXPG_COMMAND_EXECUTE

    Hi Experts, Can you explain me the fuctionality below code... DATA: l_target_syst     LIKE rfcdisplay-rfchost.   DATA: i_error LIKE btcxpm  OCCURS 0 WITH HEADER LINE.   CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'SAPDBHOST'                      ID 'VALUE' F

  • JTable width resize

    Hello, I insert a JTable without header in a JTextPane. I'm able to resize the width of the columns with the mouse, but the JTable isn't resized. I call the method JTable.setWidth(int width); to set the start width. Do anyone knows a solution ? Thank

  • Issues upgrading from 7.5.1 to 10gR3

    We are having issues upgrading from Content Server 7.5.1 to 10gR3 running a Sql Server 2005 back end (based on Windows Server 2003). We run through the upgrade process (which completes with warnings), but when we try to start the Content Server, we g

  • Query in javascript

    Hi All, Im new to javascript and there is a requirement to do a date validation. I need to validate the date entered in a textbox which is in a format DDMMYYYY. please can you provide me the javascript code for this? thanks, mehul j