We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Excel 97-2003 image in header performance issue in page layout

Greetings,


I have followed your examples to add a header/footer image to excel files .

It works ok, but when I am adding an image with aspose cells into a excel 97-2003 file with a lot of pages, the page layout view freezes when trying to access the sheet with the header image.

I tried adding the same picture (png) from the office 2010 excel client and it works ok and I am guessing it does some post processing of the image.

Any input would be greatly appreciated.

Thank you,

Dan

Hi,


Could you try our latest version/fix: Aspose.Cells for .NET v8.0.1.3 if it makes any difference.

If you still find the issue, kindly do provide us a sample console application (runnable), you may zip it prior attaching here to reproduce the issue on our end, we will check it soon. Also provide any template Excel or other image files here, it will help us really to figure out your issue more precisely.

Thank you.
Amjad Sahi:
Hi,

Could you try our latest version/fix: Aspose.Cells for .NET v8.0.1.3 if it makes any difference.

If you still find the issue, kindly do provide us a sample console application (runnable), you may zip it prior attaching here to reproduce the issue on our end, we will check it soon. Also provide any template Excel or other image files here, it will help us really to figure out your issue more precisely.

Thank you.

Hello,

Thank you for the quick answer. I have tried with 8.0.1.3 and it behaves the same.

I have created a small console application with the example and the file that has the problems.

You can find the example in the attachment.

Thank you,

Dan

Hi,


Thanks for sample project with template file.

After an initial test, I observed the issue as you mentioned by using your sample project with your template file. It takes lots of time when navigating b/w worksheets in MS Excel after opening the output file into it. We need to investigate and look into it in details. I have logged a ticket with an id “CELLSNET-42616” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.
Thank you for your quick response and support. I am a developer at intralinks, and they are paying customers. Could we get an estimate for this?

Thank you,

Dan

Hi,


Well, your issue is currently pending for analysis. Once our concerned developer evaluates your issue thoroughly, we will be in better position to update on it or share an eta if possible. Generally if an issue is not complex, it takes only 3-5 days to resolve the issue, if it is complex, it might take a couple of weeks or more time. Hopefully, your issue is not a complex one and would be fixed before the end of next week.

PS. I have also logged your concerns against your issue “CELLSNET-42616” into our database and asked the relevant developer to share an update or an eta (if possible).

Once we have any update on it, we will let you know here.

Thank you.

Hello,


Thank you for the answer. Do you have some new info on the issue ?

Also, I have found another issue. The simulated “watermark”, meaning the picture added in the header, is under the images / charts found on the sheets.

Is there any way to bring the image in front of everything? From what I know that is the best / legitimate way to simulate a watermark in excel files.

Thank you,

Dan

Hi,


We checked the status of your original issue (“header image performance issue in PageLayout view”), it is fixed now. Hopefully, we will provide you the fix in the next a few days (3-5 days) after some extensive testing and incorporating other enhancements etc.

Regarding your other issue, could you please post your sample code (preferably a sample console application (runnable)), zip it and post it here with all the details to reproduce the issue on our end. we will check it soon. Also provide some screen shots and sample files (output file (by Aspose.Cells) and your expected file (created in MS Excel manually), it will help us really to evaluate your issue more precisely to consequently figure it out soon.

Thank you.

Hello,


Thank you for your help. I have attached an example with a file that acts the way I have described before.

The result ZIndex-guid.xls watermarked file has on gui1_bysecond a graph that is in front of the image in the header. Is there any way to bring it in front?

Any news with the first fix?

Thank you,

Dan

Hi,


Thanks for the sample project.

I have tested your scenario/ case a bit using your sample project and noticed the behavior as you mentioned. The chart object is always in front of header/image. I tried to accomplish the task in MS Excel manually but in vain. I think this is the behavior of MS Excel where the chart object would be always in front of the the header picture, you may confirm this behavior in MS Excel manually. I could not make it work by Send to Back option in MS Excel either, so it is the limitation of MS Excel. If you still think it is possible in MS Excel, kindly provide a sample file that you could create in MS Excel manually containing your desired header picture set in front of Chart, save the file and post us there, we will check it how to do it via Aspose.Cells APIs.

Thank you.

Hello,


Thank you for the quick response. I thought it to be an office limitation on the header image too, but wanted to confirm that. Is there any other way that this could be done, another way to insert the image instead of the header and still be decent at the execution time?

Thank you,

Dan

Hi,


Well, I am not sure if this is possible or any workaround as MS Excel itself can’t do it. Anyways, we will check if we could find some way. If we found any approach or other workaround to accomplish the task, we will let you know here.

Thank you.

Hello,


Thank you Amjad. I was thinking of adding the shape many times in every sheet. What would be the challenge here, is the way of calculating the position where I have to insert the images, so that they could show on every a4 page at print time. Is there a easy way of doing that?

Thank you,

Dan

Hi,


Please download and try our latest fix/version: Aspose.Cells for .NET v8.0.2.1

We have fixed your issue “CELLSNET-42616” now.

Let us know your feedback.

Thank you.

Hello,


We have tried the fix and it worked in our first tests, fixing the problem with the non responsive excel files.

Thank you for your support!

Is there any way to get beginning position of every page in excel with aspose cells?

Thank you again,

Dan

Hi Dan,


Good to know that your issue is resolved by the new fix.

Regarding retrieve the first cell/beginning position of every page, you may try the following sample code for your reference:
e.g
Sample code:

Workbook workbook = new Workbook(“e:\test2\ExcelReport.xlsx”);
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());

for (int i = 0; i < area.Length; i++)
{

//Get the first page rows.
int strow = area[i].StartRow;
int stcol = area[i].StartColumn;

MessageBox.Show("Page " + (i+1).ToString() + " : " +CellsHelper.CellIndexToName(strow, stcol));

}


Hope, this helps a bit.

Thank you.


The issues you have found earlier (filed as CELLSNET-42616) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hello,


We have encountered another very interesting problem that appears in our system while using aspose cells. After we insert the watermark in the exact same way as explained above, meaning that we add a picture into the header, we have to insert it into a rights management system that protects the excel file. If we insert watermark with aspose cells, after protecting the document we get all the charts in document broken, meaning that the graphs are not linked to the data any longer.

If we do the same thing that we do with aspose cells manually, everything works fine.

This happens with both xls and xlsx files (while in xls it brakes the graph and shows all the values on zero, the chart disappears completely in the xlsx files).

My guess is that aspose cells does something different than adding it manually from the excel office client, something that may further break the structure in irm systems.

I have attached 4 files

  • 2 (same thing but in 2 formats, xls and xlsx) with the image added into the header manually
  • 2 (same thing but in 2 formats, xls and xlsx) with the image added in the header with aspose cells
So practically aspose does something different in the file than doing it manually in office and that may affect future file processing.

Maybe you can take a look in the file structure and see what differs from the manually insterted watermark version.

The code used for this is very simple:

public static void InsertImageXLS_X(string path, byte[] img)
{
Aspose.Cells.FileFormatInfo info = Aspose.Cells.FileFormatUtil.DetectFileFormat(path);
if (info.LoadFormat == Aspose.Cells.LoadFormat.Xlsx || info.LoadFormat == Aspose.Cells.LoadFormat.Excel97To2003)
{
Workbook workbook = new Workbook(path);
//Creating a PageSetup object to get the page settings of the first worksheet of the workbook
foreach (Worksheet sheet in workbook.Worksheets)
{
sheet.ViewType = ViewType.PageLayoutView;
Aspose.Cells.PageSetup pageSetup = sheet.PageSetup;
pageSetup.SetHeader(1, “\n \n \n \n \n \n \n &“Times New Roman”&C&G”);
pageSetup.SetHeaderPicture(1, img);
}
workbook.Save(path);
}
}


Thank you,

Dan

Hi,


Thanks for providing us some details and sample files .

I could not evaluate your issue properly with your provided files. I think the charts (in the output Excel files (via Aspose.Cells APIs)) are linked to the data source but are somehow spanned over more pages of the sheet. Could you also provide your source files and complete sample project (runnable) to investigate the issue on our end. Also, provide the image file that you are setting into Header/Footer section with some separate screen shots to highlight the problematic areas. All this help us to look into your issue more precisely to consequently figure it out soon.

Thank you.

Hello,


I have attached a project example that adds a picture into the header. I cannot give you the final result file that has the problem because it is a protected file with www.doctrackr.com (but we can create a test account for you to test with).

However, I have attached a print screen showing how the graph from the chart looks like. The binding with the data is somehow lost and all the points are to zero.

In xlsx files, the charts disappear completely.

If we protect a file with the same picture added into the header manually, the chart works just fine.

Thank you,

Dan