We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word Document creation Using Aspose for Java

Hi,

Please help me out in doing a assignment using aspose. I am new to aspose. I herewith attached the sample output document. I need to format these data in a .rtf document., by leaving header, sub header footer and detailed section. Please help me out to format the report in this way.

Hi Uma,

Thanks for your interest in Aspose.Words. I believe, you can achieve this after reading the articles suggested below:

Please let me know if I can be of any further assistance.

Best regards,

Hi awais,

Thanks for your assistance. I need further clarification, please assist me.

How to wrap the text inside the rows, when the row text exceeds the column width ?

Can we use Indentation ? Please clarify me

Thanks,

Uma

Hi Uma,

Thanks for your inquiry. I think, you can use Table.AllowAutoFit property as follows:

Document doc = new Document ( ) ;
DocumentBuilder builder = new DocumentBuilder ( doc ) ;

Table table = builder . startTable ( ) ;
builder . insertCell ( ) ;
builder . write ( “Heading one” ) ;

builder . insertCell ( ) ;
builder . write ( “Heading twommmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm” ) ;

builder . insertCell ( ) ;
builder . write ( “Heading three” ) ;

builder . insertCell ( ) ;
builder . write ( “Heading four” ) ;

builder . insertCell ( ) ;
builder . write ( “Heading five” ) ;

builder . endRow ( ) ;
builder . endTable ( ) ;

table . setPreferredWidth ( PreferredWidth . fromPercent ( 100 ) ) ;
table . setAllowAutoFit ( false ) ;

doc . save ( “C:\Temp\Out.docx” ) ;

Also, please refer to the CellFormat.WrapText property. I hope, this helps.

Best regards,