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.

Similar Messages

  • 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

  • Subreports and passing multiple value param

    I have a main report that has 3 subreports.  It used to take a parameter, which was in each subreport and main report sql command to bring back records pertinent to that param.
    Now report needs to be able to take a multi-value param.  I took it out of sql commands and have record selection handle it in CR directly.  Problem is data is displayed like this
    Params : p1, p2
    for p1 //main (grouping on param here)
      rec1 rec2 // Sub a - displays all records for both param
      rec1 rec2 // Sub b - same
    for p2 // main
      rec1 rec2 // Sub a - same
      rec1 rec2 // Sub b - same
    what I need is
    for p1 //main
      rec1 // Sub a
      rec1 // Sub b
    for p2 // main
      rec2 // Sub a
      rec2 // Sub b
    I am linking main report to subreports on that param field, but subs display the whole nine yards, ie for all given params instead of "current" param.  What to do?

    Please note that this forum is dedicated to all other development-related questions which are not directly addressed by other forums. This includes Business Objects SDKs, products, or technologies which do not fall under BusinessObjects Enterprise, BusinessObjects Edge, Crystal Reports Server, or Crystal Reports (for example Desktop Intelligence SDK, Universe Designer SDK, Portal Integration Kits, Java User Function Libraries, and other third party technologies or development languages).
    Your query appears to be related to development of reports in the Crystal Reports Designer. Please post the query to the Crystal Reports Design forum at this link:
    SAP Crystal Reports
    Thank you for your understanding,
    Ludek

  • Crystal report -Subreports and BW key date

    Hope your in good spirits,  we had to install the SP 7 on bw for our webi reports to work, i have an issues here with Crystal reports
    I need to develope a crystal report with two BEx Queries as Data Sources, I suggested to use Subreports, where the promts of the reports can be linked, but i have a Keydates in these two Bex Queries which are poping up as two parameters when i run the report is there any way that you can link those to key dates,where the user can enter for one key date Parameter and the value is passed to the Sub report Key date  parameter, please help me

    >
    raj_4234 wrote:
    > Hope your in good spirits,  we had to install the SP 7 on bw for our webi reports to work, i have an issues here with Crystal reports
    >
    > I need to develope a crystal report with two BEx Queries as Data Sources, I suggested to use Subreports, where the promts of the reports can be linked, but i have a Keydates in these two Bex Queries which are poping up as two parameters when i run the report is there any way that you can link those to key dates,where the user can enter for one key date Parameter and the value is passed to the Sub report Key date  parameter, please help me
    did you manage get the solution, i also want to know how to share date parameter from subreport to main report?

  • Adding a Subreport to existing report and getting this error, "Unable to connect: incorrect log on parameters"

    I have taken on an existing vb.net project done in Visual Studio 2008 with crystal reports version Crystal Report XI.
    The reports on their own work very well. Problem is I need to add information to my report which is a 'many-to-one' situation where for each Project Id that I am displaying I need to display several attached documents and the report I am working on is for several Project Id's.
    I figured this would be a perfect situation for a SubReport. I created a separate report which calls a stored procedure to get all of the Attached Documents for a specific Project Id. I thought if I were to add this new SubReport to the Original Report and link the Project Id's, easy-peazy, I would be done.
    This is not the case. I have vb code that loads the Original Report with a stored procedure and when this code runs with the setup I described above it fails when it is creating the final report with the following error:
    Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\~\ProjectDescriptionReport {6BA19F79-2A12-4826-B1F6-456EF799963B}.rpt: Unable to connect: incorrect log on parameters.
    I have no specific connections in my vb code for the reports. If I do not add the subreport to the main report, it loads correctly, so I know the error is caused by the subreport.
    This is the code that creates the original report (sorry for dumping the code here, i just thought it would be easier to see all the code) :
    Public Function LoadReport(ByVal inProjectNum As Integer, ByVal strProjectName As String) As DataTable ', ByVal inFiscalYear As Integer, ByVal inCompany As String) As DataTable
            Dim cnn As SqlConnection = Nothing
            Dim cmd As Data.SqlClient.SqlCommand
            Dim obj As New clsDataClass
            Dim dataAdapter As SqlClient.SqlDataAdapter
            Try
                LoadReport = New DataTable("DescriptionReport")
                cmd = New SqlCommand()      
                cnn = obj.Create_Connection()
                With cmd
                    .CommandType = Data.CommandType.StoredProcedure
                    .Connection = cnn
                    .CommandTimeout = "60"
                    .CommandText = "usp_GetProjectGroupSpecsCR"              
                    .Parameters.AddWithValue("@ProjectNumber", inProjectNum)
                    .Parameters.AddWithValue("@ProjectName", strProjectName)
                End With
                dataAdapter = New System.Data.SqlClient.SqlDataAdapter
                dataAdapter.SelectCommand = cmd
                dataAdapter.Fill(LoadReport)
                Dim oRpt As New ReportDocument()
                oRpt.Load(Server.MapPath("ProjectDescriptionReport.rpt"))
                oRpt.Refresh()
                oRpt.SetDataSource(LoadReport)
                'oRpt.OpenSubreport("AttachmentsReport").SetDataSource(LAR)
                oRpt.SetParameterValue("inProjectNum", inProjectNum)
                oRpt.SetParameterValue("strProjectName", strProjectName)
                oRpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, "Projects_DescriptionReport") 'inCompany & "ProjectsReport_Description" & inFiscalYear) <-- Line where the error occures.
    What I need to know is what is the proper way to add a subreport to a vb.net application?
    From the ways I have tried it is clearly not working and I am out of ideas. I am fairly new to Crystal Reports and this way of coding it.
    Any help for this would be greatly appreciated, I've been stuck on this for a while and am finally reaching out to the Crystal Report Specialists.
    Thank you in advance,
    Bryan

    Hi Bryan,
    You may want to check the Connection properties also. I think the MS Data.SqlClient.SqlCommand is using the MDAC driver, or could be modified.
    If you are connecting to SQL Server 2008 or above you should be using the SQL Native 10 or 11 Client.
    As Dell suggests have a look at the samples and if you can use a DSN ( 32 bit or 64 bit ODBC Admin )
    Also search for "CRlogger", you'll find how to enable CR's database logging component and may help show you what part is failing.
    Don

  • 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

  • Help with Primary/Subreport and Shared Variables

    I've been trying in vain to get this to work.
    Main Rpt:
    In GH1 I've got shipping address information.
    In GH2 I've got a linked subreport where I have shipping addendum information.
    Goal...I want to get two fields from subreport to show up in shiping information showing in GH1 on main report.
    Sub Rpt:
    Addendum information is in GH1
    Here is my formula field from the subreport GH1 section:
    Whileprintingrecords;
    Shared  StringVar OpCoSD;
    OpCoSD := {tmp_confirm_delivery_vw.operating_company_sd};
    Main report:
    Here is my formula from the Main rpt GH1 section:
    Whileprintingrecords;
    Shared  StringVar OpCoSD;
    OpCoSD;
    Nothing shows up in the main report....data showing fine in Subreport.
    I've read other posts that seem to say for this to work I have to duplicate my subreport and place it "above" the main report GH1, white it out and shrink it so it won't display, because it must process first before the main report GH1 section.
    Many thanks.

    Carl,
    Yep...after reading more about it on various sources...that's what I tried and it work just as you described.
    Thanks so much for your excellent support on this forum.
    Regards,
    Paul

  • Linked Button error in a subReport with Crystal Reports

    Hi expert,
    I have a designed a subreport with Crystal Report, and I have add the Sap Linked button (OLE Object), to allow the user to click on the linked button and open the relativa Sap Document (Invoice, Delivery, etc etc).
    In the hypetetx linked property, I have write the link
    'http://$b1$/link=OINV&key=1'
    In this way all is ok, but In my query I have the name of the table and the DocEntry, so I try this way:
    'http://$b1$/link='&{Comando.Table}&'&key='&{Comando.DocEntry}
    If I try to open the document, I retrieve the error: You are not permitted to perform this action. Authorisation Path: Help.
    I don't understand if the problem is the authorization (i am manager, superuser) or if I had write in a wrong mode the hypertext link. (maybe the Apex?)
    Anybody can help me?
    Regards
    Marco

    Hi Marco,
    if {Comando.DocEntry} field is string type try this code:
    'http://$b1$/link?table='& {Comando.Table} &'&key='& ToText(ToNumber({Comando.DocEntry}),0,'','')
    else if DocEntry field is number type try this code:
    'http://$b1$/link?table='& {Comando.Table} &'&key='& ToText({Comando.DocEntry},0,'','')
    Regards,
    Domenico
    Edited by: Domenico Lovino on Feb 23, 2012 10:04 AM

  • Crystal report(Can i link sub report and main report Compulsorily) - invalid path

    hi.
    i need small clarification.
    i am developing one Crystal report
    main report i took it from rdr1 one table...
    report is working fine..
    Sub report i took it from inv1 one table.
    i have not linked any fields from these tables.
    May be it is having links in b1..
    but in my other report both the tables.... from main report  and sub report does not have any relation.
    My Questions is..
    Can i Compulsorily link fields to main report...
    if both does not have any relation what should i do...
    i took two tables.
    main report rdr1
    sub report inv1...
    if i  run the report it is asking two parameters one is for sub report and other one for main report working find in crystal report.
    but...i want to run the report in b1.
    while importing i am getting the error (Plz have a look on below image)
    if i choose any other report it is importing  fine...
    Clearly i am mentioning i dont want to link both tables there is no links between two reports...
    in this scenario can develop  a report..
    I need your Valuable suggestions.
    here below u can find my developed sample report...
    http://www.megafileupload.com/en/file/544758/NewReport-rpt.html

    hi.
    If i try only i am getting the error..
    out side if i run i am able to run the crystal report but
    in b1 i am not able to import the report.
    you can also try my report
    from below link u can get my simple report.
    if u find any mistake what i have done plz inform me..
    http://megafileupload.com/en/file/544806/NewReport85-rpt.html

  • Shared DateVar in Subreport and datediff calculation in Main Report?

    Hello experts,
    I am using CRXI sp2.  I have a report that contains two subreports for different dates in the same date field that are identified by a Service Code.  The subreports have been placed in the same group footer 1a to be displayed and the calculation resides in the main report group footer 1b.  The shared variables are as follows:
    whileprintingrecords;
    shared datevar Codedate5473;
    Codedate5473:={@Codedate5473};
    and
    whileprintingrecords;
    shared Datevar Codedate5623;
    Codedate5623:={@Codedate5623}
    The main report has the following calculation is in group footer 1a.
    Whileprintingrecords;
    Shared numbervar daysbetween;
    if (isnull({@Shared 5623})or isnull({@Shared 5473})) then 0
    else daysbetween:= datediff("d",{@Shared 5623},{@Shared 5473})
    This returns negative numbers as well as calculations where one of the shared variables is null.
    I reset the calculation in the report header as well.
    Thanks for your help in advance.
    Kevin

    Hi Kevin,
    I can reproduce your issue, As per my knowledge the crystal will make some issues in null value computation as well as  shared variable  computation
    In your report i can see , you tried to access values from subreport to main report through shared variable. that will make problem. we can access values from main report to subreport without any issue using shared..dont ask me the reason..i am not the right person to say that... lol.
    The another wrong thing  i was found in your formula is , you are not resetting the shared variable any where.. so once the date field is null, the shared variable returning the previous value.
    So this is the solution for you..
    1,You have to add one more subreport for displaying your result., Lets say 'Sub report3'
    and create a formula, like.(Same which you have write before for the result)
    shared datevar Codedate5473;
    shared Datevar Codedate5623;
    numbervar daysbetween;
    WhilePrintingRecords;
    daysbetween:= datediff("d",Codedate5473,Codedate5623);
    daysbetween;
    2, Re- write your first two formulas like this
    For Subreport1,
    WhilePrintingRecords;
    shared dateVar Codedate5473;
    if isnull({Codedate5473}) then
    Codedate5473:=date(0,0,0)
    else
    Codedate5473:=date({Codedate5473});
    For subreport2
    WhilePrintingRecords;
    shared dateVar Codedate5623;
    if isnull({Codedate5623}) then
    Codedate5623:=date(0,0,0)
    else
    Codedate5623:=date({Codedate5623});
    Hope this will works for you,
    Cheers,
    Salah.
    Edited by: salahudheen muhammed on Aug 7, 2009 1:05 PM

  • Linking to an OBIEE report without showing the user and password

    Hi!
    we are trying to access to an obiee report from an external portal (coded with php).
    The idea is that the user clicks on a link an gets the report in pdf format. For that purpose we are using this url:
    http://ttivobiee01:7001/analytics/saw.dll?Go&Path=/shared/Prueba/ogp_obi&Action=Print&P0=1&P1=eq&P2="Criteria"."Key"&P3=1402&NQuser=user&NQPassword=pass&format=pdf
    But this url is expossing OBIEE's user and password.
    In order to avoid this security issue we tried to do an wget of the url but it doesn't return the report. Instead we get an html, which seams to download the report chunk by chunk (using javaScript).
    The question is, is there any way that we could let our portal ussers access to an obbie report without expossing the user and password?
    I have been looking into oracle forums and have found this: OBIEE Go URL with password protected
    but we couldn't use this aproach due to security issues.
    Thanks!
    Nuria

    Hi!
    We have finally done this (and it works!)
    <?php
    $urlInforme='http://obi:7001/analytics/saw.dll?Go&Path=/shared/Prueba/ogp_obi&Action=Print&P0=1&P1=eq&P2="Criterios"."Clave oficial"&P3=1402&NQuser=user&NQPassword=pass&format=pdf';
    $ch = curl_init($urlInforme);
    $ckfile = tempnam ("./", "CURLCOOKIE");
    $ch = curl_init ($urlInforme);
    curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
    $output = curl_exec ($ch);
    $ch = curl_init ($urlInforme);
    curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
    $fp = fopen("salida.pdf", "w");
    curl_setopt($ch, CURLOPT_FILE, $fp);
    $output = curl_exec ($ch);
    curl_close($ch);
    fclose($fp);

  • Inserting a link to BI Publisher report and passing the dashboard prompts

    I have an answers dashboard where there are various prompts (say P1, P2, P3, P4  -all these are date prompts )and various  reports.
    These Prompts are stored as Presentation variable say var1, var2, var3, var4.
    I need to insert a Link on this page to a BI Publisher Report.  BI Publisher report also has some prompts say D1, D2, D3 , D4, D5, D6
    The link should take the values from the prompts of this page and open the BI Publisher report with D1= value of Prompt P1,
    D2= value of prompt P2, D3= value of Prompt P3, and D4= value of Prompt P4.
    I was easily able to use an action link -> "Navigate to Web Page" option.  I gave the URL for this BI Publisher report and clicking on that link takes me to the report.
    But I am still figuring out out to send the values of the prompts.
    The BI Publisher Report is :
    - built from an RTF template.
    - uses a SQL Query with Bind variables to get the value of its prompts D1, D2, D3, D4, D5, D6.
    - Suppose D1 is bind variable :date1, D2 is bind variable :date2, D3 is bind variable :date3 and D4 is bind variable :dat4.
    So my first try was to append the value of bind variable to the URL
    https://xxname.server.com/analytics/saw.dll?bipublisherEntry&Action=open&itemType=.xdo&bipPath=%2FSurvey%2FPhoneCount%20Record.xdo&path=%2Fshared%2FSurvey%2FPhoneCount%20Record.xdo.xdo&date1=var1
    Can someone suggest the steps I need to take to make this work.
    Thanks

    Hi, I am facing the same issue (OBIEE 11g version0
    Please let me know if you found any solution or workaround for this?
    Thanks!!

  • Deleting websheet Primary and Alternative reports

    hi,
    I saved the primary report and it actually created another primary report, i am actually up to having 3 primary reports. for example when I want to add a new section to a page that includes a chart, it ask what data grid and report to base it off of, when i select the report it list 3 "primary Reports". all 3 are slightly different. how do I delete 2 of them? the checkbox for deleting them does not appear when I go admin -->manage services -->interactive report settings --> saved reports --> web application reports . it is intended behavior to be able to have multiple primary reports .
    next, i created an alternative report, deleted by using the steps above....but the report still shows as am option on the data grid page, the select list for reports still includes the alternative report even though I deleted. this is a real problem as the alternative report is wrong and end users keep using it.
    Thanks,
    --Kevin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    OK I think I figured it out. Clearing out the user preference (in the post-login block in the authentication scheme) seems to make it pick the Primary report (APXWS_DEFAULT) every time a new session is created.
    Not sure I understand the syntax behind the various values I see in the preference so I didn't mess with setting the value but clearing it out seems to work fine.
    DECLARE
        l_ir_pref VARCHAR2(500);
    BEGIN
        -- Clear preference so that IR defaults to Primary Report
        select 'FSP_IR_'||application_id||'_P'||page_id||'_W'||interactive_report_id
        INTO l_ir_pref
        from  apex_application_page_ir
        where 1=1
        and application_id = nv('APP_ID')
        AND page_id = 10 -- Change as needed
        AND ROWNUM = 1;
        apex_util.remove_preference(l_ir_pref);
    END;Is any of this documented?

  • Linking the Employees and Departments Reports - 2Day+ tutorial

    Hi Guys,
    I am APEX newbie and started off with the 2DAYPLUS tutorial. Got stuck in the "Linking the Employees and Departments Reports" part.
    I followed the instructions (even did it twice) where you you create a select list of department which will populate your employee table according to the Department you select.
    Can't seem to make it work. So when I select Accounting or anything form the drop down list, the Employee table remains unchanged. Anyone else had similar issue? Not sure if its me or there is a step or two missing in the tutorial.
    Section in TUTORIAL: http://www.sloug.org/i/doc/TDPAX/td_bldemprpts.htm#BCECEDHD

    :::SOLVED:::
    For search engines:
    I missed the part:
    b.Select List Control Type - Select Select List with Submit and click Next.
    Well actually didn't miss it, there wasn't that option in my APEX installation (maybe tutorial is a bit outdated for earlier version of APEX).
    If you have already created the Item and it does not work then:
    1) Go to EDIT for that P3_DEPARTMENT_ID
    2) Scroll down to SETTING section
    3) In PAGE ACTION WHEN VALUES CHANGE choose SUBMIT.
    this achieves the same result as (b) above.

  • Linking form and report and passing parameters

    Is it possible to call a link with parameter from form to report? Let's say I have a form based on EMP table and when user clicks on DEPT_ID label I want to pass DEPT_ID as a parameter to a report showing detailed information about this department. All my attempts to do it were unsuccessful.
    I've seen many questions like this in this thread and most answers refer to Portal FAQ document but there is NO information there on linking form forms to reports and passing parameters between them.
    Any help will be greatly appreciated!
    Thanks.
    null

    This can be easily done. First open up two instances of your Portal. In one window, you will need to go into your component you wish to link FROM. In the other window you will need to go into your component you wish to link TO. In the component you wish to link TO there will be a moduleid. Note this somewhere. Then, you will see an area that says: "Call Interface: Show". Click on this. (In the window you are linking to.). In this window, you will see a bunch of stuff. At the bottom you will see a URL call. This is the call you need to use. At the top, it explains each piece of the URL call. Just subsitute YOUR appropriate information into the URL call. In the form you wish to link FROM, you will need to create a button. Just click on the green plus sign at the top of the screen (when in edit mode) and then declare it a button by using the Item Type drop down. Once you create this button, it will appear at the bottom, click on it and you will see an area to insert a Javascript. Click the onClick and insert:
    get_field_name = getField(this.form,'COLUMN_NAME_IN_DATABASE');
    window.open('/pls/cc_prod/DAD_NAME.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=MOD_ID_HERE&p_arg_names=_sessionid&p_arg_values=&p_arg_names=COLUMN_NAME_IN_DATABASE&p_arg values='+GETFIELD_NAME+'&p_arg_names=_COLUMN_NAME_IN_DATABASE_cond&p_arg_values=%3D');
    In the fourth tab, where it says, "....before displaying form" insert the following: (This will tell the form how to handle the getField function.)
    htp.p('<script language="JavaScript1.3">
    < !--
    function getField(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    for (var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName)
    return form.elements[i].value;
    //-->
    </script>');
    I hope this helps.
    null

Maybe you are looking for