Skip to Content
0
Former Member
Dec 01, 2005 at 05:32 AM

Strange problem of Pdf downloading with Web Dynpro

35 Views

Hi, experts, I have to setup a project to realize pdf downloading with web dynpro. But unluckily, I have tried all the methods in this froum ,there's really strange problem .Because when I click the link of Download UI link, there's no reaction at all, I really don't know why.Below is the codes I used , can anyone help me ? thank you very much!

public void wdDoInit()

{

//@@begin wdDoInit()

IWDAttributeInfo attInfo =

wdContext

.currentContextElement()

.node()

.getNodeInfo()

.getAttribute(

"Pdfsource");

ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();

IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) type;

binaryType.setFileName("test.pdf");

binaryType.setMimeType(WDWebResourceType.PDF);

try {

int length =

(int) wdContext.currentPdfdownloadElement().getBin_Filesize();

byte b[] = new byte[length];

b = wdContext.currentPdfdownloadElement().getBin_File();

wdContext.currentContextElement().setPdfsource(b);

} catch (Exception ex) {

}

"Pdfsource" is the context value attribute of type binary.And Bin_File is the xstring type parameter from my RFC contains pdf content.

I used two views and one customer-controller . I put some value in the first view to set search condition.and the second then appears and have the download UI element. Are there any additional codes I should use? pls help!