Jump to content

jjjj

Members
  • Posts

    3
  • Joined

  • Last visited

jjjj's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi Nick, Sorry for that. Let me try to write down some concrete steps. 1) I assume you already have a web.xml because you want to have your Output from a Servlet. Go into that web.xml. You have defined your Servlet with the following tags: <servlet> <servlet-name>[YourServlet]</servlet-name> <servlet-class>[YourServletClass]</servlet-class> </servlet> and mapped it to a URL like this: <servlet-mapping> <servlet-name>[YourServlet]</servlet-name> <url-pattern>[YourServletURL]</url-pattern> </servlet-mapping> But Internet Explorer expects that the file that it should display has a special extension appropriate for the file type (MIME). In this case, when you want to display a PDF file, IE expects that the URL ends with ".pdf" indicating a PDF file. What you have to do: change that url-pattern thing into: <servlet-mapping> <servlet-name>[YourServlet]</servlet-name> <url-pattern>[YourServletURL].pdf</url-pattern> </servlet-mapping> What it does: You call your Servlet not by http://SERVER/YourServletURL anymore but by http://SERVER/YourServletURL.pdf As this exact url-pattern is mapped to your Servlet name, your Servlet gets called correctly. One more step: In your service method of the Servlet you have to set the Content-Disposition header by calling: response.setHeader("Content-Disposition", "inline; filename=SomeFilename.pdf"). Some browsers take this header as suggestion for a filename in case a user wants to save the file. This also presets the extension for that case. Another Option would be to response.setHeader("Content-Disposition", "attachment; filename=SomeFilename.pdf") That forces the browser to show up a "Save as" Dialog proposing "SomeFilename.pdf" as filename. I hope I could help you with this -J
  2. I guess you ran into the same problem than I did with Internet Explorer. This Browser involves the file extension to recognize a specific file type. Which makes it difficult to get a pdf shown in the IE. Usually you could set the Content-Disposition header to set the filetype that the browser suggests on saving the file. But even then IE ignores it. The solution: name whatever URL you're calling to display the PDF as something ending with .pdf I for myself renamed my Servlet producing the output as myServlet.pdf in the url-mapping in web.xml of the application. That worked. -J
  3. Hi, perhaps someone knows a workaround for me .. My problem is that I need to know, how many column rows are displayed on each page.. But I don't want it as output in a TextField where I could use the evaluationTime property but I want to use this value in a variable. for example: ( $V{COLUMN_NUMBER}.intValue() == $V{PAGE_COUNT}.intValue() ) ? <doSomething> : <doSomethingElse> ) which means that doSomething should be performed if the current row is the last row in the current page and in any other case doSomethingElse should be performed. It doesn't matter if I have to write my own counter variable, I just want to use it in other expressions and define it's evaluation time there (and not by displaying it in the report). Thanks for anyone who can help.
×
×
  • Create New...