InputStream from String via StringReader ?

Hello, i d like to know how to create an InputStream from a String via StringReader ?
Thanks

Hello, i d like to know how to create anInputStream
from a String via StringReader ?
ThanksYou can't.So why does it say like this in the api for
StringBufferInputStream ?a) this was not your original question
b) "Deprecated. This class does not properly convert characters into bytes. As of JDK 1.1, the preferred way to create a stream from a string is via the StringReader class. "
So you can use that class but it will be wrong. You should not use streams for characters. You should use Readers and Writers.

Similar Messages

  • How to get InputStream from String ?

    Hi !
    I want to get InputStream object from String.
    String str = "balabalabala";
    InputStream stream = getInputStream(str);
    How to realize getInputStream(str) function ?
    Thanks!

    The preferred method nowadays is to use Readers and Writers for String data - hence StringReader(String). If you're going to operate on the InputStream directly, then I'd modify your code to use the Reader calls and go that route.
    If, however, you need to pass the InputStream to some other piece of API that requires an InputStream instead of a Reader, then the ByteArrayInputStream is probably your best bet. StringBufferInputStream is deprecated because it doesn't work reliably in the face of many character encodings.
    Speaking of encodings - never call Strng.getBytes() - always use the getBytes(character-encoding) version, so you KNOW what encoding you're getting!
    Grant

  • InputStream from a String?

    Hi all,
    does anybody know how you would go about getting a java.io.InputStream from a string object? I know you can create a StringReader from a string, but the StringBufferInputStream is depreciated. I want to parse an xml String with the DocumentBuilder class, but it only takes an InputStream object, not a Reader object.
    any suggestions?
    thanks,
    J

    Adding to Mr. Sampieri's explanation:
    The encoding is specified in the initial processing instruction of the XML. If absent, the default encoding is UTF-8. (The default encoding of Java depends on the locale, so it's better to specify the correct encoding when writing your program.)
    Check if the names of the XML encodings are different from the names of the Java encodings (charsets).
      <?xml version="1.0" encoding="ISO8859-1" ?>

  • Org.w3c.dom.Document to/from String ?

    I need to be able to parse (once) an XML string, and then pass the parsed object around to/from different objects.
    I tried to use org.w3c.dom.Document,
    generated by javax.xml.parsers.DocumentBuilder .
    HOWEVER - I don't see any way to parse an xml String!
    The doc-builder parse() method accepts either a file/url, or an InputStream.
    When I tried to use the StringBufferInputStream I found-out it is deprecated, and that I should use StringReader.
    BUT I cannot parse using StringReader ! (the method parse() doesn't work with it)
    Is there anyway to parse a String to create a Document ?
    ========================================================
    And that's only HALF my problem:
    I did parse an input file into a Document, to experiment a little.
    I then wanted to convert it to an XML String - but couldn't.
    How do I get the xml String from a Document ?
    I cannot: How do I save it to a file ?
    I must say that under .NET both tasks are TRIVIAL:
    XmlDocument.LoadXML()
    XmlDocument.OuterXml
    Thanks
    Meir

    The doc-builder parse() method accepts either a file/url, or an InputStream.This isn't true. Look it up again. There are overridden versions of parse() that use File, InputSource, InputStream, or String. The String one isn't what you want, because the String it takes is a URL pointing to the XML and not the XML itself. The File one doesn't work for you because you don't have a file, and you've already said why the InputStream one doesn't work for you.
    So that leaves the version that takes an InputSource. So, what is an InputSource anyway? You could look it up just by clicking on the link in the API docs...

  • Error while calling applet from Javascript via LiveConnect and WebDriver

    Hi all,
    I am trying to call applet Java code from Javascript via WebDriver.
    Given the following two cases:
    - calling a static method: Integer.parseInt("42")- constructing a new object: new String("Hello world")My Javascript code looks like this:
    document.appletId.Packages.java.lang.Integer.parseInt("42");
    new document.appletId.Packages.java.lang.String("Hello world");When executing this code in Firefox via the Firebug Javascript console everything works fine and I get the expected results. However, when executing this code via the JavascriptExecutor from WebDriver only the call to the static method succeeds, the construction of the new object leads to the following error: "Attempt to call a default method on object with no invokeDefault method."
    I don't have any idea what is going wrong here, so any help would be greatly appreciated.
    Thanks!

    Hello Gerard, Hello Krishna,
    -> The liveCache application failed with COM error::
                                   40028 Illegal timestamp in rough timegrid
    More details about COM error 40028 you will see in TA /n/sapapo/om10
         -> Return code: 40028 -> execute ::
    Invalid time stamp in the time buckets profile relation     
    ( om_ts_tgrelinvalidstamp )     
       < click on '?' mark >
    -> Open an OSS message in accordance with SAP note 167280 if further help
         needed to solve the issue on your system.
    Thank you and best regards, Natalia Khlopina

  • Scan from string error 85

    Hi Everybody,
    I'm trying to use LabView to
    process some data.  The data, although it was collected via labview,
    has been written out to csv file format.  I have been able to
    successfully open the file and use the search split string function to
    remove the "header" from the data stream.  Now I'm trying to parse the
    header to extract some pieces of the info that is there.  I'm trying to
    do this with the Scan from String VI.  
    So
    far I've been able to retrieve the Specimen ID from the first line of
    the header by setting the format string input of Scan from String as
    "Specimen ID ,%s", which works just fine.  Problem is, when I
    adjust
    the format string to include the next piece of data I want, I
    inevitably get an Error 85, which is a failed scan.  In fact, I
    get an err85 every time I try to extract something from after the
    second line.  I've attached a VI in which I cut and pasted an
    example header string in as a string constant and an example of how I'm
    trying to extract the values.  I've tried playing around with
    spaces and different formats, but get the err85 no matter what I do
    (unless I extract the first line).  I have a hunch that it has
    something to do with the EOL marker, but no idea how to work around it.
    A search of posts here show that a lot of people have issues with the
    scan from string vi, but nobody I could find had this exact
    problem.  I've also considered using the spreadsheet spring to
    array function, but because I have a mix of commas and EOLs it doesn't
    seem to work either. HELP! I really don't want to have to write this
    over in VBA/Excel.
    Thanks,
    Turk
    Message Edited by YoungTurk on 07-29-2005 10:36 AM
    Attachments:
    Scan.vi ‏12 KB

    You should probably parse it line by line (See attached, LabVIEW 7.1)..
    The attached example shows one possibility to get all the Items and values out. Not all values are strictly numeric so you would need to adapt the code a little bit. (This is just a very rough 1 minute draft).
    You might want to cosider to extract all values into a cluster for further processing, Have a look at the example  posted in this thread . It can be easily adapted to read the values in the proper format (DBL, I32, Date, String, etc.) depending on the item name.
    Good luck!
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ScanMOD.vi ‏30 KB

  • Error 1 occurred at Scan From String (arg 1)

    I am communicating with the AT Trainer 5000 via serial port to USB converter.
    I installed all drivers of converter successfully and it is shown in MAX as com port. I also installed VISA software. 
    I am using labview 2013 version.
    When I connect the hardware to PC via usb to serial converter, try to run the program for seeing of real time graphs, I am receiving this error Error 1 occurred at Scan From String (arg 1) whereas there is no waveform shown in waveform chart. 
    Also read buffer didn't show an incoming data at read buffer.
    Other details for this error is
    Possible reason(s):
    LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
    Also pics of error is:
    Program is also attached. Please checked the also.
    Expert please help me how to get rid of this error.
    Attachments:
    Project.vi ‏23 KB

    Since you are using the termination character, you should not use the Bytes At Port property node.  Just set the number of bytes to read for the VISA Read to something really high (larger than what you expect in a single transmission).  The VISA Read will stop reading once the termination character is reached.
    Now, what is the format of the data coming from the instrument?  I see you are converting an ASCII Hex string into a number while trying to also turn it into a double.  That is likely why you are getting your error.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • How to get InputStream from a file with absolute path?

    Hi, guys:
    If I have file with a absolute path that may be inside/outside
    my Eclipse plugin, I want to get an InputStream from it. It just keeps giving me null for "is":
    String absFilePath = "/D:/my_dir/.../sample_file.txt";
    InputStream is = getClass().getResourceAsStream(absFilePath);
    regards,

    Don't use resource as stream if you have an absolute path, use FileInputStream.

  • Take the average of the measured values wich cannot be converted from string to number..

    Hello,
    I have a Keithley 182 Digital Nanometer (K182). I am usins it to measure voltage at high temperature. I want K182 to measure 3 times and then take the avarage of collected data.
    1. First problem is, as you can see from picture, string to number conversion. I tried many ways but I couldn't do it. Values as you see 0,00, and once was
    3,98E-3
    0,00
    392,0
    originan values were
    3,98E-3
    3,95E-3
    3,93E-3
    in table, values generally like this.
    2. I need to take avarege. So i need toindez data, then take avarage. So, I have also problem here...
    Could you please help on thic topic. Thanks in advance.
    Attachments:
    string-number.png ‏19 KB
    string-number-panel.png ‏30 KB

    thank you, I will try this solution. Also I want to do one more thing. So, I am collecting data and putting them in to table let say data are like this
    Temp1     Temp2   Volt
    123,3       234,5      ...
    234,4       567,7
    345,6       789,9
    456,7       678,8
    I want to put data with increment like this given below:
    No  Temp1     Temp2   Volt
    1    123,3       234,5      ...
    2    234,4       567,7    
    3    345,6       789,9
    4    456,7       678,8
    there are no exact number of data. the number of data can change from measurement to measurement (1000, 2000, 500 more or less). How can I program this increment in my system.
    My system is include LakeShore 336 temperature conroller and Keithley 182 Nanovoltmeter. I will set the temperature specified value from room temperature wtih specific ramp rate. Meanwhile I will measure the voltage from sample via K182. So, I can measure both temp, and voltage via taking help from u.

  • Please help, urgently Error 1 occurred at Scan From String (arg 1).

    I am communicating with the AT Trainer 5000 via serial port to USB converter.
    I installed all drivers of converter successfully and it is shown in MAX as com port. I also installed VISA software. 
    I am using labview 2013 version.
    When I connect the hardware to PC via usb to serial converter, try to run the program for seeing of real time graphs, I am receiving this error Error 1 occurred at Scan From String (arg 1) whereas there is no waveform shown in waveform chart. 
    Also read buffer didn't show an incoming data at read buffer.
    Other details for this error is
    Possible reason(s):
    LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
    Also pics of error is:
    Program is also attached. Please checked the also.
    Expert please help me how to get rid of this error.
    Attachments:
    Project.vi ‏23 KB

    duplicate post http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Error-1-occurred-at-Scan-From-String-arg-1/td...

  • Problem calling java from vb via activex bridge

    I am trying to call java from vb via ActiveX Bridge and I am running into problems. I would appreciate any help.
    I am using Visual Basic 2010 express, and Java JDK 1.6.0_16. I have used the http://download.oracle.com/javase/1.4.2/docs/guide/beans/axbridge/developerguide/index.html page as a guideline. To try to make it work I took the following steps:
    1. Wrote a very simple java class (below):
    package xxx;
    import java.io.Serializable;
    public class axb implements Serializable {
    public int get_axb_Handle() {
    int Address = 12345678;
    return Address;
    2. After I compiled, and created the jar file. I built the dll using the following command:
    "C:\Program Files\Java\jdk1.6.0_16\bin\packager" -out "C:\Program Files\Java\jdk1.6.0_16\jre\axbridge\bin" E:\axb\dist\axb.jar xxx.axb
    3. I then registered using: regsvr32 axb.dll
    4. In Visual Basic Express IDE I use Project -> Add Reference to add Iterop.axb (dump below), and axb namespace
    5. In my basic code I use the following lines
    Dim axb1 As axb.axb
    axb1 = New axb.axb <== Crash here with AccessViolationException ( full exception below)
    What am I missing? Any help would be greatly appreciated
    Thanks
    Iterop.axb partial dump
    ___[MOD] C:\Documents and Settings\Elie A. Cohen.USINC022\My Documents\Visual Studio 2010\Projects\Repo API Example\Repo API Example\obj\x86\Release\Interop.axb.dll
    | M A N I F E S T
    |___[NSP] axb
    | |___[INT] axb.axb
    | | | .class interface public abstract auto ansi import /*02000006*/
    | | | implements axb.axbDispatch/*02000003*/
    | | | implements axb.axbSource_Event/*02000005*/
    | | | .custom /*0C000018:0A000001*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.GuidAttribute/*01000002*/::.ctor(string) /* 0A000001 */ = ( 01 00 24 34 45 36 44 30 44 41 38 2D 36 41 45 44 // ..$4E6D0DA8-6AED ...
    | | | .custom /*0C000019:0A000007*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.CoClassAttribute/*01000009*/::.ctor(class [mscorlib/*23000001*/]System.Type/*01000007*/) /* 0A000007 */ = ( 01 00 0C 61 78 62 2E 61 78 62 43 6C 61 73 73 00 // ...axb.axbClass. ...
    | |
    | |___[CLS] axb.axbClass
    | | | .class public auto ansi import /*02000004*/
    | | | implements axb.axbDispatch/*02000003*/
    | | | implements axb.axb/*02000006*/
    | | | implements axb.axbSource_Event/*02000005*/
    | | | .custom /*0C00000F:0A000008*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.ClassInterfaceAttribute/*0100000A*/::.ctor(int16) /* 0A000008 */ = ( 01 00 00 00 00 00 ) ...
    | | | .custom /*0C000010:0A000009*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.ComSourceInterfacesAttribute/*0100000B*/::.ctor(string) /* 0A000009 */ = ( 01 00 0F 61 78 62 2E 61 78 62 53 6F 75 72 63 65 // ...axb.axbSource ...
    | | | .custom /*0C000011:0A000001*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.GuidAttribute/*01000002*/::.ctor(string) /* 0A000001 */ = ( 01 00 24 43 44 42 46 36 42 33 33 2D 45 32 33 46 // ..$CDBF6B33-E23F ...
    | | | .custom /*0C000012:0A000002*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.TypeLibTypeAttribute/*01000003*/::.ctor(int16) /* 0A000002 */ = ( 01 00 02 00 00 00 ) ...
    | | |___[MET] method .ctor : void()
    | | |___[MET] method equals : bool(object)
    | | |___[MET] method getClass : object()
    | | |___[MET] method get_axb_Handle : int32()
    | | |___[MET] method hashCode : int32()
    | | |___[MET] method notify : void()
    | | |___[MET] method notifyAll : void()
    | | |___[MET] method toString : string()
    | | |___[MET] method wait : object(object,object)
    AccessViolationException exception
    System.AccessViolationException was unhandled
    Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Source=mscorlib
    StackTrace:
    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
    at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
    at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
    at System.Activator.CreateInstance(Type type, Boolean nonPublic)
    at System.Activator.CreateInstance(Type type)
    at WindowsApplication1.Form1.getPatientHandle_Click(Object sender, EventArgs e) in C:\Documents and Settings\Elie A. Cohen.USINC022\my documents\visual studio 2010\Projects\Repo API Example\Repo API Example\Repo API Example.vb:line 13
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(ApplicationContext context)
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
    at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    InnerException:

    In case you haven't figured it out already... Or if anyone else is curious... Or for myself when I get old and forgetful...
    h2. Object Creation
    For starters, when you create an ActiveX object from within VB, use:
    Set myObject = CreateObject("JavaObject.Bean")When I refer to JavaObject.Bean, I'm meaning the full object name + ".Bean". So, in your case, you should use:
    Set myObject = CreateObject("xxx.axb.Bean")h2. Location
    The .dll file must be located in the JRE that is used at the time of calling. Meaning, the .dll file must be placed under <jre_home>\axbridge\bin and registered there.
    In your case:
    DLL:
    C:\Program Files\Java\jre6\axbridge\bin
    Jar:
    C:\Program Files\Java\jre6\axbridge\libh4. A Note:
    The only supported JRE is a 32bit version as far as I know with regards to the ActiveX bridge. Just like the packager.exe can only be found in the 32bit JDK.
    h2. Methods
    h3. Object Types
    ActiveX Bridge does not support passing literals or arrays. However, it does support passing java's primitive data types as Objects.
    Simply meaning:
    h4. Invalid:
    public int get_axb_Handle() {
         int Address = 12345678;
         return Address;
    }h4. Valid:
    public Integer get_axb_Handle() {
         int Address = 12345678;
         return Address;
    }On a normal circumstance, there's little difference between the two methods. However, in the second example, the JVM does a typecast from a literal data type to a object data type, resulting in a valid object to pass through to Visual Basic. Now, obviously there are multiple ways to do a proper change, new Integer(int) for example. It doesn't matter to me. At the end of the day, you have to pass an object.
    As a side note, the same idea applies when receiving data from Visual Basic.
    h4. Invalid:
    public void set_axb_Handle(int newHandle) {
         int Address = newHandle;
    }h4. Valid:
    public void set_axb_Handle(Integer newHandle) {
         int Address =newHandle;

  • Reading InputStream from Runtime.exec() and ffmpeg?

    I've got a lot of things going on here and I'm having trouble debugging. I'm working on a streaming music player, and the platform only handles MP3 natively. Specifically, the method that handles incoming requests has to return an InputStream for further processing upstream (out of my visibility).
    I'm trying to extend the music player to play AAC files with the extension ".m4a". To do this, my plan is to transcode from MP3 to AAC using Runtime.exec() and ffmpeg, and then return an InputStream that contains the MP3. This works fine if I use ffmpeg to transcode to a temp file, and then return a FileInputStream constructed from that temp file. But like I said, this is supposed to be a steaming music player, and the blocking for the ~30 seconds it takes to completely transcode to a file is too much of a delay.
    So what I'm trying to do is have ffmpeg transcode to stdout, and then use Process.getInputStream() to return the InputStream that contains ffmpeg's stdout while the transcoding is still going on. This doesn't work and I'm not sure why. (I'm fairly new to java, and this is the first time I've used Runtime.) My player just hangs there. I know Runtime is picky about exhausting the stdout and stderr streams, so I'm not sure if it's something related to that, or if I somehow need to buffer the stdout before returning it, or if I need to run something in a different thread, or if I'm just completely barking up the wrong tree.
    If anyone has any experience with something like this, or can point me at some code that implements something similar, I'd appreciate the help.
    Below a sample of the code in question. Also, for what it's worth, all of the console messages that I put in there are printing, but the music doesn't play.
       public InputStream getStream(String uri) throws IOException
                 System.out.println("Entering Factory.getStream()");
                  System.out.flush();
                File file = new File(URLDecoder.decode(uri, "UTF-8"));
                if (file.exists())
                     if(file.getPath().toLowerCase().endsWith(".mp3")) {
                            // This code for playing MP3 files works correctly
                          System.out.println("Playing MP3");
                          System.out.flush();
                          InputStream in = new FileInputStream(file);
                          return in;
                     else if(file.getPath().toLowerCase().endsWith(".m4a")){
                          System.out.println("Playing M4A");
                          System.out.flush();
                          // Create array for ffmpeg command line
                            // This command line transcodes to STDOUT
                          String[] command = { this.ffmpeg_path,
                                                             "-i", 
                                                             "input.m4a",
                                                             "-acodec",
                                                             "libmp3lame",
                                                             "-ac",
                                                             "2",
                                                             "-ab",
                                                             "256",
                                                             "-f",
                                                             "mp3",
                          // Begin transcoding with ffmpeg
                          System.out.println("Transcoding...");
                          System.out.flush();
                          Runtime runtime = Runtime.getRuntime();
                          Process ffmpeg = runtime.exec(command);
                          // Must exhaust error stream, or the application can become deadlocked.
                          System.out.println("Exhausting stderr...");
                          System.out.flush();
                          this.exhaustInputStream(ffmpeg.getErrorStream());
                          // Return ffmpeg's stdout as an input stream
                          System.out.println("Returning stdout...");
                          System.out.flush();
                          return ffmpeg.getInputStream();
                     else {
                          System.out.println("Unsupported Audio File");
                          System.out.flush();
                          return null;
                else
                    // We aren't requesting a file, so let the API handle the request upstream...
                    return super.getStream(uri);
         private void exhaustInputStream(final InputStream inputStream) {
                  // Since InputStream.read() blocks, exhast the stream in a separate thread
                  new Thread() {
                       public void run() {
                            try {
                                 while(inputStream.read() >= 0) {
                                      // Just throw the bytes away
                            catch(IOException e) {
                                 e.printStackTrace();
                  }.start();
             }

    Read this article
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Hi there
    I'll pass your details to our Russian team and they'll contact you to assist further.
    Kind regards
    Bev

  • Conversion from string "20041023 " to type 'Date' is not valid.

    Hi ,
       I have a table with one of the column(EmpHiredate) datatype is char(10). It has value like "20141023". I need to display this value as date format(dd/mm/yyyy) in report. 
    Following methods i tried in textbox expression but no luck.
    =Format(Fields!EmpHireDate.Value,"dd/MM/yyyy")
    =Cdate(Fields!EmpHireDate.Value)
    Error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "20041023  " to type 'Date' is not valid.
    Is it possible to convert string to date using SSRS textbox expression ? Can anyone help me with the solution.
    Thanks,
    Kittu

    Hi Jmcmullen,
         Found one more issue on the same. I have one value like "00000000" for the column(EmpHiredate)
    , when i use above expression values(ex:"20141023")
    are displaying in dd/MM/yyyy format in report except value like "00000000" and giving following error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "0000/00/00" to type 'Date' is not valid.
    Even i tried to pass its original value("00000000") as below but no luck.
    =IIF(Fields!EmpHireDate.Value = "00000000","00000000",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Also tried this:
    =IIF(Fields!EmpHireDate.Value = "00000000","2000/10/21",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Please Suggest. 
    Thanks ,
    Kittu

  • I recently purchased songs from itunes via my pc and I dont know how to get them onto my iphone? When I click the sync button it says I will lose all the music currently on my iphone.. Help :(

    I recently purchased songs from itunes via my pc and I dont know how to get them onto my iphone? When I click the sync button it says I will lose all the music currently on my iphone.. Help

    If you're syncing with a different iTunes library than the one you previously synced with, then there is no way around it. You're gonna loose the old data. The only way round it would be to make sure that all the music files on your iPhone is also in your iTunes library. If you still have access to the computer with the old library, you could copy the files on to an external harddrive, and then import them into your new iTunes library.
    If it is in fact the same library, then the music currently on your iphone, is also in your itunes library. Just make sure that the artists/albums/playlists, or whatever you sync contains these tracks, that you allready have on your phone and don't want deleted. What i do is, i create a playlist specifically for my iPhone, and i set it up to only sync with this playlist. Whenever i hear a track from my iTunes library or buy a new track that i want on my phone, i just drag it to this playlist and next time i synchronize, it's there without deleting anything else.

Maybe you are looking for

  • How to Implement custom share functionality in SharePoint 2013 document Lib programmatically?

    Hi, I have created custom action for Share functionality in document library. On Share action i'm showing Model pop up with Share form with addition functionality. I am developing custom share functionality because there is some addition functionalit

  • Print HTML doument without open it from an applet

    I need to know how I can print an HTML document from an applet developed with Jbuilder 4. I'm not a very expert developer and I need a detailed information about this problem. Important is that the HTML document is printed without open it. I use: win

  • Error when activating Cube with Non-cumulative KF

    Hi all, I'm trying to re-activate an InfoCube but now with non-cumulative KF and I'm getting the error message "Object YYYYY could not be activated". Please help! Best regards, Thiago Modro

  • Show last data 0 in an Input-ready query - Bex

    Hi experts, I have an Input-ready query working ok with IP (Integrated Planning). The infocube contains information about date/material/stock_quantity (via DTP, date and material, and real-time introduced stock-quantity), the user (via Bex) only intr

  • Why a white ? in a Blue Box?

    I have using the Apple Support Communities daily for quite some time, yet Today I now see the famous white question mark in a Blue box for three out of four Apple Pay logos - what changed?  It always worries me when a major web site appears different