我有数据来生成具有页眉页脚和内容的报告。IOS有一个报告生成器在PDF中生成
在内容有当每个组在页面区域的数据把它添加新的页面,写组和持续的内容数据
我在哪里可以LIB的头多组。或者做什么这个任务?
感谢您的提前。
添加请求的代码
NSArray *headObject = [uniqueStates allObjects];////Store head of each group
NSArray *detail; //Store all of data to present in table
int allData = [detail count]; // Tel amount of all data to show
/*
int headGroupline = 1; //Tel amount of head group line
int footGroupline = 1; //Tel amount of foot group line
*/
int detailIndex = 0; ///Tel what line we are now
int detailHeadIndex = 0; ///Tel what group we are now
int subdetail = 0; // Tel what line on group now
int aviableLineInpage = 24; // Line avilable in page for data to show
int allPage = 0; //Sum of all page
for (; detailIndex < allData;) {
allPage++;
for (int i=0; i < aviableLineInpage;) {
if (allData - detailIndex == 0) {
///ShowgrandTotal
........
detailIndex++;
i+=25;
}else{
if (i == 0) {
//Show Head Group
......
}else{
if (subdetail == [[detail filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"(buy_date == %@)", headObject[detailHeadIndex]]] count]+1) {
detailHeadIndex++;
//Show Head Group
..........
}else{
if (subdetail == [[detail filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"(buy_date == %@)", headObject[detailHeadIndex]]] count]) {
//Show sum of each group
..........
i++;
detailIndex++;
subdetail++;
detailHeadIndex++;
}else{
//Show data of detail
........................
detailIndex++;
subdetail++;
}
}
}
i++;
}
}//for all line in page
}//for allData
它的格式是:
日期27/01/2014
数据1
数据2
数据3
和日期27/01/2014
date 28/01/2014
data1
DATA2
< ============如果页面制动添加新的页面和
日期28/01/2014
数据3
和日期28/01/2014
总计........
而且走得
日期27/01/2014
数据1
数据2
数据3
和日期27/01/2014
数据1
数据2
< ============如果页面制动添加新的页面和
日期28/01/2014
数据3
总计........
非常感谢
所以你想根据你的数据做一个pdf? – Retro
是的我有一个数据@Retro – Peerax
我已经使用coreGraphics生成了具有不同表格和不同行的动态页面pdf,所以你想要这样吗? – Retro