-1

I have an API which will create the report and we need to pass the JRXML content(whihc is passed as string from UI) for that,Now I want to compile the JRXML content before saving it into data base,One approach I have is that I can save the JRXML content into file system and then load that file and compile it,But I don't like it because if the compilation failed I need to delete that file from file system, So wondering If I can compile the input JRXML content only before storing it into file.

I am passing the JRXML as a string to my method which should compile that JRXML string, but I don't want to store the content in file and then compile it

7
  • @PetterFriberg Please see my edit ,it is not the duplicate of the question which you refer. Commented Apr 15, 2016 at 4:50
  • 1
    @user3817378 I am asking to compile the jasper string - What do you mean? I don't know about the jasper strings and compilation of jasper string. Please explain Commented Apr 15, 2016 at 7:52
  • A jasper string = the content in a jasper file, if so then just create a inputstream from the string how-do-i-turn-a-string-into-a-stream-in-java, then check the duplicate again. Commented Apr 15, 2016 at 17:47
  • @AlexK, The intention of putting the block letters was to avoid any confusion about what I was asking,I am no one to shout to anyone. Commented Apr 15, 2016 at 17:57
  • 1
    If it works consider to accept the duplicate, since in the end it really is. Commented Apr 15, 2016 at 19:24

1 Answer 1

1

You can also use an input stream, not necessarily a file object for the compile() method like mentioned in the jasper docs.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.