Read Sequentially and Calculate

Hello,
I am running into the following situation I am trying to handle in Crystal Reports and am looking for input...
Datasource1:  orders
Datasource2:  unit of measure conversion formulas
In Datasource1 the order quantities are in a specific unit of measure... ie CASE packages (boxes)
The user will request (in a parameter) to list the order quantites in EACH unit of measure
In Datasource2 we may find the following conversion formulas...
     PACK  to EACH, multiply PACK qty by 2 to get EACH value
     CASE to PACK, multiply CASE qty by 30 to get PACK value
In some situations, there is not a direct formula to convert CASE on the order to EACH as the user requested.
I have the report created to pull from Datasource1 and Datasource2 in one SQL Command (in Crystal)
and it works if there is a direct conversion formula found in Datasource2.
If the Conversion quantity is blank on the report, no formula conversion found, I need to read through the conversion formulas
that are there to come up with a value to convert from CASE to EACH.
I created a subreport within the main report that does list out all of the conversion formulas found for the item, but
need to know how to pass Quantity value into the subreport and pass Quantity value back out...  and also need to
keep track of conversion formula records found in the subreport to see if I can come up with a conversion value to pass back.
can the above be done ?
if not, is there a better way to do this ?
Thanks

What you're trying to do isn't going to work directly in CR. You'll need to do it in the SQL.
As it stands, you may be able to write a WHILE loop to bring everything together but it would be unnecessarily complex.
Your best option(s) is to either 1) finish filling out all of the possible permutations in table 2 or 2) redesign table 2 so that each unit of measure is expressed as a multiple of the smallest possible unit.
example:
Unit________ Quantity
Each_______ 1
Pack_______ 2
Case_______60
so...
Pack to Each  = 2 / 1 = 2
Case to Pack = 60 / 2 = 30
Case to Each = 60 / 1 = 60
Each to Pack = 1 / 2= 0.5
Obviously 2) is the better choice but if you aren't in a position to alter the DDL of table 2, option 1) will work, it will just take more effort.
HTH,
Jason

Similar Messages

  • Ipad form ....help needed please.  Clear form after email as read only and sequential numbering

    Hi
    i am a complete novice at this however this is what I want to achieve.
    i Have a paper duplicate report sheet that I want to get electronically, I want to be able to add sequential numbers to each report and be able to email the report to the client from a email field in the form
    so far I have so I have created the pdf form, I have a button that runs a JavaScript that will hide the submit button and then send to the clients email and to bcc myself so I have a copy of the report also. This has been tested and works
    i Am struggling with sequential numbering and once the form has been emailed it's un-ditable as the JavaScript has converted it to read only for emailing which is good as it can't be edited. But Is there a way on my submit button to email the report as read only and then clear all form fields in the report ready for filling with the next sequential number?
    I Have had a good look sound for a resolution to this but am struggling
    many thanks in advance for any feedback
    paul

    Hi Paul,
    I presume that you are using the desktop version of Acrobat Pro to author the form.
    I will move this discussion to the PDF Forms forum so that the experts in the forum can answer your question.
    Please note that the Reader/Acrobat DC mobile apps (for iOS, Android, Windows Phone, etc.) have limited JavaScript support.
    JavaScript for Reader Mobile API Reference (iOS)
    You may be able to make the form work as you want in the desktop version of Adobe Reader/Acrobat Reader DC.  However, some functionality (e.g adding a sequence number to each PDF) will not work in the mobile apps due to the limited JavaScript support.  Sorry for the inconvenience.

  • How to test the communication stability and calculate ber using the CVI ?

    Our chief engineer gave me a task yeasterday.He asked me to do software testing and calculate bit error rate that we would know our communication stability.
    However,I have never touched this aspect of knowledge. I have known a bit about CVI and I want to write  bit error rate code using CVI.Thus,I could test the communication stability.
    But I don't know how to analyse and judge the receiving codes whether they are right or wrong.
    We use Modbus communication protocol and receive data via serial port,so I want to save all datas and record the total datas number ,marking as M.
    then,save the eligible datas and record the mumber marking as N. So, bit error rate is (M-N)/M   .
    Whether this is feasible ? Or you have any good idea. Thank you very much.
    unsigned char in_data[100];
    inqlen = GetInQLen (comport);
    for(i=0;i<inqlen;i++)
    in_data[i]=ComRdByte(comport);
     Above is my code that receive all datas and I want to save the array in_data[] data and record the number.
    switch(inqlen)
    case 19:
    crc=usMBCRC16(in_data,inqlen );
    if((in_data[1] == 0x03)&&(crc==0)&&(in_data[0]==device_addr))
     Above is the condition judgement that receive eligible datas which number marks as N.
    I know there is a precondition that I filter out all the wrong data . However ,I don't know any good idea. I will appreciate if anyone could help me.
    Thank you very much.
    Best regards.
    xiepei
    I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.
    Solved!
    Go to Solution.

    Hi xiepei,
    since you are using modbus, a simple error checking is implicit in the protocol and is the comparison between returned checksum and the calculated one on the received message: checksum errors, if any, are an effect of communications errors (you should have at least 2 bits changed and on particular patterns to have the checksum be calculated correctly!). You won't be able to calculate BER on them, but you can calculate PER (Packet Error Rate).
    Another flag for communication errors, on the other direction, is to intercept error messages from the device: if it fully implements modbus protocol, it should return some warning in case of error (I seem to remember that in some cases it returns the reveived message with some error bits added: please check in modbus documentation).
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to count and calculate total percentage for field

    hi all,
    i have two tables as follow:
    i have a inner join as follow :
    SELECT distinct dbo.Motor_Story.Name, dbo.Goods.kala, dbo.Goods.type, dbo.Goods.id_story FROM 
    dbo.Goods INNER JOIN dbo.Motor_Story ON dbo.Goods.id_story = dbo.Motor_Story.Id
    I have the following data are entered
    in my database,
    type
    kala
    no
    Panaconic                       
    Monitor
    1
    Sony                            
    Telvision
    2
    Samsung                         
    Phone
    3
    Vaio                            
    Computer
    4
    Panaconic                       
    Monitor
    5
    Sony                            
    Telvision
    6
    Panaconic                       
    Phone
    7
    Panaconic                       
    Printer
    8
    Sony                            
    Computer
    9
    Panaconic                       
    Monitor
    10
    Sony                            
    Telvision
    11
    Samsung                         
    Phone
    12
    Panaconic                       
    Printer
    13
    i want create a view so that, count 'dbo.Goods.type' and calculate total percentage of ' dbo.Goods.type, than other products based on 'dbo.Goods.kala'.
    pls hlp me.
    best regards.

    Hi,
    Welcome to MSDN.
    I am afraid this is not the proper forum for this issue, since it is not a specific vb.net issue.
    I would suggest you consider posting this issue in sql forum for more dedicated support.
    http://social.msdn.microsoft.com/Forums/en-US/home?category=sqlserver
    Thanks for your understanding.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I downloaded an upgrade to my adobe reader today, and ever since my search engine has switched to yahoo and wont change back to google. I have a macbook pro, help please? Does anyone know how I can change this back? I have tried through my settings but it

    I downloaded an upgrade to my adobe reader today, and ever since my search engine has switched to yahoo and wont change back to google. I have a macbook pro, help please? Does anyone know how I can change this back? I have tried through my settings but it doesnt work

    Hi Timia,
    If you are using Safari as a web browser :-
    Open Safari, go to Safari menu > Preferences > General, and put Google as the homepage. Then, choose Google as your default search engine.
    If you are using Google Chrome as the web browser :-
      Open Google Chrome.
      In the top right corner of the page, click the Chrome menu Chrome menu > Settings.
      In the "Search" section, select Google from the drop-down menu.
    Let me know if you still experience any issue.
    Regards,
    Aadesh

  • Hi.  I have a Dell PC running Windows 7 64 bit.  I have the latest version of Adobe Reader,  It worked yesterday.  Today I have job training to do that is due tomorrow morning and I can't open PDF files.  I have to open a guide and read it and take a test

    Hi.  I have a Dell PC running Windows 7 64 bit.  I have the latest version of Adobe Reader,  It worked yesterday.  Today I have job training to do that is due tomorrow morning and I can't open PDF files.  I have to open a guide and read it and take a test tomorrow.  I have deleted and reinstalled the application.  I have rebooted.  I have made sure my PDF's are associated with the program.  Every PDF on my computer won't open and I get the same error message.  It simply says Attempt to access invalid address.  How can I fix this?  Thanks.

    Hi Don,
    I have seen this issue fixed for some users by modifying the following registry key:
    The key is "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" MoveImages
    Set the key to 1 instead of 0 then reboot the machine.
    In case you still face the issue try the following registry key change:
    The only thing you have to do is rename the following key at the REGEDIT, and everything will be fine !!
    BEFORE:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\iexplore.exe
    AFTER:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\iexplore.old
    Note: Please take a backup of the registry before attempting this change.
    Regards,
    Rave

  • Why can't I connect to the Internet on my Adobe Reader? And why do websites tell me I don't have Adobe downloaded when I have an updated version on my computer? It is an IPad,does that affect it?

    Why can't I connect to the Internet on my Adobe Reader? And why do websites tell me I don't have Adobe downloaded when I have an updated version on my computer? It is an IPad,does that affect it?

    Also, download and open the free Adobe Reader app. Then read the Help section to figure out how to use it.

  • I have iphone 4s and just bought an ebook for ibook, trouble is the font is so tiny I can't read it and the font sizer is not working? Please help!

    Hi, I have the  iphone 4s and just bought an ebook for ibook, trouble is the font is so tiny I can't read it and the font sizer is not working? Please help!

    Hello Glittergirl68,
    Thank you for using Apple Support Communities.
    It sounds like the function to reseize the Font in an iBook is not functioning properly.
    I recommend a few things here. First close all the apps that are running in the background:
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    From: iOS: Force an app to close
              http://support.apple.com/kb/ht5137
    When you have done that, restart the phone, and try again.
    If the issue persists, I would follow these steps from the article:
    iOS: Troubleshooting apps purchased from the App Store
    http://support.apple.com/kb/TS1702
    2. Check for app updates
    You can setup apps to update automatically in Settings > iTunes & App Store, but make sure that your apps are up to date:
    Open the App Store and tap Updates. If updates are available, tap Update All.
    If  prompted, enter your iTunes Store account information. App Store will then download and install the app updates.
    Note: Some apps may require a Wi-Fi connection to update.
    3. Install another app from the App Store
    If none of your user-installed apps will launch, there could be an issue with Apple ID authorization. Download and install an app that isn't already installed on your device to reset this information. You can also remove an app from your iOS device and download it again from the App Store or sync the app from your computer.Note: If you have installed apps using multiple Apple ID accounts, you may need to perform this step for each account.
    4. Restart the app
    If the issue affects only a single app, try closing just that app.
    5. Restart your device
    Turn the device off and on.
    6. Reinstall the affected app
    Remove the app from your device and reinstall it:
    Tap and hold any app icon on the Home Screen until the icons start to wiggle and show a small "x" in the top-right corner of the app.
    Tap the "x" in the corner of the app you want to delete.
    Tap Delete to remove the app and all of its data from your device.
    Press the Home button.
    Go to the App Store.
    Search for the app and then download it again.
    All the very best,
    Sterling

  • How to open and read pdf and micrsoft word (.doc) files or documents

    My problem is how to use my BB 9800 software version 6.0.0.546 to read/view pdf files and microsoft office documents. I have also bought documents to go from online and have installed it on my phone, but whenever i try to open it I receive a message that it is incompactible. Any help will be greatly appreciated.

    Hi, Sammy.
    Why not install a 3rd party PDF reader and Word Doc reader to help open and read pdf and micrsoft word (.doc) files or documents? You can google it and select one whose way of processing is simple and fast to help you with the related converting work.  It will be better if it is totally manual and can be customized by users according to our own favors. Remember to check its free trial package first if possible. I hope you success. Good luck.
    Best regards,
    Arron

  • I have downloaded several books into ibooks.  Started reading one and closed it when I was done reading for the day.  Now I want to access other books and when I open ibooks it goes directly to that first book.  What can I do? Help please.

    I have downloaded several books into ibooks.  Started reading one and closed it when I was done reading for the day.  Now I want to access other books and when I open ibooks it goes directly to that first book.  It does not give me the shelf to choose what book I want to read - goes directly to the first book. What can I do? Help please.

    There should be a Library button on the top left. If not ap the middle of the screen to get it to appear.

  • How to read FLAC and Ogg Vorbis

    Hi,
    actually it's not possible to read my flac files from iTunes, so I can't directly transfer these files to my Ipod. I'd wish my ipod classic to read natively flac format but I can't even recode to alac directly with iTunes.
    Is there any other app to encode as alac which can read flac and transfer files to my ipod?

    jonatan72 wrote:
    Hi,
    actually it's not possible to read my flac files from iTunes, so I can't directly transfer these files to my Ipod.
    You are correct, iTunes cannot play or convert FLAC. There are plugins (Xiph) that allow iTunes to play FLAC, but they still will not transfer to the iPod.
    Is there any other app to encode as alac which can read flac
    For converting FLAC to ALAC, you can use dbPoweramp. If you wish to convert FLAC to AAC or MP3, there are several tools that can do so, such as Switch.
    Add the converted files to your iTunes library, and then sync the iPod normally.

  • How to read, write and save a file?

    Hello everybody,
    I have a question about reading , writing and save something into a file (etc text file)
    For example: I want to create a file of football in which there are many key words as: "football", "touch down", "quarterback", "ball", "linebacker", "coach", "player"...
    Now i want to open to read, write one more word "head" ( synonym with "coach") and store it for using next time. How could i do that?
    Could anybody help me about that?
    Thank you very much in advance.
    still_learn

    take a look in the API about FileInputStream and FileOutputStream

  • How to read the and Write the PDF file give me the solution

    Hi all,
    How to read the and Write the PDF file give me the solution
    My coding is
    import java.io.File;
    import com.asprise.util.pdf.PDFImageWriter;
    import com.asprise.util.pdf.PDFReader;
    import java.io.*;
    import java.io.FileOutputStream;
    public class example {
    // public example() {
         public static void main(String a[])
              try
              PDFReader reader = new PDFReader(new File("C:\\AsprisePDF-DevGuide.pdf"));
                   reader.open(); // open the file.
                   int pages = reader.getNumberOfPages();
                   for(int i=0; i < pages; i++) {
                   String text = reader.extractTextFromPage(i);
                   System.out.println("Page " + i + ": " + text);
    // perform other operations on pages.
    PDFImageWriter writer = new PDFImageWriter(new FileOutputStream("c:\\new11.pdf"));
                   writer.open();
                   writer.addImage("C:\\sam.doc");
                   writer.close();
                   System.out.println("DONE.");
    reader.close();
              catch(Exception e){System.out.println("error:"+e);
              e.printStackTrace();
    I get the pdf content then it returns the string value but ther is no option to write the string to PDF, and we only add a image file to PDF,but i want to know how to wrote the string value to PDF file,
    Please give response immtly
    i am waiting for your reply.
    thanks,
    Suresh.G

    I have some question flow
    How library to use this code.
    I try runing but have not libary.
    Please send me it'library
    Thank you very much!

  • Running a mid 2009 iMac on 10.7.5, 3 gb memory, 320 gb hd.    Suddenly the computer stoped reading DVDs and the only time I can read a CD is if I restart.  Quite often when I insert a CD it gets stuck and I cannot get it out until I restart and it shows u

    Running a mid 2009 iMac on 10.7.5, 3 gb memory, 320 gb hd. 
    Suddenly the computer stoped reading DVDs and the only time I can read a CD is if I restart.  Quite often when I insert a CD it gets stuck and I cannot get it out until I restart and it shows up on the desktop where I can then eject it.
    I have checked and double checked the finder prefs and all looks normal showing a check mark on CDs,DVDs etc. (the ones I want to show up on the desktop)
    I have reset the PEAM, repaired permissions with both the disk utility on the computer and the disk utility when I start up in the Recovery Disk.  I did notice that sometimes the permission repeat the same correction several times before it moves on, and sometimes it doesn’t. I have Windows installed on a partition but I keep it unmounted until it is needed for my wife’s work.  The dock seems to be just fine and all the apps seems to run just fine.  When I insert a photo CD iPhoto does not open but when I insert a music CD iTunes does open. 
    Also, most every time I open iPhoto it takes a long time(sometimes as long as 2 minutes) for it to load.
    Sometimes my Mail (Mail 5.3) does not post new mail but most of the time it does. 
    Once and a while it seems like the computer slows way down but then it seems ok ten minutes later.
    All  of these ‘things’ seemed to have happen suddenly and I have not downloaded anything from the internet in some time.
    Of course the warranty and extended warranty are both no longer in effect having had this computer for more than three years.
    I am running Java and Adobe Player because some of the sites I go to a lot require both.

    I believe that insufficient RAM may be the source of some of your problems. If you have a RAM of somewhere 4 to 8GB, you will experience smoother computing. 3GB doesn't seem right, so you might want to learn more by going to this site:
    http://www.crucial.com/store/drammemory.aspx
    I don't know what know what's happening with your optical drive, but it seems you use your drive quite a bit. In that case, look into a lens cleaner for your machine. It's inexpensive, works quite well.
    I hope you'll post here with your results!

  • How can I synchronize my iPhoto events? my iTunes doesn't read them and with the app Images in the iPad I can only find Photos, Albums, Faces and Places, not Events.

    How can I synchronize my iPhoto events? my iTunes doesn't read them and with the app Images in the iPad I can only find Photos, Albums, Faces and Places, not Events.

    I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) .  I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
    Haha!  I should have paid attention and read between the lines!  My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do!  I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy.  I am now going through Photos and making Albums (of what used to be in my Events)  ... maybe I'll get this finished before they do another non user friendly update!

Maybe you are looking for

  • How do you transfer Creative Cloud (Light Room & Photo Shop) from your old Desk top to a new desk top

    I have just got a new desk top and I am trying to work out how to get The creative Cloud programs I use (light Room and Photo Shop) off my old Desk top and onto the new desktop. Does any one know how to do this or have already done it, or do you have

  • Mapping Logical Systems with ECC 5.0/6.0 for WD

    Hi there, did anyone have a good documentation to implement this solution, to connect WebDynpro, especially BP for ECC5.0 and 6.0, to two different Backendsystems? I´m searching the way, to configure the logical target system name in the WD Content A

  • Can't print from Mac to Windows printer

    I have a wireless network of 3 computers and a printer. One is a desktop running XP with the printer attached. The other is a laptop with XP. And the last is a MacBook with 10.4.11. I can print from both computers running XP but I can't print from th

  • Z1 4.4.2 14.3.A.0.681 firmware KitKat Rolling Officially

    Android 4.4.2 KitKat Rolling for Xperia Z1, Z Ultra, Z1 Compact – Sony confirms now. Sony has also mentioned that they will be rolling android 4.4.2 KitKat for Xperia Z, Xperia ZL, Xperia Tablet Z and Xperia ZR in mid Q2 2014 and Xperia T2 Ultra / Du

  • How to run a program in java by double clicking on it?

    hi, simple question for you all: normally when i do java programs i am used to compiling it and running it via JBuilder. However, i saw a java program that had been installed on a desktop and the user double clicked it and it came straight up. how ca