You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Pankaj Jain <pa...@gmail.com> on 2007/08/14 08:33:07 UTC

PDF Report in JetSpeed Portal

Dear All,

I am not able to get a report in PDF format on JetSpeed Portal.
Its not throughing any error in log or on console. Code is running
successfully and giving out of report all in ascii characters.

My complete data is comming in "byteArrayStream" object. The "request" is
HttpServletRequest.

The Following Code, I have written for the same....

ByteArrayOutputStream byteArrayStream =
(ByteArrayOutputStream)PDFDataArray.get(2);
response.reset();
RenderResponse rRes = (RenderResponse)
request.getAttribute("javax.portlet.response");
rRes.setContentType("application/pdf");
rRes.getPortletOutputStream().write(byteArrayStream.toByteArray());
byteArrayStream.close();

Please help me out.

Thanks
Pankaj Jain

-- 
View this message in context: http://www.nabble.com/PDF-Report-in-JetSpeed-Portal-tf4265508.html#a12139464
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: PDF Report in JetSpeed Portal

Posted by Pankaj Jain <pa...@gmail.com>.
Hi,
I have checked web.xml file of conf directory. As there is many mime types,
there is already a mime type setted for pdf also. Still its not working.

Thanks
Pankaj Jain

Ford, Jennifer M. wrote:
> 
> The mime type needs to be added to the web.xml file under conf under the
> base Jetspeed-2.1.2 directory (or whatever version you are using).
> You'll see hundreds of other mime types there as well, just add yours in
> and it should work. 
> 
> -----Original Message-----
> From: Pankaj Jain [mailto:pank0581@gmail.com] 
> Sent: Thursday, August 16, 2007 6:48 AM
> To: jetspeed-user@portals.apache.org
> Subject: RE: PDF Report in JetSpeed Portal
> 
> 
> Hi,
> 
> I have added following tag in portlet.xml file.
> <supports>
> 	<mime-type>application/pdf</mime-type>
> 	<portlet-mode>VIEW</portlet-mode>
> </supports>
> 
> and 
> 
> To get PortletOutputStream, we required renderResponse and
> renderResponse is don't have setHeader Method.
> 
> Thanks
> Pankaj Jain
> 
> 
> Ford, Jennifer M. wrote:
>> 
>> Have you added PDF to your mime types in the web.xml file?  I am also 
>> adding a report subsystem to my portal, and I had to do that to get 
>> them to come up.
>> 
>> -----Original Message-----
>> From: Michael Binette [mailto:jetspeed@adinquiry.com]
>> Sent: Tuesday, August 14, 2007 6:51 AM
>> To: Jetspeed Users List
>> Subject: Re: PDF Report in JetSpeed Portal
>> 
>> Pankaj,
>> 
>> I'm not doing the exact same thing, I'm using JasperReports to output 
>> a PDF report in a separate window.  But the only difference I see is 
>> that I have the following lines:
>> 
>>                     response.setContentType("application/pdf");
>>                     response.setHeader("Content-disposition", "inline;
> 
>> filename=\"Report.pdf\"");
>> 
>> Maybe you need a "Content-disposition" header?
>> 
>> --
>> Michael Binette
>> 
>> Pankaj Jain wrote:
>>> Dear All,
>>>
>>> I am not able to get a report in PDF format on JetSpeed Portal.
>>> Its not throughing any error in log or on console. Code is running 
>>> successfully and giving out of report all in ascii characters.
>>>
>>> My complete data is comming in "byteArrayStream" object. The
> "request"
>> 
>>> is HttpServletRequest.
>>>
>>> The Following Code, I have written for the same....
>>>
>>> ByteArrayOutputStream byteArrayStream = 
>>> (ByteArrayOutputStream)PDFDataArray.get(2);
>>> response.reset();
>>> RenderResponse rRes = (RenderResponse) 
>>> request.getAttribute("javax.portlet.response");
>>> rRes.setContentType("application/pdf");
>>> rRes.getPortletOutputStream().write(byteArrayStream.toByteArray());
>>> byteArrayStream.close();
>>>
>>> Please help me out.
>>>
>>> Thanks
>>> Pankaj Jain
>>>
>>>   
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>> 
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/PDF-Report-in-JetSpeed-Portal-tf4265508.html#a1217
> 9755
> Sent from the Jetspeed - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/PDF-Report-in-JetSpeed-Portal-tf4265508.html#a12212182
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: PDF Report in JetSpeed Portal

Posted by "Ford, Jennifer M." <JE...@SOUTHERNCO.COM>.
The mime type needs to be added to the web.xml file under conf under the
base Jetspeed-2.1.2 directory (or whatever version you are using).
You'll see hundreds of other mime types there as well, just add yours in
and it should work. 

-----Original Message-----
From: Pankaj Jain [mailto:pank0581@gmail.com] 
Sent: Thursday, August 16, 2007 6:48 AM
To: jetspeed-user@portals.apache.org
Subject: RE: PDF Report in JetSpeed Portal


Hi,

I have added following tag in portlet.xml file.
<supports>
	<mime-type>application/pdf</mime-type>
	<portlet-mode>VIEW</portlet-mode>
</supports>

and 

To get PortletOutputStream, we required renderResponse and
renderResponse is don't have setHeader Method.

Thanks
Pankaj Jain


Ford, Jennifer M. wrote:
> 
> Have you added PDF to your mime types in the web.xml file?  I am also 
> adding a report subsystem to my portal, and I had to do that to get 
> them to come up.
> 
> -----Original Message-----
> From: Michael Binette [mailto:jetspeed@adinquiry.com]
> Sent: Tuesday, August 14, 2007 6:51 AM
> To: Jetspeed Users List
> Subject: Re: PDF Report in JetSpeed Portal
> 
> Pankaj,
> 
> I'm not doing the exact same thing, I'm using JasperReports to output 
> a PDF report in a separate window.  But the only difference I see is 
> that I have the following lines:
> 
>                     response.setContentType("application/pdf");
>                     response.setHeader("Content-disposition", "inline;

> filename=\"Report.pdf\"");
> 
> Maybe you need a "Content-disposition" header?
> 
> --
> Michael Binette
> 
> Pankaj Jain wrote:
>> Dear All,
>>
>> I am not able to get a report in PDF format on JetSpeed Portal.
>> Its not throughing any error in log or on console. Code is running 
>> successfully and giving out of report all in ascii characters.
>>
>> My complete data is comming in "byteArrayStream" object. The
"request"
> 
>> is HttpServletRequest.
>>
>> The Following Code, I have written for the same....
>>
>> ByteArrayOutputStream byteArrayStream = 
>> (ByteArrayOutputStream)PDFDataArray.get(2);
>> response.reset();
>> RenderResponse rRes = (RenderResponse) 
>> request.getAttribute("javax.portlet.response");
>> rRes.setContentType("application/pdf");
>> rRes.getPortletOutputStream().write(byteArrayStream.toByteArray());
>> byteArrayStream.close();
>>
>> Please help me out.
>>
>> Thanks
>> Pankaj Jain
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> 

--
View this message in context:
http://www.nabble.com/PDF-Report-in-JetSpeed-Portal-tf4265508.html#a1217
9755
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: PDF Report in JetSpeed Portal

Posted by Pankaj Jain <pa...@gmail.com>.
Hi,

I have added following tag in portlet.xml file.
<supports>
	<mime-type>application/pdf</mime-type>
	<portlet-mode>VIEW</portlet-mode>
</supports>

and 

To get PortletOutputStream, we required renderResponse and renderResponse is
don't have setHeader Method.

Thanks
Pankaj Jain


Ford, Jennifer M. wrote:
> 
> Have you added PDF to your mime types in the web.xml file?  I am also
> adding a report subsystem to my portal, and I had to do that to get them
> to come up. 
> 
> -----Original Message-----
> From: Michael Binette [mailto:jetspeed@adinquiry.com] 
> Sent: Tuesday, August 14, 2007 6:51 AM
> To: Jetspeed Users List
> Subject: Re: PDF Report in JetSpeed Portal
> 
> Pankaj,
> 
> I'm not doing the exact same thing, I'm using JasperReports to output a
> PDF report in a separate window.  But the only difference I see is that
> I have the following lines:
> 
>                     response.setContentType("application/pdf");
>                     response.setHeader("Content-disposition", "inline;
> filename=\"Report.pdf\"");
> 
> Maybe you need a "Content-disposition" header?
> 
> --
> Michael Binette
> 
> Pankaj Jain wrote:
>> Dear All,
>>
>> I am not able to get a report in PDF format on JetSpeed Portal.
>> Its not throughing any error in log or on console. Code is running 
>> successfully and giving out of report all in ascii characters.
>>
>> My complete data is comming in "byteArrayStream" object. The "request"
> 
>> is HttpServletRequest.
>>
>> The Following Code, I have written for the same....
>>
>> ByteArrayOutputStream byteArrayStream = 
>> (ByteArrayOutputStream)PDFDataArray.get(2);
>> response.reset();
>> RenderResponse rRes = (RenderResponse) 
>> request.getAttribute("javax.portlet.response");
>> rRes.setContentType("application/pdf");
>> rRes.getPortletOutputStream().write(byteArrayStream.toByteArray());
>> byteArrayStream.close();
>>
>> Please help me out.
>>
>> Thanks
>> Pankaj Jain
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/PDF-Report-in-JetSpeed-Portal-tf4265508.html#a12179755
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: PDF Report in JetSpeed Portal

Posted by "Ford, Jennifer M." <JE...@SOUTHERNCO.COM>.
Have you added PDF to your mime types in the web.xml file?  I am also
adding a report subsystem to my portal, and I had to do that to get them
to come up. 

-----Original Message-----
From: Michael Binette [mailto:jetspeed@adinquiry.com] 
Sent: Tuesday, August 14, 2007 6:51 AM
To: Jetspeed Users List
Subject: Re: PDF Report in JetSpeed Portal

Pankaj,

I'm not doing the exact same thing, I'm using JasperReports to output a
PDF report in a separate window.  But the only difference I see is that
I have the following lines:

                    response.setContentType("application/pdf");
                    response.setHeader("Content-disposition", "inline;
filename=\"Report.pdf\"");

Maybe you need a "Content-disposition" header?

--
Michael Binette

Pankaj Jain wrote:
> Dear All,
>
> I am not able to get a report in PDF format on JetSpeed Portal.
> Its not throughing any error in log or on console. Code is running 
> successfully and giving out of report all in ascii characters.
>
> My complete data is comming in "byteArrayStream" object. The "request"

> is HttpServletRequest.
>
> The Following Code, I have written for the same....
>
> ByteArrayOutputStream byteArrayStream = 
> (ByteArrayOutputStream)PDFDataArray.get(2);
> response.reset();
> RenderResponse rRes = (RenderResponse) 
> request.getAttribute("javax.portlet.response");
> rRes.setContentType("application/pdf");
> rRes.getPortletOutputStream().write(byteArrayStream.toByteArray());
> byteArrayStream.close();
>
> Please help me out.
>
> Thanks
> Pankaj Jain
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: PDF Report in JetSpeed Portal

Posted by Michael Binette <je...@adinquiry.com>.
Pankaj,

I'm not doing the exact same thing, I'm using JasperReports to output a 
PDF report in a separate window.  But the only difference I see is that 
I have the following lines:

                    response.setContentType("application/pdf");
                    response.setHeader("Content-disposition", "inline; 
filename=\"Report.pdf\"");

Maybe you need a "Content-disposition" header?

--
Michael Binette

Pankaj Jain wrote:
> Dear All,
>
> I am not able to get a report in PDF format on JetSpeed Portal.
> Its not throughing any error in log or on console. Code is running
> successfully and giving out of report all in ascii characters.
>
> My complete data is comming in "byteArrayStream" object. The "request" is
> HttpServletRequest.
>
> The Following Code, I have written for the same....
>
> ByteArrayOutputStream byteArrayStream =
> (ByteArrayOutputStream)PDFDataArray.get(2);
> response.reset();
> RenderResponse rRes = (RenderResponse)
> request.getAttribute("javax.portlet.response");
> rRes.setContentType("application/pdf");
> rRes.getPortletOutputStream().write(byteArrayStream.toByteArray());
> byteArrayStream.close();
>
> Please help me out.
>
> Thanks
> Pankaj Jain
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org