You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "parthi.fb" <pa...@gmail.com> on 2012/03/05 15:16:30 UTC

Way to Use row with in a cell


Hi all,


I am having a scenario where i have to declare the number of rows and
columns dynamically based on the results cominf from db.

I need to generate this excel file as a calender format, which have 1 to 31
days as column headers, where as the 1st row of each column will have a
student name.

Problem is, we can create number of rows bcoz the result set size may vary
based on the number of students available for each class. But the number of
column will vary for every month. this is one thing. Another problem i am
facing is, 

I need to generate this excel to display the dates of the exams for every
class students. In this case a student may have a re_test or arrear exam in
the same day(mrng and afternun) but these two conditions are saved as
different records in DB with same date. So i used a group by class to
combine these two subject names and date in one single row seperated by
comma( EG: column1 (18,18), column2(Eng,Mat) where 18 is the date). also i
ll get all the subject and the date of the exam for every student. (EG: 1st
- Chemistry,   5th - geography etc) all i have to do is to populate the
subject on the respective dates(i.e respective column in my excel Eg: if a
student is having exam in 6th date, i need to fill that cell with the exam
subject, say: english)


Somebody give me some suggession for this.. I can be able to generate this
in PDF where i am well knowledged in that, but this POI excel generation is
too new to me....


Thanks,
Parthi

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Way-to-Use-row-with-in-a-cell-tp5537635p5537635.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Way to Use row with in a cell

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
The best place to start would be by looking at the quick guide -
http://poi.apache.org/spreadsheet/quick-guide.html. It can tell you how to
create workbooks, sheets, cells and so on. Once you have a handle on that,
try to replicate the layout you are see on the PDF. If you are new to Excel,
it is an application that allows you organise data into tables - crudely.
One Excel file - called a workbook - can contain one or more sheets. Each
sheet will contains data organised into cells that are at the intersection
of a row and column.

I am going to guess that this is some sort of tabular layout of the data you
are reading from the database; with the data will be arranged into a series
of rows and columns. If this is the case, all you need to do with POI is to
create a row on a sheet where a row would appear on you PDF table, create a
cell on this row for each item of data and then populate that cell.

It might help answer your question if you could post an example PDF. I am
not at all sure I understand what you are asking but it should be possible
to achieve with POI.

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Way-to-Use-row-with-in-a-cell-tp5537635p5538024.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org