Padding a field out with spaces to s set length

Post Author: danish
CA Forum: Formula
Hi,
I'm new at using Crystal Reports.
I am trying to pad a string out to a set length of 50. The initial string is of variable size depending on the data in the field.
Can anyone tell me how I can do this using a while do loop.
ie while field length < 50 add a space to field until field length = 50.

Post Author: danish
CA Forum: Formula
Thanks for that. Managed to work out how to do with while do but this will be helpful for future.

Similar Messages

  • Field names with spaces in target file using fcc

    Hello Friends,
    My target structure fields:
    MT_Target
    ItemNo, ItemName, ItemQuantity, AmountValue, TotalAmount
    My requirement here is - In the target file - these fields should be generated with space. Shown as below:
    Item No, Item Name, Item Quantity, Amount Value, Total Amount
    How can i achieve this.
    Thanx
    S.

    if i understood u correctly u want to have a header line in ut target file same as that ur field names but with a space in between??
    if yes  the use :
    NameA.addHeaderLine=3
    NameA.headerLine =Item No, Item Name, Item Quantity, Amount Value, Total Amount
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

  • Pages are not printing out correctly. I have tried to fix in the options, with no luck. It prints out with spaces in between the letters.

    When I go to print any page from an email, webpage, pdf file..the pages print out very wide fonts to the point where it is unreadable. I have tried to fix in the options with no luck. I can provide you with visuals if you need me to.

    Thanks very much! It works! The print / review print - print works like it is supposed to. The print is corrected and works great. Thanks again.

  • Printing from inbox the print comes out with spaces between each word..

    When I go to the internet through firefox inbox... and want to print a page off from an internet article .. it prints like this..
    F r o m : J a m i e M c G a r r y
    It will not print like this From: Jamie McGarry

    Caused by a Bug in 4.0b12 that was fixed in the Minefield nightly's yesterday, and will be fixed in the next beta or the Release Candidate ''(if b12 is the last beta as planned)''.

  • SSRS export to PDF errors out with one specific data set

    I have a SSRS report that fails to export to a PDF file with a particular set of data.  The PDF export works great with every other set of data  that we have run through it. The suspect report/data can be viewed fine and exported to other formats
    without issues.
    It almost appears that the PDF export has issues with how the data falls on the page.  If I change the top/bottom margin size, increase the length of the report by adding whitespace or increase/decrease the size of the header/footer, the report will
    export to PDF without any issues.
    We are currently using SQL Server 2008, SP3 CU12.
    This is the error log that occurs for the export:
    reportrendering!ReportServer_0-19!9e4!12/05/2014-09:05:31:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report., ;
     Info: Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering
    of the report. ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.ReportingServices.Rendering.HPBProcessing.Paragraph.GetRichTextParagraph()
       at Microsoft.ReportingServices.Rendering.HPBProcessing.TextBox.GetRichTextBox()
       at Microsoft.ReportingServices.Rendering.HPBProcessing.TextBox.AddToPage(RPLWriter rplWriter, PageContext pageContext, Double pageLeft, Double pageTop, Double pageRight, Double pageBottom, RepeatState repeatState)
       at Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.RowInfo.AddToPageContent(ScalableList`1 columnInfo, Int32& colsOnPage, Boolean isLTR, Boolean pinnedToParentCell, RPLWriter rplWriter, PageContext pageContext, Double pageLeft, Double
    pageTop, Double pageRight, Double pageBottom, RepeatState repeatState)
       at Microsoft.ReportingServices.Rendering.HPBProcessing.Tablix.AddToPage(RPLWriter rplWriter, PageContext pageContext, Double pageLeft, Double pageTop, Double pageRight, Double pageBottom, RepeatState repeatState)
       at Microsoft.ReportingServices.Rendering.HPBProcessing.PageItemContainer.AddToPage(RPLWriter rplWriter, PageContext pageContext, Double pageLeft, Double pageTop, Double pageRight, Double pageBottom, RepeatState repeatState)
       at Microsoft.ReportingServices.Rendering.HPBProcessing.Report.NextPage(RPLWriter rplWriter, Int32 page, Int32 totalPages)
       at Microsoft.ReportingServices.Rendering.HPBProcessing.HPBProcessing.Init(Report report, PaginationSettings pagination, CreateAndRegisterStream createAndRegisterStream, Hashtable& renderProperties)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream
    createAndRegisterStream)
     

    Hi GravityJunky,
    Based on the error message, the object reference is not set to an instance, it is typically caused by one or more of the following reasons:
    There are soft page breaks within empty lists in the report.
    There are hidden groups within the report and you tried to export it to PDF.
    There are text boxes with a width and/or height of zero in the report.
    A text box is either hidden or the NoRows property is set to true.
    A text box spans table cells where some cells have a collection of null values.
    The report has static columns and/or rows and, in the Visibility properties, Hidden is set to true.
    The report has static columns and/or rows and there are grand totals in the report.
    The report has static column headings and, in the Visibility properties, Hidden is set to true.
    The matrix report has multiple columns and rows and, in the Visibility properties, Hidden is set to true and you tried to export to PDF.
    To troubleshoot the problem, please refer to the following steps:
    Review the specific error contained within the message and then, depending on the message, review your report.
    If the problem is related to soft page break issues, try increasing the page height, reducing the first row height, or reducing the number of header rows.
    If the problem is related to errors when rounding the image size up or down, try slightly increasing the page header height so that it is different than the image height, or try changing the image size to fit better.
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

  • Padding String with spaces -tried known methods but code not working!

    I am trying to figure out an easy way to pad a string with spaces at the end. The way that definitely works is a for loop where string = string + " "; until string is the length that I need. However, for several dozen strings this is a lot of unnecessary overhead. I've done some research and tried a few different things - yet none of them seem to actually pad the string.
    import org.apache.commons.lang.StringUtils;
    public class Test
         public static void main(String[] args)
              String one = "1234";
                    //print string at current lenght
              System.out.println(one+"*");
                    //try padding using String.format (in padRight method below)
              one = padRight(one,(8-one.length()));
              System.out.println(one+"*");
                    one="1234";
                    //try padding using StringUtils
              String tmp = StringUtils.rightPad(one, (8-one.length()));
              System.out.println(tmp+"*");
         private static String padRight(String s, int n)
              return String.format("%1$-" + n + "s", s);
    }I've researched and these are the two most common methods people are suggesting. I am using java 1.5 so the String.format should work.. however, when I run it (I use JBuilder) the output is always "1234*".... after I try to pad it the output should be "1234 *" (with 4 spaces between the 4 and *) . Any suggestions is greatly appreciated! Thanks in advance.

    Wow, I completely botched that... uncle_alice, thank you for clearing that up for me.
    pbrockway2 - thank you, I actually did peruse the Formatter documentation - I would never post without researching something first... but I must have read it with one eye shut because walked away with the impression that I needed to submit the difference. I obviously misunderstood the documentation.
    Thanks!

  • Format a number, pad with spaces

    I want a simple way to format a number into a String, but have it padded with spaces. My code started like this:
    DecimalFormat myFormatter = new DecimalFormat("###.00");
    String output = myFormatter.format(12.5);
    The output is '12.50' when I want ' 12.50' (leading space). There's got to be an easy way to do this!
    Thanks for your help

    What you probably wanted to do was print some numbers in a column (of JTextArea's, for example) so that the decimal points line up.
    I wasted some more time and came up with the following:  String formattedNumber = numberPad(number, "###.00E0");
      static String numberPad(double number, String format) {
        int desiredDecimalPosition = format.indexOf('.');
        DecimalFormat numFormat = new DecimalFormat(format);
        String formattedNum = numFormat.format(Math.abs(number));
        formattedNum = formattedNum.replace('E', 'e');
        int exponentPosition = formattedNum.indexOf('e');
        if (exponentPosition < 0)
          exponentPosition = formattedNum.length();
        formattedNum = formattedNum.replaceFirst("e0", "");
        int decimalPosition = formattedNum.indexOf('.');
        formattedNum = (number > 0 ? " " : "-") + formattedNum;;
        if (decimalPosition < 0)
          decimalPosition = exponentPosition;
        int padding = desiredDecimalPosition - decimalPosition;
        if (padding > 0)
          formattedNum = "        ".substring(8 - padding) + formattedNum;
        return formattedNum;
      }Now it turns out that- despite the fact that I've told DecimalFormat to format precisely 2 digits to the right of the decimal, it sometimes randomly gives me 3, and (less often) 1!
    All this trouble just to try save 16kB of Henrik Bengtsson's sprintf in my jar file...

  • Wedding photography running out of space. Need help with thousands of photos, and workflow

    So my studio does wedding photography. Me and my partner both take photos.  We have about 30,000 photos just from the last 2 years.  We are running out of space big time. We both have 1 terabyte magnetic hard drives in our computers. I have about 80gb left and she has about 120gb left. Needless to say, since I myself take about 50gb of photos per wedding, I'm not going to last long. We use lightroom.
    So far I have managed to backup everything on an external 2TB hard drive for both of us. I save both RAW and Jpegs to it. I also have everything backed up on an online server.  So here's my first issue.  What I've been doing, is for the previous year (completed weddings) I delete all the RAWs from the computers. I leave the JPEG's on the computer incase I need them quickly. I keep all the RAWS on the external hard drives and online.  But even doing this, deleting the RAWs from completed weddings off the internal hard drives, I'm still almost out of space. My computer is so slow because of this even though it's a top of the line computer with 6 gigs of triple channel ram. Lightroom runs so very slow and lags so bad.
    So my first question is:  By deleting the raws off of my computer, if I need to go back a few years from now and re-save the raw files or re-edit, will lightroom remember my develop settings or will I have to completely re-edit every photo?  I have been saving a catalog file for each year, and start a new one every year.  I do not use XMP sidecar files I save everything to the lightroom database.  As long as I have the catalog file backed up, am I safe? Or am I doing this wrong? Because if open an old catalog file, it will say all the photos are not found on my computer (obviously).
    My second question is:  I am going to be investing in more hard drives and want to do it right this time around. I want to invest in SSD drives for maximum performance.  Here is what my plan is.  One SSD drive for windows/programs, one SSD drive for lightroom scratch disk, and one 1TB "Velociraptor" 10,000rpm magnetic hard drive for keeping the actual images on.  Is this not right? Am I planning this out wrong?
    Here is our current workflow. I am very welcome to suggestions:
    1) Shoot wedding.
    2) Import RAW files from CF card to computer. It goes in a folder for the client with the images going into different sub folders by category such as "reception" and "ceremony"
    3) Import folder into lightroom4.
    4) Edit photos. I do not use XMP sidecar, I use database.
    5) Export files in JPEG form into the same client folder.
    6) At the end of the year I save the catalog, make a new catalog for the new year. I delete the RAW files off of my hard drive after backing them up on 2TB external hard drive. I leave the jpegs and the client's folder on the computer hard drive.

    My guess is that you are not actually deleting the original raws from your internal hard drives and have lots and lots of crud around that you are not aware off so you should go through your internal drives with a fine-toothed comb. Don't forget to actually empty the trash when you delete! 1TB is more than enough disk space for storing the Lightroom catalog file, previews and some jpegs. 30.000 photos is really not that much. My main catalog  has >50.000 images in it with the raw files all stored on external hard drives. The catalog itself is on my internal 256 GB SSD HD that also houses the previews (so I can use it with the raw files offline) and the operating system as well as a lot of software (photoshop, office, iWorks, Aperture, etc.). It is more than enough space as it still has more than 150 GB free. I automatically back up everything, including the external HD that stores the raw images to separate external HDs stored in different places.

  • In reports, i want to display currency field out put with diff currencies

    Hi all
    in reports, i want to display currency field out put with different type of currencies like 1st record in rupees 2nd record in dolors 3rd record in       
    Euros. for this i should not use any tables and any currency fields and any functional modules. pls give replay urgently.

    Hi swamy,
    so sorry, but you have to use some of the objects you do not want to:
    Currency values in ABAP are stored in currency fields (type CURR). If they are stored in structures or database, every CURR field must be connected to a CUKY field (currency key).
    Displaying data using WRITE statement four output on a list is obsolete technique, you may use the use WRITE with the option CURRENCY c to format according to currency c in table TCURX.
    SAP recommends to use ALV technique. If you use ALV to display structure data, then create a dictionary structure with currency value and currency key. The rest goes automatically.
    Believe me: It is much easier and more reliable.
    Regards,
    Clemens

  • Libproxy.so eat out the last past of my request with space in the name

    Hi,
    I used the following 2 configurations:
    1. Solaris: iPlanet Web Server WebLogic 6.1
    2. W2000: IIS WebLogic 6.1
    Both of the web server just work as a gateway. All static and dynamic pages (images, JavaScript file, CSS file) are served by the WebLogic Server. (This sounds a little bit wierd. So we dropped this kind of configuration already.)
    I configured both the Web server to forward all requests with "*/portal/*" to WebLogic server. It works fine except the requests with space inside. For example:
    http://localhost:8080/portal/abc def.html
    (I encode space to when I type it in browser).
    And I got a 404 error. (The file is really there.) And I checked both web server's access log, I saw the request for "abc def.html", but when I checked WebLogic's access log, I saw the request for "abc". So I think Weblogic's proxy eats out the last part of my request: "def.html". Of course, WebLogic server could not find a file called "abc" in that directory.
    And finally, in order to test my observation, I created a file called "abc" in that directory. And then the browser shows the content of the file "abc".
    Does anyone see this kind of problem before? I think this is a bug in weblogic's proxy program.

    Hi.
    Are you seeing this in both configurations (ie both iPlanet and IIS)?
    Does the problem go away entirely when you hit the servers directly (ie iPlanet and IIS aren't involved)?
    Are you running any service packs? You should be using service pack 2. If you are not please upgrade and use the plugin from this latest service pack.
    Regards,
    Michael
    Xin Liu wrote:
    Hi,
    I used the following 2 configurations:
    1. Solaris: iPlanet Web Server WebLogic 6.1
    2. W2000: IIS WebLogic 6.1
    Both of the web server just work as a gateway. All static and dynamic pages (images, JavaScript file, CSS file) are served by the WebLogic Server. (This sounds a little bit wierd. So we dropped this kind of configuration already.)
    I configured both the Web server to forward all requests with "*/portal/*" to WebLogic server. It works fine except the requests with space inside. For example:
    http://localhost:8080/portal/abc def.html
    (I encode space to when I type it in browser).
    And I got a 404 error. (The file is really there.) And I checked both web server's access log, I saw the request for "abc def.html", but when I checked WebLogic's access log, I saw the request for "abc". So I think Weblogic's proxy eats out the last part of my request: "def.html". Of course, WebLogic server could not find a file called "abc" in that directory.
    And finally, in order to test my observation, I created a file called "abc" in that directory. And then the browser shows the content of the file "abc".
    Does anyone see this kind of problem before? I think this is a bug in weblogic's proxy program.--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • IDOC segment fields prefixing blank space with values

    Hi Experts,
    I am sending data through custom IDOC from SAP to XML which generates successfully but getting 2 problems in the data.
    its having 3 level idoc segments:
    SEGMENT1 with 1 field (field_name(20))
    SEGMENT2 with 3 fields, (code_g(20), field_name(20), value(20))
    SEGMENT3 with 4 fields, (code(20), field_name(20), Language(2) & text(20))
    When i check the idoc in WE02,
    1. i found that segment2-value field is prefixing some space along with the values.
        Eg: if the output is "0111" whihc is plant, in the output (WE02) it is giving "       0111"
    2. Segment3-language is no where in the output and text which should come as "011" is coming like "       EN011" means it is concatinating language field value and displaying it with the text field value with prefixing space.
    This is happening in PRD not in QA & DEV. I also checked the transport req and everything, Its same everywhere.
    Can anyone please help me on this.
    Regards,
    Nik

    Hi,
    This issue happnes when u are moving the data to iDOC segement with offset.
    to aviod this improper move instead of using offset statement use below mentioned code.
    decalare a structure as
    Data SEG1 type SEGMENT1 ,
            SEG2 type SEGMENT2,
           SEG3 type SEGMENT3.
    then while moving
    SEG2-code_g = 'XXXX'
    SEG2-field_name = 'YYYY'
    SEG3-value = 'ZZZZ'
    here u are moving the segment values to idoc data (SDATA) and then append it.
    move seg3 to idoc-sdata.
    then append it to idoc.
    hope this helps

  • With all the games coming out for iMacs what Gaming Pad or Jotstick works with the Imac

    With all the games coming out for iMacs what Gaming Pad or Jotstick works with the Imac

    Now the bad news. In my "Print to Video" pop up, if
    I select "Color Bars" , "Black", or any other option
    and take out my bars and tone and slug from the
    timeline, the print to video does not print anything
    to tape except for a nice nothing blue. I don't
    even get my actual timeline video printed to tape.
    Jerry,
    You are a genius! Man do I feel silly. So just for the benefit of others who might read this post, I did exactly as you said, and of course when I restarted FCP, I had to identify my Firewire NTSC setting for the drive. This time, instead of leaving my tapedrive offline, I left it on and immediately saw on my drive monitor the video coming off of my timeline.
    Every thing works perfect. I now have a clean timeline with just the content I'm working on and don't have to worry about bars, slugs, post black. Just a few checkboxes and I'm ready to send my tapes off. Really nice feature.
    Thanks!
    iMac   Mac OS X (10.4.6)   2GB DDR2, 500GB Disk, 20" LCD

  • I backup to an external hdd with Time Machine, when it ran out of space it did not delete old backups, now my internal hdd says its full when before it had heaps of space. I have searched for extra files but cant find any. Can anyone help, please.

    I backup to an external hdd with Time Machine, when it ran out of space it did not delete old backups, now my internal hdd says its full when before it had heaps of space. I have searched for extra files but cant find any. Can anyone help, please.

    First, empty the Trash if you haven't already done so. Then reboot. That will temporarily free up some space.
    To locate large files, you can use Spotlight as described here. That method may not find large folders that contain a lot of small files.
    You can also use a tool such as OmniDiskSweeper (ODS) to explore your volume and find out what's taking up the space. You can delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one.
    Proceed further only if the problem hasn't been solved.
    ODS can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
    Back up all data now.
    Install ODS in the Applications folder as usual.
    Triple-click the line of text below to select it, then copy the selected text to the Clipboard (command-C):sudo /Applications/OmniDiskSweeper.app/Contents/MacOS/OmniDiskSweeper
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    I don't recommend that you make a habit of doing this. Don't delete anything while running ODS as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means.
    When you're done with ODS, quit it and also quit Terminal.

  • MacBook Pro with Retina Running Out of Space

    Hi there.
    I have a MacBook Pro with retina running OS X mavericks. Recently I have taken a look into "about this Mac" and found that I am running out of space (Picture Bellow). I found that most of my space is in Apps and I am trying to find where they are on my Mac HD. By going to the Macintosh HD the fallowing had this much space taken up "Applications (9.69GB), Library (4.74GB), System (5.7GB), User INFO (49 bytes), and Users (71.89GB) “. I found that Users (71.89GB)-> Pictures(58.91GB) is taking up most of the space but that accounts for Movies (46.91GB) and Photos (12.12GB) but not Apps. Where else should I look for the 90GB Apps or is it just the OS taking up this space?
    Thank you

    If the Storage display seems to be inaccurate, try rebuilding the Spotlight index.
    Empty the Trash if you haven't already done so. If you use iPhoto, empty its internal Trash first:
              iPhoto ▹ Empty Trash
    Do the same in other applications, such as Aperture, that have an internal Trash feature.
    According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation. You're in no danger of running out.
    See this support article for some simple ways to free up storage space.
    You can more effectively use a tool such as OmniDiskSweeper (ODS) or GrandPerspective (GP) to explore the volume and find out what's taking up the space. You can also delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one. Note that ODS only works with OS X 10.8 or later. If you're running an older OS version, use GP.
    Deleting files inside an iPhoto or Aperture library will corrupt the library. Any changes to a photo library must be made from within the application that created it. The same goes for Mail files.
    Proceed further only if the problem isn't solved by the above steps.
    ODS or GP can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
    Back up all data now.
    If you have more than one user account, make sure you're logged in as an administrator. The administrator account is the one that was created automatically when you first set up the computer.
    Install the app you downloaded in the Applications folder as usual. Quit it if it's running.
    Triple-click anywhere in the corresponding line of text below on this page to select it, then copy the selected text to the Clipboard by pressing the key combination command-C:
    sudo /Applications/OmniDiskSweeper.app/Contents/MacOS/OmniDiskSweeper
    sudo /Applications/GrandPerspective.app/Contents/MacOS/GrandPerspective
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing command-V. You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. Ignore any other messages that appear in the Terminal window.
    The application window will open, eventually showing all files in all folders, sorted by size. It may take a few minutes for the app to finish scanning.
    I don't recommend that you make a habit of doing this. Don't delete anything as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means. When in doubt, leave it alone or ask for guidance.
    When you're done with the app, quit it and also quit Terminal.

  • I updated to IOS 8 but my C drive is out of space i couldn't restore my data back; how could move itunes with backup to another drive

    I updated to IOS 8 but my C drive is out of space i couldn't restore my data back; how could move itunes with backup to another drive
    or what could i do

    There are two solutions . . . I run my iTunes Library off an external hard drive. However, this may limit the portability of your library. Though a La Cie Rugged external would help with that (I love mine, though I use it for diagnostics and repair, not for iTunes--but it does get around).
    You can also upgrade your hard drive as was previously suggested. I've bought my recent hardware from: http://www.powerbookmedic.com
    They have lots of parts and great manuals!
    Good luck!
    Sharon

Maybe you are looking for