Passing Shared Variable from subreport to main report

Hello,
I am having difficulty passing the shared variable from the subreport to the main report.  For some reason, when viewing the data, the value for the very first row is returning a 0 but the second row is returning the value that should be in the first row.   Does anyone have an idea of what I'm taking about?
Thanks.
Z

In Subreport there is a group based on the client.  There is a summarized amount field in this grouping.  I placed a formula in the grouping and suppressed it.  The suppressed formula is listed below.
{@ store client payments}
WhilePrintingRecords;
Shared CurrencyVar cRelatedPayments;
cRelatedPayments := cRelatedPayments+Sum ({amount.amt}.{client.client_number});
cRelatedPayments;
In the main report, there is 2 groupings, first grouping is the client and second is the invoice.  The client grouping is displayed while the invoice grouping is suppressed.
The following is the formula in the main report to get the shared value.
WhilePrintingRecords;
Shared CurrencyVar cRelatedPayments;
cRelatedPayments;
This is placed in the client grouping.
I hope this helps.
Z

Similar Messages

  • Passing a variable from subreport to main report

    Hello,
    Was hoping to get some assistance on this issue I'm facing.  I've got a sub-report that calculates a monthly goal based off the date selection criteria. And I'd like to pass this goal back to the main report.
    In my sub-report, I created a new formula named ProcGoalVariable:
    WhilePrintingRecords;
    Shared Numbervar ProcedureGoal := cdbl({#ProcGoal})
    While {#ProcGoal} is a running total I created for the sub-report and now I'd like to pass it back to the main report.
    In the main report, I created a new formula named ProcGoalVariable:
    Shared NumberVar ProcedureGoal;
    ProcedureGoal;
    But when I drop this into my report, it is returning a value of 0.  In the screen shot, the Proc. Needed should actually equal the Proc Goal:
    Any suggestions on how to pass this correctly?

    Thanks for the advice,
    I want to rewind a bit to make sure I am explaining myself clearly.  My sub-report is pulling the correct numbers and it is located in GF#3 and contains two values that fall under "Proc Goal" and "Prod Goal". These are being calculated correctly and I would then like to pass them back to the main report for additional calculations done on this.
    In the sub-report, a formula was created "ProcGoalVariable":
    WhilePrintingRecords;
    Shared Numbervar ProcedureGoal := cdbl({#ProcGoal})
    In the main report, a formula was created "ProcGoalVariable"
    Shared NumberVar ProcedureGoal;
    ProcedureGoal:=ProcedureGoal;
    Would having the same name inside the formulas being causing the issue? And I've tried inserting a new section below the section where my subreport lives and I still get a value of 0.
    Not sure what else to try at this point.

  • Passing the values from subreport to master report in JasperReports

    Hi All,
    I want to pass the values from subreport to master report, but my subreport is without any query.
    Please help me in this regard. its urgent.
    Thanks & Regards
    Kris

    Hi,
    Below link may help you
    http://jasperreports.sourceforge.net/tips.tricks.html#returnvalues
    regards
    MJ

  • Passing a variable from subreport to the main report

    Hi guys, was unable to google this, so Im urning to you guys:
    I was wondering whether it was possible to do this:
    I have a subreport taking data from a table. In the main report, in the suppres condition of details section containing this subreport, I need to have a variable containing the total count of rows in that table. I know there are shared variables for that, but the problem is, that the variable in the condition is processed sooner than the one in the subreport.
    Any ideas on this?
    Thanks a lot

    To Sharma:
    Hi, unfortunately I can't. The subreport has its specific position in constallation with previous and following sections and must be right there.
    To Raghavendra:
    Hi, that was my first idea, but the problem is as I explained in my first message.
    To both:
    I have a table in subreport. This subreport is in main report positioned in details section "x". and I want to use that shared variable in the suppress condition of section "x". The problem is that the formula in suppress condition is processed sooner than the formula assigning a value to the shared numbervar inside the subreport.
    and thats what im looking for - a workaround for that. btw im using CR 8.5
    thanks again guys

  • How to get shared date value from subreport to main report

    Hi,
    I need your help in passing the value of a running total that is located in the subreport to the main report. The running total in the subreport is getting the maximum of the Effective Date (which it is type in the database is date) for each group and it is value will change on the change of the sequence no. group. I am printing the value at the group footer which displayed correctly. Now my issue is that how to pass the value from the subreport to the main report as a date. I have created a formula that it is having the code:
    shared datevar ddd := date(0,0,0);
    ddd:={RTotl0}
    The above formula is not compiled and it is first giving me an error at line 1 that date(0,0,0) is not accepted. Then when I removed it, it gave me an error that ddd:= can't have a running total to a datevar.
    So can you please help in getting the value from the subreport and then to pass it to the main report as a formula as I need to include it in other formulas which it compares the dates.
    Thanks

    Hi Mohammed,
    Are you displaying the shared variable on the Main Report's group footer as well?
    Try changing the code to:
    shared datevar ddd := cdate(0,0,0);
    ddd:= date({RTotl0});
    -Abhilash

  • Crystal Reports 10, Want to pass values from subreports to main report

    Post Author: playmkr278
    CA Forum: General
    Is there a way to just share values out of subreports.
    The reason I ask is that I am having problems pulling the correct information in one subreport so I'd like to use 2 subreports to pull out Billable hours on one and Billed Hours on another and then add them together to display on the main report.

    Post Author: Jedit
    CA Forum: General
    Yep there is!
    In your sub report
    I the formula editor create a shared variable then create the same variable in your main report.
    EG
    IN your SUB
    Create new formular called tothrs etcu2026..
    whileprinting records;
    shared numbervar tothrs: sum({table.fieldname}]
    In Your Main Report
    whileprinting records;
    shared numbervar tothrs
    this passes the value from your sub to the main, check help for different types of format as the one above is only for a number there are others for time & date etc..
    hope this helps!
    I have been doing a similar exercise myself but got stuck summing the parameter values in my main report, if you solve this let me know?
    Please see http://technicalsupport.businessobjects.com/cs/forums/thread/6210.aspx

  • Passing Array From Subreport to Main Report then Summing

    Hi,
    I am having troble passing an array from a sub report to the main repport.  I have managed to create the array, pass it and display it in the main report, however the first value of the array is displayed twice.  Here is the  formulae I have used:
    In the sub report:
    whileprintingrecords;
    shared stringvar str;
    str:=str{@value}","
    In the main report:
    whileprintingrecords;
    shared stringvar str;
    stringvar array arr;
    arr:=split(str,",");
    join(arr,",")
    Also, when I have managed to resolve the problem of the first value printing twice, I hope to change the array back to a number array and sum all of the values together.  I'm not too sure how to do this either.
    I hope you can help.
    Julie

    Ummm... Isn't Join(Split(str,","), ",") = str?  Why bother with the two extra lines of code?  Also, are you sure the subreport isn't creating the "duplicate first value"?  (I.e.  The data has the same value on two records, so it's being added twice?)
    Also if you're looking for the sum, why not create another shared variable and sum the value in the subreport as you're building the array (assuming you need the array for other purposes)?
    HTH,
    Carl

  • Passing values from subreport to main report

    Dear All,
           I have used shared values in my sub report and i want to use that shared variable in my main report in one of the formulas for average calculation but i see the values as 0.
    Can someone let me know what I am missing.
    Regards,
    Sonali

    Hi
    The most important thing to remember when using shared variables is that Crystal Reports must first evaluate the formula where the value is stored before evaluating the formula that retrieves the shared variable.
    For example if you want to pass a grand total from the subreport to do a calculation in the main report, follow these steps:
    1. In the subreport, create a formula similar to the one below:
    //@SubFormula
    //Stores the grand total of the
    //{Orders.Order Amount} field
    //in a currency variable called 'myTotal'
    WhilePrintingRecords;
    Shared CurrencyVar myTotal := Sum ({Orders.Order Amount})
    2. Place this formula in your subreport.
    3. In the main report, create a formula that declares the same variable name:
    //@MainFormula
    //Returns the value that was stored
    //in the shared currency variable called
    //myTotal in the subreport
    WhilePrintingRecords;
    Shared CurrencyVar myTotal;
    myTotal
    4. Place @MainFormula in a main report section that is beneath the section containing the subreport.
    NOTE:
    For the shared variable to return the correct value in the main report, you must place @MainFormula in a main report section that is beneath the section containing the subreport. This ensures Crystal Reports evaluates the @SubFormula before @MainFormula.
    One way to do this is to insert a section below the section containing the subreport, and place @MainFormula in this new sub-section:
    · On the 'Format' menu, click 'Section'.
    · On the 'Sections' list, click the section containing the subreport.
    · Click 'Insert' (at top of dialog box). This inserts an additional subsection.
    · Click 'OK' to return to the report, and insert @MainFormula into this new sub-section.
    The next time you preview the report, @MainFormula displays the value from the subreport. In this particular example, that value was the grand total of the {Orders.Order Amount} field.
    5. Once you have verified that @MainFormula is returning the correct value from the subreport, you can include this formula in other main report formulas, such as:
    //@NewFormula
    //includes data from subreport
    {@MainFormula} + Sum ({Customer.Last Year's Sales})
    · Place this formula in the same section as @MainFormula, or in a section further down on the report.
    You have now successfully shared data from a subreport with the main report.
    NOTE:
    This is not possible with On Demand Subreports in Crystal Reports since the report will not be processed until after clicking report.
    Regards
    Sourashree

  • Pass a shared variable from a sub-report into cross-tab

    Hello everyone!
    I need to pass a calculated value in a shared variable from a sub-report into a croos-tab in the Group footer of the main report. When I place this variable in the group footer I can see the value, when I use this variable in the Cross-tab, it is 0.
    In the Sub Report:
    whileprintingrecords;
    shared numberVar Total_SF;
    Total_SF:= calculation.
    In the Main report:
    whileprintingrecords;
    shared numberVar Total_SF;
    In the Cross-Tab I am using the above formula from the main report.
    Do you guys know what I need to do for this to work?
    Thank you,
    T.

    Hey Tat,
    I have learned to avoid passing shared variable from sub reports back to main reports.  You just always seem to run into issues with execution order.
    Personally, I try to create a shell report and add sub reports, calculating the values I need in the first sub report and pass the values to subsequent sub reports using shared variables.  I'd recommend thinking about arranging your reports like this during your design time.  It has saved me some headaches.

  • Passing a variable from a movie clip to the main timeline

    Hi,
    I'm having trouble passing a variable from a movie clip in my
    flash file to the main timeline.
    I have a movieclip with the instance name IntroNav which
    contains several buttons. Clicking a button sets the variable
    "page" to a specific name, i.e. page = "home"
    However, outside of the movie clip, on the main timeline I am
    unable to call this variable, and "page" seems to have no value.
    Can anyone tell me why this is and how to solve it?
    Thanks

    Umm, yes ... declare your variables correctly.
    var page:String = new String(); //proper complete
    var page:String; //strict typing
    var page:String = "home"; //stirct typing with value
    declaration
    Do not declare the variable in your buttons, you would have
    to do so in every button and be constantly resetting the value.
    Declare it on the main timeline at the lowest level. You do not
    need to use it as a _global, you just need to resolve your path
    issues. You can 'set' the variable value from a button, without any
    problem, but you have to call to the variable correctly.
    You do not 'name' a variable as "_root.page" , the '_root'
    refers to the lowest level of the SWF or the main timeline, as does
    a call to ' _level0' (that's a zero). If the variable is declared
    on the main timeline, and you're calling from the MC/button or
    anywhere you can refer to the variable by calling to it by
    the proper path of '_root.page'
    To set the variable from any of your button/MC instances
    call:
    _root.page = "value"; OR _level0.page = "value";
    But you must have the varibale declared on the main timeline,
    and only once and the playhead should be stopped or it will reset
    the value to the default upon looping.

  • Slow performance refreshing report with multiple subreports in main report

    I am using multiple subreports in my main report that appear to be slowing down the performance of the report considerably. Is there something I can do to increase performance with subreports.

    Hi Brian,
    Subreports are a known performance hog.
    I would suggest going back to the drawing board and rethinking on the layout of the report. The best thing, of course, would be to completely get rid of the subreports by creating a single SQL statement that takes care of all the report's requirements.
    Sometimes it is imperative to have subreports, in which case, you should try to make sure any selection filters from both the Main Report and the Subreport are passed back to the database.
    Also, avoid using Page N of M for better performance - with or without Subreports.
    -Abhilash

  • Controlling execution of subreport on main Report in ssrs 2008 R2

    Controlling execution of subreport on main Report in ssrs
    Hi,
    Am using more than 100 subreports in my main report using ssrs 2008 R2.
    And given conditional Visibility in sub reports based on the Parameter selection in main Report . But the performance is very very slow in main report.
    While selecting single sub report executes in seconds. The same report in main report executes in hours.
    According to my view,
    All the Sub reports executes and finally conditional visibility is working. Can we Control executing sub reports?
    Regards, Gayathri devi P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)

    Hi,
    I think the time to render 100 report sure will be long time and the main report want to render those reports.
    So first why you do not separate those report on many reports for different purpose.
    second if this is a dashboard report you may use many matrix in the same report and the parameters passed by default or based on expression.
    I really hope if you make your report as dashboard report, many matrix many parameters render it once. As I remember I think SSRS will try to execute your
    DataSets in parallel which will reduce your waiting time.
    I hope this is helpful.
    Elmozamil Elamir
    MyBlog
    Please Mark it as Answered if it answered your question
    OR mark it as Helpful if it help you to solve your problem
    Elmozamil Elamir Hamid
    http://elmozamil.blogspot.com

  • How to pass a variable from HTML to Flash

    I have built my flash ad banner in Flash 9 and now want the
    HTML code to pass the url over to the flash movie that it should
    jump to when clicked.
    The info in the help file seems out of date for the latest
    HTML template as it uses mainly JavaScript to get round IE's
    dreadful embeding issue. So my problem is, how do I pass a variable
    from the HTML to the actionScript specified int he Help file
    (running on a full screen button) as shown below?
    myButton_btn.onRelease = function() {
    if (clickTAG.substr(0, 5) == "http:") {
    getURL(clickTAG);
    via the html code now used by Flash 9 which is like this:
    <!-- saved from url=(0013)about:internet -->
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Advert_long</title>
    <script language="javascript"> AC_FL_RunContent = 0;
    </script>
    <script language="javascript"> DetectFlashVer = 0;
    </script>
    <script src="AC_RunActiveContent.js"
    language="javascript"></script>
    <script language="JavaScript" type="text/javascript">
    <!--
    // Globals
    // Major version of Flash required
    var requiredMajorVersion = 9;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Revision of Flash required
    var requiredRevision = 115;
    // -->
    </script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    Coping
    with
    Growing
    Audio
    Series
    Theraputic stories
    for children aged
    4 to 9
    -->
    <script language="JavaScript" type="text/javascript">
    <!--
    if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {
    var hasRightVersion = DetectFlashVer(requiredMajorVersion,
    requiredMinorVersion, requiredRevision);
    if(hasRightVersion) { // if we've detected an acceptable
    version
    // embed the flash movie
    AC_FL_RunContent(
    'codebase', '
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
    'width', '120',
    'height', '600',
    'src', 'Advert_long',
    'quality', 'high',
    'pluginspage', '
    http://www.macromedia.com/go/getflashplayer',
    'align', 'middle',
    'play', 'true',
    'loop', 'true',
    'scale', 'showall',
    'wmode', 'window',
    'devicefont', 'false',
    'id', 'Advert_long',
    'bgcolor', '#ffffff',
    'name', 'Advert_long',
    'menu', 'true',
    'allowScriptAccess','sameDomain',
    'allowFullScreen','false',
    'movie', 'Advert_long',
    'salign', ''
    ); //end AC code
    } else { // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be
    placed here.'
    + 'This content requires the Adobe Flash Player.'
    + '<a href=http://www.macromedia.com/go/getflash/>Get
    Flash</a>';
    document.write(alternateContent); // insert non-flash content
    // -->
    </script>
    <noscript>
    // Provide alternate content for browsers that do not support
    scripting
    // or for those that have scripting disabled.
    Alternate HTML content should be placed here. This content
    requires the Adobe Flash Player.
    <a href="
    http://www.macromedia.com/go/getflash/">Get
    Flash</a>
    </noscript>
    </body>
    </html>

    You should use SWFObject to embed your Flash. Not only does
    it make
    embedding more straightforward, it makes passing query
    parameters very easy.
    Check out:
    http://code.google.com/p/swfobject/
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How to pass a variable from HTML to Flash 9

    I have built my flash ad banner in Flash 9 and now want the
    HTML code to pass the url over to the flash movie that it should
    jump to when clicked.
    The info in the help file seems out of date for the latest
    HTML template as it uses mainly JavaScript to get round IE's
    dreadful embeding issue. So my problem is, how do I pass a variable
    from the HTML to the actionScript specified int he Help file
    (running on a full screen button) as shown below?
    myButton_btn.onRelease = function() {
    if (clickTAG.substr(0, 5) == "http:") {
    getURL(clickTAG);
    via the html code now used by Flash 9 which is like this:
    <!-- saved from url=(0013)about:internet -->
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Advert_long</title>
    <script language="javascript"> AC_FL_RunContent = 0;
    </script>
    <script language="javascript"> DetectFlashVer = 0;
    </script>
    <script src="AC_RunActiveContent.js"
    language="javascript"></script>
    <script language="JavaScript" type="text/javascript">
    <!--
    // Globals
    // Major version of Flash required
    var requiredMajorVersion = 9;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Revision of Flash required
    var requiredRevision = 115;
    // -->
    </script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    Coping
    with
    Growing
    Audio
    Series
    Theraputic stories
    for children aged
    4 to 9
    -->
    <script language="JavaScript" type="text/javascript">
    <!--
    if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {
    var hasRightVersion = DetectFlashVer(requiredMajorVersion,
    requiredMinorVersion, requiredRevision);
    if(hasRightVersion) { // if we've detected an acceptable
    version
    // embed the flash movie
    AC_FL_RunContent(
    'codebase', '
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
    'width', '120',
    'height', '600',
    'src', 'Advert_long',
    'quality', 'high',
    'pluginspage', '
    http://www.macromedia.com/go/getflashplayer',
    'align', 'middle',
    'play', 'true',
    'loop', 'true',
    'scale', 'showall',
    'wmode', 'window',
    'devicefont', 'false',
    'id', 'Advert_long',
    'bgcolor', '#ffffff',
    'name', 'Advert_long',
    'menu', 'true',
    'allowScriptAccess','sameDomain',
    'allowFullScreen','false',
    'movie', 'Advert_long',
    'salign', ''
    ); //end AC code
    } else { // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be
    placed here.'
    + 'This content requires the Adobe Flash Player.'
    + '<a href=http://www.macromedia.com/go/getflash/>Get
    Flash</a>';
    document.write(alternateContent); // insert non-flash
    content
    // -->
    </script>
    <noscript>
    // Provide alternate content for browsers that do not
    support scripting
    // or for those that have scripting disabled.
    Alternate HTML content should be placed here. This content
    requires the Adobe Flash Player.
    <a href="
    http://www.macromedia.com/go/getflash/">Get
    Flash</a>
    </noscript>
    </body>
    </html>

    You should use SWFObject to embed your Flash. Not only does
    it make
    embedding more straightforward, it makes passing query
    parameters very easy.
    Check out:
    http://code.google.com/p/swfobject/
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • LoadVars-using send to pass a variable from flash to php

    For the life of me, I've tried everything:
    I've researched LoadVars on Adobe forum, used David Powers'
    books, googled 'flash to php', LoadVars, etc. and tried
    sendAndLoad, send, and using $_POST, $_GET, $_REQUEST.
    $HTTP_POSTVARS but I keep getting this same error. any advice
    please?
    I have a Unix server running Apache/PHP 4 - LoadVars worked
    to load name-value pairs into an array -see thread)
    My goal with this simple app is to prototype being able to
    pass a variable from flash to a variable in php.
    Parse error: syntax error, unexpected T_VARIABLE in
    flash_to_SQL.php on line 5
    Actionscript 2.0 code:
    var c :LoadVars = new LoadVars();
    c.testing = "123FOUR";
    c.send ("
    http://127.0.0.1/flash_to_SQL.php","_self","POST");
    php code: (I also tried $_POST, $_GET, $_REQUEST.
    $HTTP_POSTVARS)
    <?php
    //mysql 4.1.2, php 4 , NO mysqli
    ecbo $_REQUEST ['testing'];
    /?>

    var formData:LoadVars = new LoadVars();
    formData.fname = "Name";
    formData.send("
    http://www.website.com/flash_php.php",
    formData, "POST");
    <?php
    $name = $_POST['fname'];
    echo $name;
    ?>

Maybe you are looking for

  • Adobe Photoshop cs6 over citrix, Image Issue

    HI Guys, I am Citrix Tech, could you please help or suggest me in get this issue sorted. we have published Adobe Photoshop CS6 over Citrix which uses ICA protocol. When user launches the application and opens a image it loads with Blue coat color ove

  • How do get contacts on Mac to replace the ones on my phone?

    I want to clean up my address book on my iphone 4s and my iPad2.  What would be the best way to make this happen?  Do I need to completey erase the contacts on the Ipad and Iphohe and then sync with laptop?

  • Service Family Members

    Dear Experts. I have the following doubt if This is posible: I want that in the service of Family Members the system show only the last register in the  ESS that have the backend for the subtype 1. In this moment with the following image, the system

  • Creating xml within java app

    Hi, I have reached a situation where I have to create small pieces of xml (around 8k characters) within my java app. Right now I am using stringbuffer to create the xml which does not go against a dtd. This is working for now, since I do not have to

  • Comunnication between java and other languages, like clipper?

    can I easily communicate and send information from a java-applet to another program, written in clipper (dos)(and vice-versa)? Is it possible to do this with native programming?how? thanx, bart