Shared Variable in DETAILS section reports value of previous item.

I have a report with a subreport in the details section. I have set up a shared variable in the subreport to pass a value to the main report. For some reason, the value of the variable for the first detail line item, shows up in the field for the second, the value for the second shows up in the third and this pattern repeats. How can I get the shared variable to display in the correct record?

It's because the data in the details line is evaluated/diplayed before the subreport executes.
Split the details into two sections and place SR in top one and display formula for var in lower one.
If there is data in the subreoprt you want on same line as the var then in section expert set the upper detail section to underlay.
Ian

Similar Messages

  • 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.

  • Get data in a subreport based on a shared variable from the main report.

    Goodd morning,
    My question/problem is how to manage this scenario.
    I am transfering 2 shared variables (pereiod from /period To, ) from the main report to a subreport and now  i would like to get data in this subreport based on these 2 variables...
    The problem is that i can not find the shared one in select expert icon...
    Could anyone point me to solve this issue?
    Thks for any help.
    Jose Marin
    Crystal Report XI SR3

    Hello Jos,
    I recommend to post this query to the [Crystal Reports Design|SAP Crystal Reports; forum.
    This forum is dedicated to topics related to the creation and design of Crystal Report documents. This includes topics such as database connectivity, parameters and parameter prompting, report formulas, record selection formulas, charting, sorting, grouping, totaling, printing, and exporting but also installation and registering.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all Crystal Reports Design queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • Variable in loop is retaing values from previous loop

    Just wondering if anyone can see at a glance what I going wrong here.
    I have the following part of a script which is imbedded in another while loop which loops through 5 different items defined by 'accomm_id';
    while ($db_field = mysql_fetch_assoc($result)) {
    $SQLx = "SELECT price_from FROM AN_pricetable WHERE accomm_id = " . $db_field['accomm_id'];
    $resultx = mysql_query($SQLx);
    while($row=mysql_fetch_assoc($resultx))
      $price_from[] = $row['price_from'];
      //  do stuff with other column
      //  data if we want
    $pricefrom = min($price_from);
    $temp = $price_from;
    sort($temp, SORT_NUMERIC);
    foreach ($temp as $value) {
    if ($value > 0){ $pricefrom = $value; break;}}
    if ($pricefrom == 0){
              $pricefrom = "TBC";}
    The script is supposed to find the lowest price for the particular accomm_id that it is looping through at the time.
    The problem is that once the 'lowest price' for the item with the lowest 'lowest price' of all 5 accomms has been found, the following items take on that price, instead of their own particular lowest price. Somehow the '$pricefrom' value is being carried through to the next loop.
    The database has several entries for each accomm_id, all with different prices in the 'price_from' field. What I'm trying to find is the lowest for each accomm_id.
    Hopefully this is something obvious that I've missed, I just can't see why it won't work!
    Thanks

    As and alternative I tried;
    $SQLx = "SELECT MIN(price_from) AS minimumprice FROM AN_pricetable WHERE accomm_id = " . $db_field['accomm_id'];
    $resultx = mysql_query($SQLx);
    $pricefrom = mysql_result($resultx,$i,'minimumprice');
    if ($pricefrom == 0){
              $pricefrom = "TBC";}
    But for some reason it is not returning the minimum for any of the 5 accomms. For example one accom has four rows of prices, 8, 12, 50 and 7, and it is returning 12 as the MIN. What am I doing wrong here?
    Thanks

  • Issue with use of shared variables in Crystal Reports 2008 Offline Viewer

    Hi,
    I have a report that contains a number of sub-reports which include drill-down functionality. The report returns data relating to an individual team with the user being able to view top level summary information in each area from the parent report and then drill into the sub-reports to view see more detail. The data returned by the sub-reports is filtered, using sub-report links, based on the team code parameter value given by the user. This parameter field resides in the main report.
    One of the values returned by the main report is the team name. This is passed to each sub-report using a shared variable and each sub-report displays this team name as part of a heading.
    This all works fine in Crystal Reports 2008, but when a report, containing data, is opened using Crystal 2008 Offline Viewer there is a problem with the shared variable. The value is displayed correctly when the user initially drills into the sub-report. However, when the user begins to drill into grouped data within the sub-report the value passed to the sub-report using the shared variable disappears. 
    How can I ensure that, when a report is viewed using Crystal Offline Viewer 2008, the value within the shared variable is not lost when users drill into grouped data within sub-reports
    Thanks
    Stuart

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • Historical value of shared variable

    I need the shared variable still keep its latest value after pc restart.
    I tried on 2 pc, one is successful, the other not.
    Any suggestion? Thanks.

    I would imagine the content of shared variables are not stored anyway on the harddrive, so upon reboot of a PC their contents will be lost. You will only see default values at launch.
    If you want them to remember their latest value, you will need to save their contents to a file at exit, and read the contents back at launch.
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • CR XI R3:  Issue exporting shared variable to Excel - with workaround

    Hi,
    I have a report that uses a subreport to calculate a field based on the existance (or not) of data in a database other than the main report database.  When I use a shared variable to pass this field back to the main report and display it on a detail line (in the main report), it works fine - until I try to export the report to Excel.  When exported, the value that gets exported on all detail lines of the report is the final non-blank value of the shared variable, not the value that it contained when the detail line was initially generated.  I am using a shared variable because there are multiple values that I want to pass back to the main report. 
    Luckily, only one of the shared variables are being printed, so the workaround that I am using is to use the subreport to print the field instead of passing the value back in a shared variable and displaying that (and hiding the subreport on a separate format).
    Is this a known issue with R3 exporting to Excel?  (It was happening in R2 as well...)
    HTH,
    Carl

    Simplified somewhat, what this report is doing is looking up open orders in one database and checking to see if something specific happened to it in another database.  If so, it generates the XML that needs to be applied to the first database to update it.  The XML references the order number and line number.  What I mean is that instead of the data coming out as
    Order Line  XML Snippet
    12345 1234 ...<order>12345</order><line>1234</line><status>received</status>...
    22345 2234 ...<order>22345</order><line>2234</line><status>received</status>...
    32345 3234 ...<order>32345</order><line>3234</line><status>received</status>...
    42345 4234 ...<order>42345</order><line>4234</line><status>received</status>...
    I get
    Order Line  XML Snippet
    12345 1234 ...<order>42345</order><line>4234</line><status>received</status>...
    22345 2234 ...<order>42345</order><line>4234</line><status>received</status>...
    32345 3234 ...<order>42345</order><line>4234</line><status>received</status>...
    42345 4234 ...<order>42345</order><line>4234</line><status>received</status>...
    I have Base Column Widths on Details, so there should be no merging attempted, but I'll check and make sure.
    It seems to me, though, that the DLL is being told the wrong value to export...
    Carl

  • Shared Variable Engine

    Hi,
    What happens to network variables stored in the RT machine after a restart(after calling RT restart). I am experiancing weid behaviour.
    They seem to reset to a default value and I checked in the project via their propertis, Initial values is not set, and there are no callers at the start of the VI.
    Anyone has any ideas for this? Or at least tell me if values should persist after restart or reset?
    Thank you very much,
    Mihai

    Hi,
    I use shared variables stored on a PXI RT embedded controller.
    After a reboot, the variables are not set to the default value corresponding to their data type structure but to a "no known value" state (I don't know how it's exactly labelled in english, as I use a french version of LabVIEW).
    I noticed that if you try to read a shared variable in a "no known value" state using the "read variable" VI, you just get a warning. If you use the "read variable with timeout" VI, the code waits for a modified value of the variable, but once the shared variable has been initialized (ie has a known value) no stop occurs at the first reading with the "read variable with timeout" VI (even with an infinite timeout), as the current value of the variable when the code is launched is viewed as a "new" value.
    Not sure that this message will help you
    I've also experienced strange behaviours in reading shared variables : I've posted here a message in the french section af the forum, but without answer ; I plan to repost it here after new tests.
    Best regards,
    HL

  • Is it possible to use a Shared Variable within a Chart?

    I have a shared variable between a container report and a subreport called {@ResponseCount}:
    whileprintingrecords;
    shared numbervar Responses:= DistinctCount ({Survey_Response.RecipID})
    I placed the variable in the report footer and the value is passing correctly.  I would like to use this shared value in a chart; however, it is not even listed in the Chart Expert as an available field.  I was placing the chart in Report Footer b.
    I have also tried moving the variable value to the Report Header and placing the chart in the Report Footer, with the same result.
    I tried changing the variable to a global variable, thinking that I was using the incorrect scope, but that passed a zero value instead.
    Any suggestions would be welcome.  Thank you.

    Thank you for the response.  Though I almost gave up on this, I did find a way to access the shared variable after all.  I created a formula that simply called the variable formula.  For this example, I was using a shared variable to pull a value from my container report into my sub report for use in a chart.
    In my container report I created the shared variable {@Get_Responses}:
    whileprintingrecords;
    shared numbervar Responses:= DistinctCount ({Survey_Response.RecipID})
    In my sub report I created the formula to call the above variable {@Fetch_Responses}
    whileprintingrecords;
    shared numbervar Responses;
    Then, again in my sub report, I created a second formula to call the above formula {@ResponsesForChart}
    {@Fetch_Responses}
    This last formula was then available for use in the chart I needed to create.

  • Shared variable browse in a web published remote panel

    Hallo,
    I have made a simple VI where the user can select a shared variable and show the current value.
    I use a shared variable control to let the user select the variable from the panel.
    Everything run smooth if I interact directly on the server where the VI is running.
    This VI is published on the web and when I access the VI form a web browser I cannot browse the shared variable list.
    The pull down control is empty and the 'browse' text is disabled.
    Is there any option to have the shared variable list browsable on the web published panel ?
    I think this should be possbile since the VI is running on the server where variables are published.
    thank you
    Gianpiero

    Hi
    I suppose you used the shared variable control to implement your vi. In this case i have to inform you are using a ActiveX control that related to LabVIEW remote front panel shows some limitations.
    For more details i suggest you to visit this link which contains a list of the limitations you should keep.
    http://ae.natinst.com/operations/ae/public.nsf/web/searchinternal/21b9a9c913f54f918625703d004d6fd9?O...
    regards
    Logan 
    Matteo C. - Test Engineer

  • Change Alarm / Quality of Shared Variables for I/O Server

    How does one set the Bad Status of a Shared Variable in 2009?
    IE).  I have a custom device that communicates via TCP/IP.  I wrote my own I/O server that handles this communication and publishes a set of Shared Variables that my Main Application displays on a screen.  These variables are all doubles and hold pressures and temperatures.   If my I/O server in labview loses communication I would like to be able to set the status of the variables to bad so they will set off an alarm.  In our main application we have colour indicators that are able to display this status.  For example the background goes yellow for all indicators that are in "HI" alarm status, red in "HI HI" and orange when "Bad Status" (disconnected). 
    We were able to accomplish this using LabVIEW 7.1 DSC, by creating a VI to register all our "Tags" and a VI to run the server.  The server vi's that came with 7.1 allowed us to set the quality when writing to the server item.  Therefore when the device was disconnected or failed we could set the bad status and use the DSC system to log an alarm and use the alarm features to colour code our indicators. 

    None of the Shared Variable IO Properties can be configured to allow you to set the alarm.  You can only configure the properties such as turning the possibility of the alarm status on/off and the priority, name etc.  You do not have the ability to indicate that this shared variable is in alarm because your custom server has encountered a problem.   I've talked to tech support about it and I've been informed that this was something that was removed when the shared variable engine was introduced.   I've been told informed that the recommended alternative is to create an additional boolean shared variable that will contain the status of the items, or to write some sort of unique garbage value to the actual tag value to indicate there is a problem with it.
    I now have to come up with a new way of providing this information.  I just find it will likely be a poor programming choice because now my entire system will have to handle "tags" differently based on what hardware is being used.  (IE) if its coming from a custom I/O device or from an OPC / Modbus etc capable device. 

  • Error connecting to shared variable OPC item

    I have a DSC application that has a bunch of shared variables.  Some of those variables are bound to an OPC server(Eurotherm).  When I place controls or indicators in a VI and bind them to the shared variable, some of them get the "green light" and some of them get the "red light".  If I hover over the red light, there is a message about an error connecting to the shared variable.  However, all the values update and appear to be working correctly.  Why would I get this error?

    Hi Brian,
    Which version of the DSC Module is this? Is the OPC Server that you are trying to connect to on your local machine or on a remote machine?
    Have you tried deleting the front panel object and redragging it from the project explorer? What type of value is this (boolean, double, etc?)
    What are you referring to when you mean an "identical instrument" - are you connection to two different OPC I/O servers in your projects?
    Would you be able to post a screenshot of this error please?
    Best regards,
    -Sam F, DAQ Marketing Manager
    Learn about measuring temperature
    Learn how to take voltage measurements
    Learn how to measure current

  • Need to skip page break between header and Detail sections

    Hello,
    I am combining two reports in one report (one in header section and another report in the body section). when this report is run, there's a page break between these two sections. Is it possible to eliminate it? Ideally I would like the detail section to start as soon as the header section of the report is completed in the same page instead of starting (detail section report) in a new page.
    Any help is highly appreciated. Thanks,
    Sundar

    I'd put them into one section to control the breaks.

  • Network-Shared Variable - read string with CVI

    I need to read an NSV string with CVI.  I have been digging into accessing and writing NSV with CVI, but they are all scalar value.  What should I do with strings, clusters and arrays?

    'm an employee at National Instruments and I wanted to make sure you didn't miss the Network Variable API that is provided with LabWindows/CVI, the National Instruments C development environment. The the Network Variable API will allow you to easily communicate with the LabVIEW program over Shared Variables (http://zone.ni.com/devzone/cda/tut/p/id/4679). While reading these links, note that a Network Variable and a Shared Variable are the same thing - the different names are unfortunate...
    The nice thing about the Network Variable API is that it allows easy interoperability with LabVIEW, it provides a strongly typed communication mechanism, and it provides a callback model for notification when the Network/Shared variable's properties (such as value) change.
    You can obtain this API by installing LabWindows/CVI, but it is not necessary to use the LabWindows/CVI environment. The header file is available at C:\Program Files\National Instruments\CVI2010\include\cvinetv.h, and the .lib file located at C:\Program Files\National Instruments\CVI2010\extlib\msvc\cvinetv.lib can be linked in with whatever C development tools you are using.
    Thomas N.
    Applications Engineer
    National Instruments

  • Bind shared variable to multi-chan​nel item

    How do i bind a shared variable (array) to a Fieldpoint multi-channel item?
    When i configure the shared variable, and click browse to select the network item to bind to, i can select individual channels but there's no "All" tag.

    Actually I suspect that the problem is in the National Instruments OPC Server.
    DataSocket can read array data types from an OPC Server, but National Instruments' OPC Servers do not publish data in an array format.
    Probably the easiest solution is to publish your shared variable in your network but don’t bind it trough the opc server, instead you have to use it like a standard global variable (bind to source method).
    Give a look to this document may lead you to a better solution.
    http://digital.ni.com/public.nsf/websearch/FA61036​7EC62574186257118005089F2?OpenDocument
    Hope these two tips can help you
    FiloP
    It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
    Richard P. Feynman

Maybe you are looking for

  • Photoshop CS4 Won't Start

    Ok..so need some help here. I just downloaded and after a bit of buggering around got it all installed properly.  I go to start it up from the shortcut, get a Error: Do you want to send an error report... So I double click Photoshop.exe..again it doe

  • Ipad memory full of photos even after all photos deleted

    Hi, My daughters ipad is saying it is full of photos 10.24gb on a 16gb ipad. I deleted all photos out of photo roll and used space went up a little!!!!!!! i deleted all 3rd party apps not change!!!! Restored ipad and reinstalled back up,problem still

  • Layout shows different data depending on user-language (German or English)

    Hello best of the best, we are using layouts to enter data into BCS. In one of our layouts different numbers are shown depending on the user-language (German or English). This is despite the same layout is used. Have you got any idea what could cause

  • MS ISA authentication in PI

    Hi  Experts, I would like to know if it is possible to have MS ISA authentication in PI.. Im actually having this requirement in the sender file adapter...via FTP... Also is it possible to have Virtual Environment Compatibility... is this the same as

  • Date determination in MRP

    Hi, When running MRP with creation indicator for purchase requisitions set at '2', the opening period is used to determine whether the system creates a planned order or a purchase req.  I need to know where in the ABAP code is it determined which of