Sort Main Report on variable passed from Subreport

Post Author: realw
CA Forum: Formula
I'm working on a CR XI report. I want to be able to sort the main report on a value in the subreport. I am trying to create a shared variable to pass that value from the subreport to the main report. So far, however, the formula containing the variable in the main report is not appearing as an option in the Sort dialogue box.
My first question is, can this be done?
If the answer is yes, then which sections in the subreport and main report should the formula appear in?
What I have at this point is:
In the last Details section of Subreport, formula @ssSubCreator
WhilePrintingRecords;Shared StringVar Cre;Cre:= {CreCreat_csv.SummaryData};
In the Report Header of the Main report, formula @ssCre
Shared StringVar Cre:="";
In the Details section of the Main report, following the section containing the Subreport, formula @ssCreator
Shared StringVar Cre;Cre
I can see that the data is passing correctly to the Main report. I've tried moving the formulas around to different sections in the sub and main reports but haven't gotten the formula to be sortable.
Thanks in advance for any assistance,
Will

Post Author: bettername
CA Forum: Formula
How about just grouping the data in the main report on the formula? (Supress group header and footer, obviously)
I don't have crystal to hand right now to check if that'll work though - you may run into problems with the 'cannot evaluate at this time' issue... but I use this technique for sorting data based on a chosen parameter (say: surname, forenames, age) in this way...

Similar Messages

  • Passing Parameter from Main report to SQL command-based subreport

    I am trying to cut down the run time of my reports and have recently figured out how to write SQL commands to limit the data by filtering prior to being pulled into the reports.  However, many of my reports rely on multiple sub reports, which can cause a dramatic 'drag' on the report.
    I am trying to filter the SQL command used in my sub report by passing the group parameter, which is selected by the user in the main report, to the sub report's SQL command.  Without this parameter, the sub report has to sort through a lot more data than it would with this parameter, making the run time extremely slow.
    Any suggestions on how I can accomplish this?
    Thanks for any help you can provide,
    Marlene Allen
    Crystal Reports Developer
    Crystal Reports Professional;
    Product Type: Full;
    Product Version 11.5

    Hi Marlene,
    I don't believe you can pass a CR parameter to a Command object.
    I suggest replacing all of the Command Objects with a Stored Procedure so all of the data filtering is done server side. DB servers are much more proficient at collecting the data and filtering than CR will ever be. It will also allow you to replace subreports to also speed up your report processing. All depends on your layout of course but something to look at.
    Thank you
    Don

  • Not having to refresh the data in the main report but only in the subreport

    Hi SAP,
    I have a report that uses a stored procedure in the main report and uses regular database tables in the subreport.  The data returned from the stored procedure reports information from the month-end database (a cutoff point from the previous month's numbers) while the subreport reports information from the live database.  This report gets run everyday to show the changes in numbers from the live database.  Obviously the numbers from the month-end database remainds static until the next month's cutoff database is created. 
    My problem is that everyday when I run the report, the data needs to refresh from both the stored procedure in the main report and the live database tables in the subreport.  How can I leave the data returned from the stored procedure static or as is without refreshing the stored procedure returned data and just have the subreport data refresh itself?  The stored procedure really puts a strain on the database and I would like to cut-out the time to process the report as well.  Does anyone have any ideas?
    Zack

    Hi Zack,
    Try the following under Report options.
    1. Clear the check box of "Verify Stored Procedures on First Refresh" in the Main report.
    2. Select the check box of "Verify on First Refresh" in  the sub report.
    Hope this helps.

  • How to stop to display the main report page header in the subreport!

    Hello all,
    I have an existed report that display the CR page header on every page of the report. Now I added another subreport into report footer without using link. How do I stop to display the main report page header and display the subreport in the new page with subreport header only? I really appreciate your time to help me out on this issue. Thanks.

    Hi,
    I tried to supress the page header with (onlastrecord and TotalpageCount > 1) condition, but the last page of main report without page header. I still like the page header display on last record, but not on the subreport only. How do I get it? Thanks in advance.

  • Variable passing from sqlplus to linux.

    I have a procedure like (datapump_hr_api), after its completion, I have to grant some grants to user and then create a view which will depend on the datapump_hr_api parameter (TARGET_FIN_HR ). it will generally pass the two username, admin,hr_fin, now I have to connect to Admin and give the grant and then connec to hr and create the views.
    *****datapump_hr_api*****
    create or replace procedure datapump_hr_api(TARGET_FIN_HR_NAME varchar2) is
    h5 NUMBER; -- Data Pump job handle
    job_state VARCHAR2(30); -- To keep track of job state
    sts ku$_Status; -- The status object returned by get_status
    target_admin varchar2
    TARGET_FIN_HR varchar2(32) := TARGET_FIN_HR_NAME;
    SOURCE_FIN_HR varchar2(32);
    dumpfile varchar2(32);
    logfile varchar2(32);
    job_name varchar2(32);
    BEGIN
         select dumpfile,SOURCE_FIN_HR into dumpfile,SOURCE_FIN_HR from source_impdp;
         logfile := TARGET_FIN_HR || '.log' ;
         job_name := TARGET_FIN_HR || '2_job' ;
         h5 := DBMS_DATAPUMP.OPEN('IMPORT','FULL',NULL,job_name);
         DBMS_DATAPUMP.ADD_FILE(h5,dumpfile,'DATA_DIR');
         DBMS_DATAPUMP.ADD_FILE(handle=>h5,filename=>logfile,directory=>'DATA_DIR',
         filetype=>DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
         DBMS_DATAPUMP.METADATA_REMAP(h5,'REMAP_SCHEMA',SOURCE_FIN_HR,TARGET_FIN_HR);
         DBMS_DATAPUMP.METADATA_FILTER(h5,'EXCLUDE_PATH_EXPR','like''%/TABLE/INDEX/STATISTICS/INDEX_STATISTICS''');
         DBMS_DATAPUMP.METADATA_FILTER(h5,'EXCLUDE_PATH_EXPR','like''%/TABLE/STATISTICS/TABLE_STATISTICS''');
         DBMS_DATAPUMP.START_JOB(h5);
    job_state := 'UNDEFINED';
    while (job_state != 'COMPLETED') and (job_state != 'STOPPED') loop
    dbms_datapump.get_status(h5,
    dbms_datapump.ku$_status_job_error +
    dbms_datapump.ku$_status_job_status +
    dbms_datapump.ku$_status_wip,-1,job_state,sts);
    end loop;
    dbms_output.put_line('Job has completed');
    dbms_output.put_line('Final job state = ' || job_state);
    dbms_datapump.detach(h5);
    ----->has to be invoked create_view(TARGET_FIN_HR,Target_admin ),
    END;
    create_view statement:
    create_view: contain
    conn Target_admin/admin
    grant insert to TARGET_FIN_HR.table;
    conn TARGET_FIN_HR/fin_hr
    create view view_name as select * from Target_admin.table;
    ----

    Yes Sir,
    You are right... Your service is not just $200 hundred, it is priceless. I have never been in programming. So I am learning. And as per as "exec immediate" is concerned I have used it(Problem with SQL query sequence and you can c in the previous posting(problem with it is if you have 5 grants and 5 view, what you do). One more thing, I was just thinking if we can developed some thing like sed command does(on linus). It has to just change some table_name and username in a file but the problem was it has to pass the variable to linux and then we have to connect to ssqlplus and then we ahve to again run. I was just thinking to have expert view.
    Is not this forum made for that?
    Message was edited by:
    sanora600

  • Global Variables passing from standard form for use on custom form

    Hi,
    I'm trying to grab a value from a standard form, and pass it to a new custom form, which I am opening automatically from the standard form via personalizations. Is anyone aware of a way to send a value from one form to another? I was going to try using a global variable, which it looks like you can set through personalization. I tried doing it by passing the value as a form parameter, which works if I hard code a value, but it doesn't work if I refer to a value from the standard form.

    in your E-Business-environment may exist some special codings, which you have to think of, when passing parameters through the application.
    Copy the question to your EBS-Forum. They know ways using personalization and passing parameters

  • Creating a array from variables passed from php

    I have passed variables from PHP to flash successfully but
    now need to firstly make them into an array. A next button and
    previous button has to trigger the step through the array.
    Any ideas?

    I have a PHP script and I get flash to load the variables
    from it. The code is as follows. Taken out the connection to DB for
    security.
    <?php
    $hostname_conn = "";
    $database_conn = "";
    $username_conn = "";
    $password_conn = "";
    // establish a SQL connection to the host - host, user, pass
    $conn = mysql_pconnect($hostname_conn, $username_conn,
    $password_conn) or trigger_error("The site database appears unable
    to provide a connection. Please contact support.
    ".mysql_error(),E_USER_ERROR); // or die("The site database appears
    unable to provide a SQL connection. Please contact support.");
    // connect to the right DB (there may be multiple db's on the
    server) dbName
    mysql_select_db($database_conn, $conn) or die("The site
    database appears to be unavailable. Please contact support.");
    $qCheck = "SELECT * FROM pics";
    $rsCheck = mysql_query($qCheck) or die("Check Failed :
    ".mysql_error());
    $cCheck = mysql_num_rows($rsCheck);?>
    &img=<?php
    while($row= mysql_fetch_assoc($rsCheck))
    print($row["img"]);
    ?>

  • Variables - Passing from frame to frame

    Hello,
    I am wondering if anyone can help me, and what I need to do
    is even possible :S
    I have a simple flash document where all the code is running
    in frames on the timeline, not the most efficient way I know, but
    it is sufficient for what I need to do in this case :D
    I have an input field on the first frame and the user puts
    their name in, this then gets passed to a variable named
    "forename". The thing I need to do is pass that variable onto the
    next frame to input into a dynamic text field.
    I have put the code off the first frame below to try and
    explain better.
    var forename:String = "";
    forename = forename_txt.text;
    So I need to take the forename and put it into a text field
    on the next frame. However at present flash throws an error up, in
    the past I would have solved this using a _global variable, but
    this no longer exists in action script 3.0 does it??
    Many thanks for any help, it is greatfully recieved.
    Kind regards
    Jude

    If you declare a variable on the first frame of the timeline,
    you should be able to access it no matter what frame you are on.
    //FRAME 1
    var forename:String = "";
    btn.addEventListener(MouseEvent.CLICK, nextFunc);
    function nextFunc (ev:MouseEvent):void {
    btn.removeEventListener(MouseEvent.CLICK, nextFunc);
    forename = forename_txt.text;
    gotoAndStop(2);
    //FRAME 2
    trace(forename); //outputs the text that was in
    forename_txt

  • Variable passing from unix to sqlscript and using in insert

    please let me know how can I read a value from unix to my insert statement
    SYSTEM>!cat test.sh
    sqlplus system/oracle @/export/home/oracle/test.sql $1,$2,$3
    test.sql
    begin
    insert into source_impdp($1,$2,$3);
    commit;
    end;

    Obviously this will work only when you have shell variables 1, 2 and 3. However I don't think variable names can start with a digit.
    So you would end up with either 1 of the two below solutions
    export var1=....
    export var2=...
    export var3=...
    # Please note in the following line the comma should be a space
    sqlplus system/oracle @/export/home/oracle/test.sql $var1 $var2 $var3
    define meaningful1='&1'
    define meaningful2='&2'
    define meaningful3='&3'
    declare
    begin
    insert into source_impdp('&meaningful1','&meaningful2','&meaningful3');
    commit;
    end;
    OR
    export var1=....
    export var2=...
    export var3=...
    sqlplus system/oracle @/export/home/oracle/test.sql <<EOD
    define meaningful1='$var1'
    define meaningful2='$var2'
    define meaningful3='$var3'
    declare
    begin
    insert into source_impdp('&meaningful1','&meaningful2','&meaningful3');
    commit;
    end;
    EOD
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • How to pass Presentation Variable Value from Main Report to Detail Report

    Hello,
    I've 2 reports that is attached to each other. In my main report i've several report prompts and i am using i"s prompted" on my detail report to attach them.
    But 2 of my report prompts are presentation variables(Names : FIRST, SECOND). Both are in date format. I've a filter in my main report like;
    "ASSIGNMENTS_F"."EFFECTIVE_START_DATE" BETWEEN @{FIRST} AND {SECOND}
    It works fine when i run the main report. But when i click on the numbers, i see that i can not filter my detail report with the chosen values for 2 presentation variables. It just shows all the dates.
    I've tried adding both presentation variables in both reports as columns and adding 'is prompted' filter to them. But did not work either.
    I just cant pass the written values for presentation variable prompts to detail report..
    Please help :)

    Hi,
    What you can try is refer the filte condition in the main report to the detailed report with the option--> Filter based on another request.
    Or you try creating another intermediate report which will refer the main report filters and pass the filters to the detailed report.
    Hope this helps.
    Regards
    MuRam

  • How To Pass Data Between A Main Report and a Subreport

    Hello,
      I'm working with Crystal Reports Professional XI. 
      I have a main report with two date parameters: BeginDate of Date type and EndDate of Data type.  The main report has no details being printed instead it's grouped by a formula field and displays a summary count at the group footer.  I have  a subreport that is not linkable to the main report.  The subreport is grouped differently.  It has no detail records being printed and displays a summary count at the group footer as well.  The two reports are using the same tables with the same linking relationship.
       I created the same two date parameters in the subreport but this isn't right because when I run the report then I get four Date prompts: BeginDate and EndDate parameter from the main report and the BeginDate and EndDate parameter from the subreport.
      I'm not dong something right here.  What do I need to change in the reports so that l have the same record selecton being passed from the main report to the subreport record selection based on the BeginDate parameter and the End Date parameter from the main report?  Right now, the subreport is selecting all the records in the tables specified.
      Have a great day.  Any feedback would be greatly appreciated.
    Thanks,
    Ting

    Hi Jason,
       Thanks for replying to my posting.  It's been awhile since I've worked on Crystal Reports so I'm getting reacquainted with sub-reports again.  
        By linking the main report to the subreport by the BeginDate and BeginEnd parameters, will the date parameters be passed from the main report to the record selection for the subreport?  
       Also by doing your approach when the user is prompted to run the report, will it display on the popup window four date parameters: the BeginDate and EndDate from the main report and underneath that the BeginDate and EndDate from the sub report?  If so I'm trying to avoid that because it would be the same date range that I'm wanting to use for the main report and the subreport.  
        I hope that made sense.
    Thanks,
    Ting

  • Need to supress main report based on shared value comes from subreport

    Hi,
    I have a database that is used in both main report and subreport. On main report I have column a,b ,c, d,e,f to display in detail section, the subreport (column c, g,h etc) is also displayed on detail section, the link between main report and subreport is column a,b and a formula based on the value of c. So the link is within one database, some records link with other records  and display both matching records on one line(especially column c shows one value in main report and another value in subreport). That's why I need subreport and I can display the report correctly.
    Here is my question: if one record in main report couldn't find a match in subreport (subreport is blank), then I would like to show this record; if one record in main report does find a match in subreport, I don't want it to show(need to be supressed). I can define a shared variable to flag whether the subreport is blank or not, but this shared variable has to be placed under the section of subreport in main report and I don't know how to supress the upper detail section with subreport in it.
    Any help would be appreciated!
    Helen

    Hi
    In this case you need to insert the same sub report twise.
    Example :
    Detail a--Insert the sub report and go in sub report suppress all sections and using shared variables bring the value to main report.
    Detail b -- based on detail a sub report suppress the main report records
    Detail c-- Your actual sub report will display the values.
    Note : use the same links for your detail 'a' sub report which you are using for detail 'c' sub report.
    Thanks,
    Sastry

  • Parameter passing from master to subreport

    Is it possible to pass a multi-value parameter from a master report to one or more subreports? If so, how?
    Thanks for any help.
    Wayne E. Pfeffer

    Yes you can do this. I suggest the following: In your subreport make the report parameter a multi-value parameter. Test the subreport stand alone and make sure it works. Then drop the subreport into your main report, and map the subreport parameters to the main report parameters.
    Scenario 1 (multi value parameter pass through):
    The Main report has report parameter A which is a multi value parameter. You want to pass it to SubReport1 which has a report parameter B which is also defined as multi value parameter. In this case the mapping is just a simple parameter expression: =Parameters!A.Value
    The subreport RDL element would look like this:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Parameters!A.Value</Value>
                  </Parameter>
                </Parameters>
              </Subreport>  
    Scenario 2:
    The Main report has no report parameters. You have a SubReport1 with a report parameter B defined as multi value parameter. You want to pass e.g. three selected values "A", "B", "C" as parameter values to the subreport. You need to create a multidimensional object array on-the-fly, e.g. with the Split function, e.g.: =Split("A,B,C", ",")
    RDL example:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Split("A,B,C", ",")</Value>
                  </Parameter>
                </Parameters>
              </Subreport>
    Scenario 3:
    The Main report has a multi-value parameter A. You want to pass only the first selected value from the main report's parameter to the subreport and the subreport's report parameter B is a single-value parameter. You can do this by using e.g. =Parameters!A.Value(0)
    RDL example:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Parameters!A.Value(0)</Value>
                  </Parameter>
                </Parameters>
              </Subreport>
    -- Robert

  • Can a subreport select records based on values in the main report record?

    Post Author: calvin
    CA Forum: General
    Perhaps my understanding of a subreport is incorrect as this is the first time I've used one, but it seems to me that the subreport should be able to use the values from the main report record in its (the subreport's) operations-but my subreport doesn't seem to be working that way.In my main report, I select a set of records from a 'request' table. I have a subreport in the detail section so the subreport is processed for each of the request records. That works, but I'm simply getting the same data reported multiple times. It's as if the subreport only uses the last request record rather than the current one. Stating it this way I can see that the problem might be evaluation time-it's processing the request records first, then processing the subreport, and only then printing everything. If this is correct then putting WhilePrintingRecords on the subreport should work-but the only way I know of to do that is in a formula. Can I call the subreport from a formula? Or am I totally off-track?Thanks.

    Post Author: foghat
    CA Forum: General
    Have you established a link(s) between your main report and subreport?When viewing the main report, click edit --> subreport links and link the 2 based on whatever values from the main report you want.

  • Filter condition not working when Navigating from Main report to detail

    Hello,
    I have one report in OBIEE 10.3.4. Below is the filter condition used in Main report:-
    (Customer Secondary Organization is equal to / is in BMS OTHER C
    AND Customer Tertiary Organization is equal to / is in S&FO )
    OR Customer Secondary Organization is equal to / is in MKTG
    Also in my detail report I am using the same filter conditions:-
    (Customer Secondary Organization is equal to / is in BMS OTHER C
    AND Customer Tertiary Organization is equal to / is in S&FO)
    OR Customer Secondary Organization is equal to / is in MKTG
    Now when I am navigating from Main report to Detail report, then this filter condition is getting overridden by below condition:-
    Customer Secondary Organization is equal to MKTG
    and Customer Tertiary Organization is equal to S&FO
    or Customer Secondary Organization is equal to MKTG
    What I noticed is If I rearrange the filters and make it as below:-
    (Customer Secondary Organization is equal to / is in MKTG
    AND Customer Tertiary Organization is equal to / is in S&FO)
    OR Customer Secondary Organization is equal to / is in BMS OTHER C
    Then I am getting the filter in detail report as:-
    Customer Secondary Organization is equal to BMS OTHER C
    and Customer Tertiary Organization is equal to S&FO
    or Customer Secondary Organization is equal to BMS OTHER C
    It is taking Secondary Organization which is 2nd one in the main report.
    Can anyone please help me on this.
    Thank You,
    Shivam Saxena

    Hi,
    What you can try is refer the filte condition in the main report to the detailed report with the option--> Filter based on another request.
    Or you try creating another intermediate report which will refer the main report filters and pass the filters to the detailed report.
    Hope this helps.
    Regards
    MuRam

Maybe you are looking for

  • When to send JOIN channel to IRC server?urgent..

    i have a problem regarding sending information to IRC server. I want to send the join message to server. But i can only do so after server has finished sending information to me. may i know the correct coding ? i have tried to send it after the while

  • Not able to connect HTTP web servers outside firewall

    Hi I unable to connect external web server from my java program. Even I used follwing code to in my java program. I am getting some problem with encoding the password(base64Encode) Please anyone can give code to bypass this corporate firewall from my

  • Error: ConnectionFactory not bound

    Hi, I have created a method in session bean to send message. below is the code of my method public void sendMessage() throws NamingException,JMSException{ QueueConnectionFactory cf; QueueConnection connection; QueueSession session; Queue destination;

  • LabView enters some sort of deadlock after writing to the Rohde & Schwarz UPL Audio Analyser

    It sometimes (pretty often) happens that after a write commando to the UPL (through GPIB), LabView enters some sort of deadlock. The LabView Program indicates as executing, but nothing happens. The fault enters in my complex program, but also in very

  • Just got my first ipad cant get it to home screen or sign on line help?

    I just got my first i pad and cant get it to work. I cant get the id numuber because I cant get the home page up. Just wants to set up online service which isnt working for me either.