Staroffice Basic, Calc, passing and using ranges

Okay, I was trying to transfer a VBA function from Excel to StarOffice.
The routine call looks like this:
=PS_MUL($K$22:$K$277 ; $L$22:$L$277 ; $F$22:$F$277 ; F22)
That is, there are three ranges, and a value input.
Here is my attempt at STAROFFICE's version of this routine
Function PS_MUL(Tay1_A as Object, Tay2_A as Object, Rank_Vector, Rank_A as Long) as Double
   Dim Product_sum as Double
   Dim Element1 as Double, Element2 as Double
   Dim i as Integer, j as Integer
   Dim cell1 as Object, cell2 as Object
   Product_sum=0
   i=0
   For Each Element1 in Rank_Vector
      i=i+1
      j=0
      cell2=Tay2_A.GetCellByPosition(i,0)
      For Each Element2 in Rank_Vector
          j=j+1
          cell1=Tay1_A.GetCellByPosition(j,0)
          If Element1+Element2=Rank_A Then Product_sum=Product_sum+cell1.Value*cell2.Value
      Next Element2
   Next Element1
   PS_MUL=Product_sum
End FunctionIn VBA, I simply refereced "Product_sum=Product_sum+Tay_1A( i ) * Tay_2A( j )"
That is, the input cell ranges are 1-D arrays, and Tay_1A was implicitly defined. So I just used them as arrays, and no problem.
Here, no matter what I try to do with my code, including getting a cell reference by position and taking its value or whatnot, I still get errors.
I think it is becoming clear to me that I don't understand how to pass and use range references in StarBasic.
If anybody could help me out with understanding passing and using these range references, I'd appreciate it.
Just for comparison, here is the function in VBA:
Function CombSumProd(Tay_1A, Tay2_A, Rank_Vector, Rank_A As Variant) As Variant
Dim Product_sum As Variant, Element1 As Variant, Element2 As Variant
Dim i As Integer, j As Integer
Product_sum=0
i=0
For Each Element1 in Rank_Vector
  i = i+1
  j = 0
  For Each Element2 in Rank_Vector
      j=j+1
      If Element1+Element2=Rank_A Then 
             Product_sum=Product_sum+Tay1_A(i) *Tay2_A(j)
   Next Element2
Next Element1
CombSumProd=Product_sum
End Function

Hi
Follow the steps below - (I am assuming that you are using BI queries in your model & your tabs are as per quarter - one tab for each quarter)
1. Create one radio button & in entry list create static list as 1 - Quarter 1, 2 - Quarter 2 & so on.
2. Now you want plan Vs actual in one graph & Currency in another. So create these reports for each quarter separately, so in all you will have 8 reports (2 for each quarter)
3. IN the layout you have to arrange it vary carefully, you take all the 'Plan Vs Actual' report for all the quarters & arrange them exactly one over the other. Same for Currency reports also.
4. NOw Give visibility condition for each report example - if report is for first quarter then condition will be - bool(if(radio button string=="1",true,false)) & assign the default value in radio button as 1. so that at the time of execution you will get these reports by default.
5. Like wise give condition for all.
6. When you execute this report you will get radio buttons at the top & as you select different buttons differents report will get opened.
7. As you have plased these exactly one over the other, user will not come to know these are different reports.
Try this method, if you have any doubts for this, please do ask me.
Regards
Sandeep

Similar Messages

  • To coerce passed values, use the In Range and Coerce function.

    -" Device Number for Card 1 uses data range coercion, which now only applies to data entry; values will not be coerced when passed to subVIs. To coerce passed values, use the In Range and Coerce function."
    Hi,
    I had program runnning fine in labview version 5.0, Recently i updated to labview version 6.0, but when i opened file i will see many warnings like above.
    I saved the file as 6.0, all the warnings are gone and program compiles as well but i am not sure saving as 6.0 eliminate those problems like..."value will not be coereced when passed to subvis"

    It means that some of your controls use coercion to alter data if it is not within a range. In LV 5.0 this worked for either typing the data into the control or passing it through the connector as a sub-vi. In 6.0 the data won't be coerced if it has been passed through the connector as a sub-vi, only if it is entered on the front panel. If your sub-vis relied on this coercion to operate properly then you will need to add the "In Range and Coerce" function to your block diagram to manipulate these values. If the coercion wasn't important then disregard the warning.
    Hope this helps
    Brian

  • How do i use ranges and parameters together?

    Plz help me...
    I have a selection screen with about 8 parameters out of which two are mandatory, i.e. a flag and the date of creation. What I need to do is delete certain entries from a database table based on the parameters input by the user. Now the problem is when i am using the delete statement using where statement..
    delete from zinbd_delv where vbeln     = vbeln    and             
                                 posnr     = posnr    and
                                 lfimg     = lfimg    and
                                 lfdat     = lfdat    and
                                 created  = created and
                                 status   = status.
    But suppose the user enters data in only the two mandatory fields and say status = 'X' and created = 'XX/XX/XXXX'. In that case it should delete all the entries from the table where status = X and creation date as specified but since it will find the other parameters as blank it will fail. Can we use range table for this...plz tell me how to do it.

    i think if you are using parameters then you have to enter the value in that.
    or
    select-options : sop for mara-matnr no intervals no-extension.
    for single entry.
    data : itab like zinbd_delv occurs 0 with header line.
    select * from zinbd_delv ito table itab where vbeln in vbeln and
    posnr in posnr and
    lfimg in lfimg and
    lfdat in lfdat and
    created in created and
    status in status.
    delete zinbd_delv from table itab.
    commit work.
    regards
    shiba dutta

  • Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    I may have already resolved this issue buy removing the device from my computer and re-pairing it. It is currently working just fine.

  • How can I use a ranged comment marker to quickly define in and out range?

    Hi,
    I'm using several parts of a single clip, and they have overlapping in and out points. As I'll need to go back and grab them multiple times, I've defined these ranges by using a comment marker, then giving them a range by setting the in and out point in the marker panel.
    What I want to do is using this defined comment marker range, right click/double click/clap twice or something that will allow a shortcut to set this marker range as an in and out range so that I can put it into my sequence's timeline.
    I'm happy if I can skip the in and out all together and drag the marker to the timeline - but I tried this from the Marker panel, and it didn't work.
    If this functionality doesn't exist, I'm going to have to just set a marker for every in and out point, and that's just busywork and confusing as it's not clear what's the in and the out when your'e in the middle of all the markers.
    Thanks for any and all help

    Premiere does not have a feature that automatically converts a marker's In/Out to function as clip In/Out points. I recommend saving a subclip for each segment of interest. The subclip becomes a new instance of the clip in the project panel, which you can give a descriptive name.
    If you give this a try--and if you're using Premiere Pro CC--take a little time to learn about the "Restrict Trims to Subclip Boundaries" option, which controls whether a subclip is "hard" or "soft." http://tv.adobe.com/watch/learn-premiere-pro-cc/create-soft-subclips-with-flexible-edit-po ints/

  • I am on a MAC OSX 10.9.5, and using LR 5.7.  I have lost the "Develop" Basic Panel (white balance & color saturation).  How do I get it back?  Every thing else seems to be in place.

    I am on a MAC OSX 10.9.5, and using LR 5.7.  I have lost the "Develop" Basic Panel (white balance & color saturation).  Every thing else seems to be in place.  How do I get it back?

    This is one of the most commonly asked questions in this forum. See this.

  • Using variables in Calc scripts and Business Rules

    I am sure there have been previous discussions about this, but can somebody let me know the benefits of using variables in Calc scripts and BRs?
    Thanks,
    A

    I have never used calc variables and after reading a study guide, which talked about them, I couldn't really understand the benefits.^^^I use variables all the time to make abstract difficult formulas. Below is an example.
    /*     Declare variables     */
    VAR varSalaryCosts ;
    VAR varProdOHLabXXXX ;
    VAR varXXXX ;
    A whole bunch of code here along with very limited FIX statement and then...
    "Salaried Labor"
         varSalaryCosts = "Salary Costs"->"No Department"->"No Category"->"Salaried" -
                             "Wage Bonus"->"No Department"->"No Category"->"Salaried" -
                             "YYYY Retention Bonus 40%"->"No Department"->"No Category"->"Salaried" -
                             "YYYY 60% Ret Bonus Accrual"->"No Department"->"No Category"->"Salaried" ;
         varProdOHLabXXXX = "Number of Employees"->"ZZZZDepartments"->"Codes"->"Salaried" +
                             "Number of Employees"->"Blah Departments"->"Codes"->"Salaried" +
                             "Number of Employees"->"Humph Departments"->"Codes"->"Salaried" +
                             "Number of Employees"->"TTTT"->"Codes"->"Salaried" ;
         "Salaried Labor" = varSalaryCosts * ("Number of Employees"->"Salaried" / varProdOHLabXXXX) ;
    )The last formula is how the formula was described to me by the business owner. I find it to be much easier to read than something like:
    "Salaried Labor" = ("Salary Costs"->"No Department"->"No Category"->"Salaried" -
                             "Wage Bonus"->"No Department"->"No Category"->"Salaried" -
                             "YYYY Retention Bonus 40%"->"No Department"->"No Category"->"Salaried" -
                             "YYYY 60% Ret Bonus Accrual"->"No Department"->"No Category"->"Salaried") *
                             ("Number of Employees"->"Salaried" /
                             ("Number of Employees"->"ZZZZDepartments"->"Codes"->"Salaried" +           
                             "Number of Employees"->"Blah Departments"->"Codes"->"Salaried" +
                             "Number of Employees"->"Humph Departments"->"Codes"->"Salaried" +     
                             "Number of Employees"->"TTTT"->"Codes"->"Salaried")) ;I have used ARRAY in a really-cool-but-alas-not-invented-by-me calc script to do currency conversion in Planning better than Planning does currency conversion. (How's that for a run-on sentence?) It is one of the six blog posts I am working on and I will finish it soon, I hope. I am sort of in thrash mode right now. It does have its uses and I'll try to remember to update this thread when I'm done.
    Regards,
    Cameron Lackpour

  • Recently I erased an iPhone 3 so that it could be passed on and used by someone else, using the erase all content and settings feature. This has killed my iPhone and it is now stuck on the Apple logo. I have tried a restore in iTunes but recovery fails.

    Recently I erased an iPhone 3 so that it could be passed on and used by someone else, using the erase all content and settings feature. This has killed my iPhone and it is now stuck on the Apple logo. I have tried a restore in iTunes but recovery fails. This is not a jailbroken iPhone. Anyone have any suggestions on how to proceed?

    If you haven't already tried, see if you can force it into recovery mode to restore it:
    http://support.apple.com/kb/ht1808.  If that doesn't work, the last thing you can try is to put it in DFU mode to restore it: https://discussions.apple.com/thread/2648467?threadID=2648467&tstart=0.

  • I cannot backup because no more storage is displayed when the storage statistics shows Total Storage 5GB and Available Storage 5GB - basically i haven't used any memory but i cannot backup! please help

    i cannot backup my iphone4s because no more storage is displayed when the storage statistics shows Total Storage 5GB and Available Storage 5GB - basically i haven't used any memory but i cannot backup! please help. i am only trying to back up my notes and contacts. that's it. and i don't think it will use up 5GB

    On your iPhone, go to Settings>iCloud>Storage & Backup>Manage Storage.  There you should be able to see how much of your used storage is allocated to different things (ex., iphone backup, ipad backup, mail).  From there you should be able to figure out what is going on.

  • Hello. I have an iphone5 and I use it for a hotspot for mylaptop and printer. Does any one know a device that will extend its range? I have tried a Netgear and Belkin range extenders without any luck. Thank you!

    Hello. I have an iphone5 and I use it for a hotspot for mylaptop and printer. Does any one know a device that will extend its range? I have tried a Netgear and Belkin range extenders without any luck. The Belkin was closest to working. IT could find my iphone but when it create a new network, both the laptop and printer could not find the new extended network. Thank you!

    Hi - you can do what you want to do with AirPlay from your iPhone - but unfortunately it is not as easy as the people in the Apple store told you - your first problem is that you have a non Apple router - you cannot extend a non Apple router wirelessly with the Express - you can only join the network and connect an ethernet device to it - you can however connect via ethernet and have it create a wireless network of its' own - you can set this up from your iPhone or the XP - but this is a complicated setup and would involve many different discussion areas of this forum - therefore I would suggest that you use your 90 days of support and consult directly with Apple to do this - go to this link - http://www.apple.com/support/contact/

  • Passing values to an internal table and use it with the table painter

    Hi,
    I have seen this topic here before but the answers didn't help me. Maybe I,m doing something wrong.
    The problem is that I defined the following structure on the |Types| tab of the |Global Definitions| section:
    TYPES: BEGIN OF DETAILS,
           EBELP  TYPE EKPO-EBELP,
           BSMNG  TYPE EBAN-BSMNG,
           LFDAT  TYPE RM06P-LFDAT,
    END OF DETAILS.
    Then defined the following definition on the |Global Data| section:
    WA_DETAILS TYPE STANDARD TABLE OF DETAILS WITH HEADER LINE
    The problem is that when I try to assign a value to one of the fields in the program code like this:
    LOOP AT WA_EKPO.
         WA_DETAILS-EBELP = WA_EKPO-EBELP.
         WA_DETAILS-EMATN = WA_EKPO-EMATN.
         MODIFY WA_DETAILS.
    ENDLOOP.
    gives me the following error:
    "WA_DETAILS" is not an internal table -the "OCCURS n" specification is missing.
    Then if I add the "OCCURS 10" to the definition of the Global Data the error "OCCURS 10" is not expected.
    How can I define, assign values and use as a parameter an internal table defined with types for use it with the table painter?

    Hi,
    if it is one record in wa_details. you can directly write as follows..
    REPORT  ZCR_TEST1                               .
    TYPES: BEGIN OF details,
              ebelp TYPE ekpo-ebelp,
              bsmng TYPE eban-bsmng,
              lfdat TYPE rm06p-lfdat,
              ematn TYPE ekpo-ematn,
           END OF details.
    DATA: wa_details TYPE STANDARD TABLE OF details WITH HEADER LINE,
          wa_ekpo    TYPE STANDARD TABLE OF details WITH HEADER LINE.
    wa_details-ebelp = '1'.
    append wa_details.
    wa_ekpo-ebelp = '3'.
    append wa_ekpo.
    LOOP AT wa_ekpo.
      wa_ekpo-ebelp = wa_details-ebelp.
      wa_ekpo-ematn = wa_details-ematn.
      modify wa_ekpo.
    endloop.
    Normally it wont be one record, so u need to put <b>read statement with key</b> in LOOP and ENDLOOP.
    Regards,
    Sriram

  • Basics, settings and using iPod

    I have a 2G iPod Nano 2nd Gen. I have never registered it with my iTunes.
    I have been fine in manually adding music to my iPod and using making recording with Macalley iVoice 3. It froze on me twice using the iVoice but the recordings were just fine. Twice I have tried to install an eBook on the iPod. The first could never finish (I don't remember what it was, a long time ago). Now, loaded the Merriam-Webster dictionary. It finished but at the end It said there was an error. It then made the iPod unable to shut down. I had to reset twice before it was back to normal and the dictionary is now there. it seems all intact, except for the "click for cover page" menu. It does nothing when I click on it.
    So, what's the pros and cons of how I've set up (lack of) my iPod vs. doing it the way it's recommended?
    Oh, I haven't set up my Mac Mini core2 yet. Can I use the iPod on both? I may need to copy notes, audiobooks, eBooks... from both systems and maybe back and forth. would be nice to do the same with music too.
    iPod is current on updates, iTunes is not (v7.5), MacPro is 1 update behind and OS is 10.4.11, Mini is 10.5 and will do all updates when i have time to set it up.

    I also received an 8G 3rd Generation nano & cannot get it to work on my itunes. I already had itunes on my computer but it is not connected to any old ipods. I updated it & when I plugged it in, the License agreement came up. I clicked "I agree..." and then hit save and saved it, but then I went to continue with whatever is next and my screen does not allow me to see anything past a certain point. I've tried EVERYTHING & it just won't work, there must be a 'Next' button or something but I can't get to it. Help!!

  • Direct Print smartform to printer via  JOB_OPEN function and using SUBMIT

    Hello,
    I can not able to printout from forms . I can able to get spool number but it is not printing directly to printer (printer Output should come automatic). I am getting error message in SP02 as Status ->Waiting    when i check is showing as "Frontend unavailable".
    please find sample code below to test same:
    REPORT  ZTEST_1                                  .
    constants : wc_x type c value 'X'.
    DATA: wv_val(1) TYPE c,
          wv_pripar TYPE pri_params,
          wv_arcpar TYPE arc_params,
          wv_lay   TYPE pri_params-paart value 'DINA4',
          wv_lines TYPE pri_params-linct,
          wv_rows  TYPE pri_params-linsz.
    data: wv_jobname like tbtcjob-jobname.
    data: wv_jobcount like tbtcjob-jobcount,
          wv_host like msxxlist-host.
    data: begin of ws_starttime.
            include structure tbtcstrt.
    data: end of ws_starttime.
    data: wv_starttimeimmediate like btch0000-char1 value 'X',
          wv_flag(1),
          WV_DO_PRINT type i.
    concatenate sy-tcode+0(4) ' ' 'sample test - print'
    into wv_jobname.
    *Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = 'X'
                jobname          = wv_jobname
                sdlstrtdt        = sy-datum
                sdlstrttm        = sy-uzeit
           importing
                jobcount         = wv_jobcount
      if sy-subrc eq 0.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
                in_archive_parameters  = wv_arcpar
                in_parameters          = wv_pripar
                LIST_NAME           = 'JOB NAME'
                LIST_TEXT             = 'test_text'
                RECEIVER             = sy-uname
                IMMEDIATELY           = wc_x
                RELEASE               = wc_x
                USER                 = sy-uname
                layout                 = wv_lay
                no_dialog              = wc_x
           IMPORTING
                out_archive_parameters = wv_arcpar
                out_parameters         = wv_pripar
                valid                  = wv_val
    break-point.
    wv_pripar-PRSAP = space.
    wv_pripar-PRIOT = 1.
    wv_pripar-prrec = sy-uname.
    if not wv_val is initial.
    *call external program and pass data
    submit SF_EXAMPLE_01
          USER sy-uname
         via job wv_jobname
         number wv_jobcount
      TO SAP-SPOOL
    SPOOL PARAMETERS wv_pripar
    ARCHIVE PARAMETERS wv_arcpar
    WITHOUT SPOOL DYNPRO
    AND RETURN.
    endif.
    *Close job
      ws_starttime-sdlstrtdt = sy-datum .
      ws_starttime-sdlstrttm = sy-UZEIT.
        ws_starttime-IMSTRTPOS = WC_X .
      call function 'JOB_CLOSE'
           exporting
                event_id             = ws_starttime-eventid
                event_param          = ws_starttime-eventparm
                EVENT_PERIODIC       = space
                jobcount             = wv_jobcount
                jobname              = wv_jobname
                laststrtdt           = ws_starttime-laststrtdt
                laststrttm           = ws_starttime-laststrttm
                prddays              = 0                       "set to 0 not repeat
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = ws_starttime-sdlstrtdt
                sdlstrttm            = ws_starttime-sdlstrttm
                strtimmed            = wv_starttimeimmediate
      endif.

    Hi,
    As far as printing to devices not all devices support Bluetooth. Many devices support Bonjour protocal, IPP. The main print port is 9100. Additionally you can see what IO protocols are supported on a product by looking at the EWS (Embedded WebServer) there should be a networking page with that information.  Port 9100 is your basic print port and different devices will support different formats (PDF, JPEG, PCL5, PCL6). If there is an API you can find (i am not familiar with J2ME availible calls, then you can use those and send the data to port 9100. Again that is the basic path most printers will accept. not all devices support bonjour not all device support bluetooth etc... Hope that helps and good luck.
    I am an HP Employee.

  • PCI bus and memory ranges in Device Manager.

    Hello,
    I looked in device manager on my netbook that has no dedicated graphics card (so no dedicated VRAM) and uses shared system RAM as
    it’s video buffer, the following memory ranges have been assigned to the on board card -
    If I then change the view in device manager to ‘Resources by type’, Windows shows the following memory ranges to be on the PCI bus
    Basically all the memory ranges that have been assigned to the card are shown to be also on the PCI bus. I would understand this with
    a dedicated graphics card where data needs to be forwarded onto the PCI bus but I know my netbook is using system memory as the frame buffer which then I assume the card reads from there.
    Do you know why these addresses are shown to be on the PCI bus, is it just because the card is a PCI device so it’s easier for Windows
    just to display them as if they were on that bus, and anything written to these address will still go into system memory?
    I know it’s a bit of a random question but I’ve been trying to find an answer online and can’t seem to find anything.
    Any help would be appreciated,
    Thanks.

    Hi,
    For your question: Do you know why these addresses are shown to be on the PCI bus, is it just because the card is a PCI device so it’s easier
    for Windows just to display them as if they were on that bus, and anything written to these address will still go into system memory?
    Yes.
    You can check the hardware memory usage via Resource Monitor.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Calling a VI in a subpanel with parameters inside an event structure and using an abort button

    Hi all,
    I have a control panel with a tab control and two tabs have a sub panel in them.  At runtime I load the VIs I want in to the sub panels.  In the control panel event structure I want to start each of the VIs and monitor the execution state so I can abort the VI while it is running.  One method I use can run the VI and the abort event will work (see example).  The second method I use does not and this is what I want to do!  I have many inputs to the VI I want to pass so placing the VI in the event blocks everything else and it has to wait until the VI has completed, so I cannot monitor the execution state.
    I have attached an example of what I want to do.
    Any help appreciated.
    Martin
    Solved!
    Go to Solution.
    Attachments:
    SubPanel.lvlib ‏2 KB

    Hello,
    You can do this with queues. 
    The main vi and subpanel vi's should be based on the producer/consumer (events) and you handle the front panel events accordingly in the respective vi's. 
    Name the queues in obtain queue , for example the Main being MainQ, subpanels SubPanel1Q, SubPanel2Q. When you start the application, initialise the main vi and also run both of the subpanels (just to make sure that the queues are first obtained by themselves). Then you can use obtain queues to do inter vi communication.
    For example if you need to send data from main to subpanel1, use obtain queue and use the name SubPanel1Q, pass the required data & command and voila. Subpanel1 vi will receive your message. You can do this anyway you want. Hope this helps.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

Maybe you are looking for