cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert TDFormat and TDline to PDF

yogesh_galphade
Contributor
0 Kudos

Dear All

I am using IFrame to show PDF file, using RFC to get the data which is having attribute TDformat and TDline. When I try to execute the application data gets corrupted.

How to use this parameter to show the pdf. I am using following code:

+wdThis.wdGetC_SalaryCardController().getDetails(); +

+ +

+ String pdfOutput = new String(wdContext.currentPdf_TabElement().getTdformat());+

+ wdContext.currentDatasourceElement().setBin_file(pdfOutput);+

+ +

+ byte b[] = pdfOutput.getBytes();+

+ +

+ if (pdfOutput != null){+

+ try{+

+ IWDCachedWebResource resource = WDWebResource.getWebResource(b, WDWebResourceType.getWebResourceTypeForFileExtension("pdf"));+

+ //WDWebResourceType.getWebResourceTypeForFileExtension("pdf");+

+ +

+ resource.setResourceName("SalaryCard");+

+ IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(resource.getURL(), "SalaryCard", true);+

+ // Display the PDF to the browser +

+ wdContext.currentContextElement().setUrl(resource.getURL());+

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Yogesh,

You can try concatenate entire table into a variable of type xstring (in your RFC function) with the sentence CONCATENATE .......... INTO ..... RESPECTING BLANKS.

In WebDynpro you will parse the value from this variable to pdfOutput.

This solution it's because your code not consider all lines of the TD table, and concatenate this table in WebDynpro can bring troubles for you.

I hope this help you.

Regards,

Simon.