3 Replies Latest reply: Mar 10, 2011 4:27 AM by 793415 RSS

    Applet with jasper report how to?

    826828
      HI all,

      I created a applet with jasper report. It Runs locally fine. But when i put it on web application it shows error File not found

      block which throws error may lies in following code

      URL source = new URL(getCodeBase(), "report2.jasper");
           
                String f=source.getFile();
                File reportFile = new File(f);
           if (!reportFile.exists())
                     throw new JRRuntimeException("File not found.");





      kindly Help

      -Balaji
        • 1. Re: Applet with jasper report how to?
          793415
          File objects only ever point to locations on the end-user's local file system - they can never point back to the server.

          Once you have an URL, use that as input for whatever processes the resource. Any API worth considering will offer over-ridden methods that accept either URL & InputStream sources in addition to Files.
          -----------------------------
          BTW - when posting code or code snippets, XML/HTML or input/output, please use the code tags as described on the 'sticky post' at the top of the forum thread listing.
          • 2. Re: Applet with jasper report how to?
            826828
            Hi andrew,
            thank you for your reply.

            I am not understand what you have written. Can you please write little in deep.

            Thank You,
            -Balaji
            • 3. Re: Applet with jasper report how to?
              793415
              Balaji wrote:
              ..I am not understand what you have written. ..
              What part do you not understand?
              ..Can you please write little in deep.
              No. I'm not here to:
              <ul>
              <li>Spoon-feed answers.
              <li>Do research you should do yourself.
              <li>Use my crystal ball to ascertain what part of what I said that you do not understand.
              </ul>

              You will need to be more specific.