cancel
Showing results for 
Search instead for 
Did you mean: 

WD View to MS Word

former_member720137
Active Participant
0 Kudos

Hi all

I have a requirement to convert a WD View into a MS Word file. My View contains Table, I/P Fields and Check boxes..

I have already referred to this thread

I am able to generate Word File, and bring a simple context attribute as a string in the Word File. What I want to know is how do I bring data from a Web Dynpro table to the Word file. I can bring individual data fields of the table by accessing the attributes again, but I wish to show that data in table format itself inside the Word file.

Regards

Puneet

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Puneet,

Check these links:

<a href="/people/anilkumar.vippagunta2/blog/2007/02/01/office-control-in-webdynpro--i controls 1</a>

<a href="/people/anilkumar.vippagunta2/blog/2007/02/04/office-control-in-webdynpro-ii control 2</a>

hope it will be helpful.

regards

Sumit

former_member720137
Active Participant
0 Kudos

Hi Sumit,

I have edited my question, I guess you weren't able to understand my problem.

Regards,

Puneet

Former Member
0 Kudos

Hi Puneet,

Check the following link

regards

Anil

Former Member
0 Kudos

Puneet,

Try to stream out a MS word compatible XML by using the appropriate XML Schema Reference. You may check out <a href="http://www.codeproject.com/aspnet/word2003.asp">this</a>.

Maybe you can also check out <a href="http://poi.apache.org/hwpf/docoverview.html">Apache's POI</a>.

Bala

former_member720137
Active Participant
0 Kudos

Hi Bala

I didnt get wat u said.. can u give me some ex in WD itself..

Regards

Puneet

Former Member
0 Kudos

Puneet,

I couldn't have explained better than that. Anyways, to keep things straight, I've put here a pointer code that

you have to extend according to your requirement. If my brain serves well, I was able to recall only this much of stuff what so over I've used long ago.

To start with, add the library to your WD project. You can get the library from

<a href="http://veritris.com/mirrors/apache/poi/release/bin/poi-bin-3.0.1-FINAL-20070705.zip">here</a>.

Then you have your conventional Office UI control and its related attribute mapping, etc.. Once

you are done with the empty .doc file creation, use the following code:


HWPFDocument doc = new HWPFDocument(new FileInputStream(<your doc file>));
CharacterRun run = new CharacterRun();
run.setBold(true);
run.setItalic(true);
run.setCapitalized(true);

Range range = doc.getRange();
int col=5;
int rows=5;
TableProperties tableprops = new TableProperties(col);
range.insertBefore(tableprops , rows);

This is not the complete code. Also, you may need to modify this stuff as per your

needs. I've not verified if this works correctly (<i>as I don't have NWDS with me right

now</i>), but it should work..

Refer appropriate

Java docs and manipulate the doc and you should be able to achieve it !!

Bala

former_member185029
Active Contributor
0 Kudos

Hello Punit,

Have you heard of Office 2003: XML Reference Schemas?

You can download these schema files (and help) <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=FE118952-3547-420A-A412-00A2662442D9&displaylang=en">here</a>

It allows you to create Excel/Word files with virtually all functionality you want.

Ashu

Former Member
0 Kudos

Hi Puneet..

Chk this..

(This will solve your problem)

Hope this will help u

Urs GS