| |

VerySource

 Forgot password?
 Register
Search
View: 3037|Reply: 17

How to control excel pagination?

[Copy link]

1

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-2-5 16:00:01
| Show all posts |Read mode
I would like to ask, when java generates Excel, the data is obtained from the database. Assuming that 100 pieces of data are obtained, how to control, so that Excel prints only 40 pieces per page and prints three pages? ?
Reply

Use magic Report

0

Threads

18

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 Belgium

Post time: 2020-3-26 19:45:01
| Show all posts
Use pagination
Control it
Reply

Use magic Report

0

Threads

63

Posts

42.00

Credits

Newbie

Rank: 1

Credits
42.00

 China

Post time: 2020-3-30 09:00:01
| Show all posts
〉 Java generates Excel

What is used to generate jxl, poi? Or did you write .xls directly, or did you generate a file called .csv? ? ?
Reply

Use magic Report

1

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 Mexico

 Author| Post time: 2020-4-3 14:15:01
| Show all posts
It is to find 100 records from the database and write them to the excel file. Now it has been written. There are already 100 records in excel. Now the excel file is printed out on paper. How to make each paper only have a maximum of 40 records Record, can it be achieved with java!
Shouldn't it be clear this time? My expressiveness may be poor, mainly because I don't understand it! !! !!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-4-3 16:45:01
| Show all posts
Divided into 3 Sheets? ?
Reply

Use magic Report

1

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-4-4 02:15:01
| Show all posts
Can you use only one sheet! ? Why do you need to separate sheets?
Reply

Use magic Report

0

Threads

63

Posts

42.00

Credits

Newbie

Rank: 1

Credits
42.00

 China

Post time: 2020-4-4 13:30:01
| Show all posts
I ask you, what is your "excel file" extension? What java framework is used to generate?

POI, such as HSSFWorkbook, HSSFSheet or JXL, such as Workbook?

I wo n’t say that, post the code
Reply

Use magic Report

1

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 United States

 Author| Post time: 2020-4-4 21:15:01
| Show all posts
"Excel file" extension is .xls, using struts framework,
public String createExcel (String str, String flag) throws BaseException {
Ranch
BaseSQLHandler baseSQLHandler = new BaseSQLHandler (false);
BaseDBConnection connection = baseSQLHandler.getBaseDBConnection ();

// create a new workbook
HSSFWorkbook workBook = new HSSFWorkbook ();
HSSFDataFormat format = workBook.createDataFormat ();
Reply

Use magic Report

1

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-4-5 11:30:01
| Show all posts
import org.apache.poi.hssf.usermodel. *;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.hssf.util.Region;
Reply

Use magic Report

1

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-4-5 22:00:02
| Show all posts
This time should be clear?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list