cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get data in PDF - Webdynpro

Former Member
0 Kudos

Hi All,

I want to get the report in the PDF in webdynpro application.

Problem i am having is, I am shown the text in the new browser but not coming it in the PDF. Its like showin as a HTML Page. Anyone pls let me know where i am going wrong.

Below is the code i written.

    
String slReport=new String();
    slReport="Delivery Tracking Information Report";

	byte[] pdfContent = slReport.getBytes();
	IWDCachedWebResource pdfResource = WDWebResource.getPublicCachedWebResource(
			pdfContent,
			WDWebResourceType.PDF,
			WDScopeType.CLIENTSESSION_SCOPE,
			wdThis.wdGetAPI().getComponent().getDeployableObjectPart(),
			"Xyz_");
	try{
	wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getURL(), "Report View").show();
	}catch(WDURLException e){
	wdComponentAPI.getMessageManager().reportException("URL not found", true);
	}

Thanks......

Thanks,

Raghavendra Pothula

Anyone Pls!!!

Message was edited by:

Raghavendra Pothula

Accepted Solutions (0)

Answers (1)

Answers (1)

luciano_leitedasilva
Contributor
0 Kudos

Hi Raghavendra Pothula

Try this code:

byte[] pdfContent = slReport.getBytes();

IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF);

IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(pdfResource.getURL(), "Report View", true);

// Eliminate some features of the window

window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);

window.removeWindowFeature(WDWindowFeature.MENU_BAR);

window.removeWindowFeature(WDWindowFeature.STATUS_BAR);

window.removeWindowFeature(WDWindowFeature.TOOL_BAR);

window.setWindowSize(780,430);

window.setWindowPosition(20,140);

window.open();

This code work to me.

Regards,

Luciano

Former Member
0 Kudos

Thanks Leite for help,

Even this doesnt works for me. Earlier itself i tried, and i dont want to use the deprecated methods. Still i am not able to get the output on the PDF. Problem is that its showing the Content in the browser rather on PDF. I strongly believe that this may not be with CODE.

Anyone pls help..

Thanks,

Raags

luciano_leitedasilva
Contributor
0 Kudos

Raghavendra Pothula,

Have you tried in other browser client? The problem may be in your browser! Cache or something like that!

Regards,

Luciano

Former Member
0 Kudos

Hi Leite,

Yes, You are rt. When i tried it on FireFox Browser then i came see the error from PDF saying '"File does not begin with '%PDF-' ". Do you know what encoding should i use??? How to change the MIME to PDF???

Thanks for your helpful idea..!!!

Thanks,

Raags

luciano_leitedasilva
Contributor
0 Kudos

Raags,

I have no idea how to change this MIME type PDF, because ever work to me that code.

What WAS version are you working? May be a issue ou a bug at the version!

Regards,

Luciano

Former Member
0 Kudos

Hi,

I am also facing the same problem. I am able to see the binary data in the browser and not as PDF.

Regards

Vasu