Can I count the number rows and read the data from each page

ok thanks a lot for ur help i wil wait for ur response
This message was posted using Aspose.Live 2 Forum

Hi,

Well, you may use:
CellArea [] area = worksheet.GetPrintingPageBreaks(printoption);

Then, you can count the number of rows and read the data from each page.

e.g

Workbook workbook = new Workbook();
workbook.Open(“e:\test\book1.xls”);
Worksheet worksheet = workbook.Worksheets[0];
ImageOrPrintOptions printoption = new ImageOrPrintOptions();
printoption.PrintingPage = PrintingPageType.Default;
SheetRender sr = new SheetRender(worksheet, printoption);
int pageCount = sr.PageCount;
MessageBox.Show(pageCount.ToString());
CellArea [] area = worksheet.GetPrintingPageBreaks(printoption);
MessageBox.Show(area.Length.ToString());
//Get the first page rows.
int strow = area[0].StartRow;
int stcol = area[0].StartColumn;

int numrows = area[0].EndRow - strow + 1;
int numcols = area[0].EndColumn - stcol + 1;



Thank you.

CellArea [] area = worksheet.GetPrintingPageBreaks(printoption);

GetPrintingPageBreaks does not work for the old versin and I am using old version 7.0.0.0

I request you to give the solution for the vesrion 7.0.0.0

Hi,

I am still not sure which version you are using, there is no such version of Aspose.Cells exists: 7.0.0.0.
Please see the document how you can get the version number: http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/check-version-number-of-the-component.html

Moreover, as I have mentioned you earlier, we cannot include new features/functionality or change/modify the API/existing functionality to some older versions. This is against our internal policies that we have always need to follow them. Also, as you know there might be many internal models / architecture etc. that are changed in the recent versions, so it is not practically feasible either to embed new API/functionality to some older versions.

As these are the new API, so, the only option is left for you is that you have to use new/latest version of the product to make use of these api.

Thanks for your understanding!

ow really sorry actually I am using vesrion 4.5.0.0

and this version doesn't allow GetPrintingPaeBreaks method. One more thing I am not using workSheet.PageSetup.FitToPagesWide=1; and workSheet.PageSetup.FitToPagesTall=999;

I can not use workBook.Worksheets[0].VPageBreaks or .HpageBreaks as per the poject requirements. hence please let me know how can i count the number of pages into the worksheet and how can i read the data row by row for each page.

Please suggest me the solution..

Thanks in Advance

Please ignore previous message.... Consider this one

ow really sorry actually I am using vesrion 4.5.0.0

and this version doesn't allow GetPrintingPaeBreaks method. One more thing I am using workSheet.PageSetup.FitToPagesWide=1; and workSheet.PageSetup.FitToPagesTall=999;

I can not use workBook.Worksheets[0].VPageBreaks or .HpageBreaks as per the poject requirements. hence please let me know how can i count the number of pages into the worksheet and how can i read the data row by row for each page.

Please suggest me the solution..

Thanks in Advance

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Well, I am afraid as you are using an older version of the product, you will not be able to implement this solution. You have to upgrade to a later version to use the new APIs. We do not have any solution for the version you are using (V4.5.0.0).

Sorry for the inconvenience,

ok no problem.

I have one more query....

I have created one Macro method in the excel sheet (excel sheet i have created using Aspose.cells) now I want call this Macro method using aspose.cells. How can i do that.

My Macro method is...

body { margin: 0 0 0 0; padding:0 0 0 0 } td,div { font-family:Tahoma;font-size:8pt;vertical-align:top } body { margin: 0 0 0 0; padding:0 0 0 0 } .transcript { background-color:#d2d2d2; } .messageBlock { margin-left:4px; margin-bottom:3px } .message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; } .messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;} .other { color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .myself { color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre; } .showTimestamp { margin-right:3px; float:right; color:#999999;font-style:normal;font-weight:normal; } .other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .tsDisplay { display:block }

Private Sub Workbook_Open()

Dim hPage As HPageBreak
Dim iPrvCellID As Integer
Dim iCurrentCellId As Integer

Worksheets("Sheet1").Select
iPrvCellID = 0
For Each hPage In Sheet1.HPageBreaks
If hPage.Location.Cells.Value = Empty Then
iCurrentCellId = hPage.Location.Row
For a_counter = iCurrentCellId To iPrvCellID Step -1
If Not ActiveSheet.Range(("A" & a_counter)).Value = "" Then
ActiveSheet.Range(("A" & a_counter)).EntireRow.Copy
ActiveSheet.Range(("A" & iCurrentCellId)).EntireRow.PasteSpecial xlFormats
ActiveSheet.Range(("A" & iCurrentCellId)).EntireRow.PasteSpecial
iPrvCellID = a_counter
GoTo NextPageBreak
End If
Next a_counter
NextPageBreak:
End If
Next hPage
End Sub

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am afraid your requested feature of running macros programmatically through Aspose.Cells is not supported. Aspose.Cells only supports to preserve the macros which are in your template file. It does not support to run macros. We have already registered this feature in our internal work list with issue id: CELLSNET-13561. We will look into it in future.

Sorry for any inconvenience caused,

Hi,

Thanks for using Aspose.Cells.

We only plan to create,
manipulate or embed VBA codes/ macros later. We however cannot support
to run or execute macros. Does it fit your needs?