How to write in a JSP page WORD document pagination code? Thank you!

Category: Web Develop
 
fangxian76
2011-07-22 06:33:52

Sponsored Links
I'm in a JSP page needs to display the data as WORD format, Will you master how to write in a JSP page breaks inserted WORD code? Thank you!

Sponsored Links

xiaoma596
2011-07-22 06:48:29
int i;
int ipage = 5; / / paging unit
int allpage; / / total pages
int pages; / / variable to accept the page
int cpage = 1; / / this page
int spage; / / Start Page
String userId = (String) session.getAttribute ("userId") ;/ / get the username
/ / database connection statement
String sql, pagesql;
ResultSet rs, pagers;
pagesql = "select count (*) as A from logInfo where userID = '" + userId + " '";

/ / fetch Total Posts
pagers = DBConnection.executeQuery (pagesql);

pagers. next ();

int allCol = pagers.getInt (1);

/ / get the total number of pages
allpage = (int) Math.ceil ((allCol + ipage-1) / ipage);

/ / determine whether the parameter pages empty
if (request.getParameter ("pages") == null) {
pages = 1;
} else {
pages ; = new Integer (request.getParameter ("pages")). intValue ();
}

/ / determine the current page
if (pages> allpage | | pages == 0) {
cpage = 1;
} else {
cpage = pages;
}

/ / judge Start
spage = (cpage-1) * ipage;
sql = "select userLog, normalDate from logInfo where userId = '" + userId + "' order by normalDate desc limit" + ; spage + "," + ipage + "";

rs = DBConnection.executeQuery (sql);
not know sections of the code there is no help for you, you mean not want to know this is a WORD document is the first few pages of it? If it is on you to help yourself to see changed is probably the effect you want.
yezi0805
2011-07-22 06:55:00
query with a subquery engage ah

use a for loop variable
select top n is the page number of the information displayed from table where id not in (select top page shows the number of messages * n id from table name)
Ideas like this
yinhaiweng
2011-07-22 06:59:06
Earth too dangerous, in my post I almost half an hour after and friends say goodbye! Thank sofa, and probably is not expressed clearly what I mean, I mean how to write in a JSP page MSWORD insert a page break code. Thank you also on the second floor of a friend, although you did not find out exactly what I mean
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.