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

Free Support Forum - aspose.com

Webgrid functionality

hello aspose support,


I have Excel reports here that are calculated on the server ( using the aspose.cells functionality ). Now some clients need to be able to modify some cells and save them on the source file ( on the server ), through a webbrowser.

I understand the gridweb allows you to make an asp page through which you can see the content of an Excel file in a webbrowser, but…

1. Can it display graphical elements, such as plots and bar charts.

2. Can it handle the standard set of Excel formula’s ?

3. Limit the user to edit only a few cells on the spreadsheet

4. Save the file back on the server’s original location ?

5. Is there any file locking mechanism ?

thank you ofr your thoughts

a webgrid newbee.



Hi,


Thanks for considering Aspose

1) I am afraid, Aspose.Cells.GridWeb can’t display Graphs but you may make use of Aspose.Cells component APIs to convert the chart to image and then import that image to GridWeb which does support to display images in its Grid matrix.

2) Yes, it (GridWeb) does support most of MS Excel standard formulas/function, you may read, write and calculate the formulas at runtime in it. If you find any issue or some formulas are not supported, let us know with details, sample file and solution, we will check it try to support it (if not supported) soon.

3) Yes, it supports to lock a few cells in the worksheet, see the sample code for your reference:

WebWorksheets sheets = GridWeb1.WebWorksheets;
  <span style="color: rgb(0, 128, 0);">// Sets input entry.</span>
  <span style="color: rgb(0, 128, 0);">// Sets all cells readonly first.</span>
  sheets[0].SetAllCellsReadonly();

  <span style="color: rgb(0, 128, 0);">// Starts from row 3, column 2, 11 rows 1 colum, total 10 cells.</span>
  sheets[0].SetEditableRange(3, 2, 11, 1);</pre><pre style="padding: 0px; border: 1px solid rgb(255, 255, 255); background-image: none; background-attachment: scroll; background-color: rgb(255, 255, 255); font-family: 'Courier New', Courier, monospace; color: rgb(0, 0, 102); vertical-align: top; font-size: 12px; background-position: 0px 0px; background-repeat: repeat repeat;"><br></pre><pre style="padding: 0px; border: 1px solid rgb(255, 255, 255); background-image: none; background-attachment: scroll; background-color: rgb(255, 255, 255); font-family: 'Courier New', Courier, monospace; color: rgb(0, 0, 102); vertical-align: top; font-size: 12px; background-position: 0px 0px; background-repeat: repeat repeat;"><br></pre></div><div><br></div><div>4) You may use WebWorksheets.SaveToExcelFile() overloads and pick your desired version for your needs. Here, you may use your own code, e.g make use of Server.MapPath() to re-save or save as the file to your desired location.</div><div><br></div><div>5) Aspose.Cells.GridWeb does not support saving/rendering encrypting Excel files, you may use Aspose.Cells APIs for this purpose, e.g</div><div><a href="http://www.aspose.com/docs/display/cellsnet/Encrypting+Excel+Files">http://www.aspose.com/docs/display/cellsnet/Encrypting+Excel+Files</a></div><div><br></div><div><br></div><div>For complete reference on Aspose.Cells.GridWeb, please see the featured demos and Wiki docs.</div><div><br></div><div><br></div><div>Thank you.</div><div><br></div><div><br></div><div><br></div><div><br></div>

thanks.


regarding #1,

what happens if you show an excel file in a GridWeb application that has graphical elements ? Are they deleted, does an error occur, ar ethey automatically rendered as images ?

Please advise

guido

Hi Guido,

Thank you for your response.

In case the template Excel spreadsheet contains any graphical elements such as charts or related objects, they will automatically be rendered as images in GridWeb control, therefore you will not be able to control them in any manner.

great - i tested it out with a spreadhseet and it works great. Fantastic product !


For my application, I would need to append some client ( I assume javascript ) code that makes the gridweb component to take the full size of the webbrowser. So if the webbrowser resizes, I would like the gridweb component to follow along.
Do you have any code example of how to do that ??

I have to admit I did not fully understand your comment on saving the excel back onto the original location ( item #4 ). Do you have any code example.

Sorry for the inconvenience

guido





Hi Guido,

Thank you for your feedback.

You can set the GridWeb control to re-size according to the browser window by using the JavaScript function as provided below,

JavaScript

<div id="resizable" class="ui-widget-content"> <acw:GridWeb ID="GridWeb1" runat="server"> </acw:GridWeb> </div>

Regarding your question about saving the GridWeb results on disk or to some server location, you may use the WebWorksheets.SaveToExcelFile method. There are 4 overloads available providing you the choice of saving either to stream or to a file by specifying the file location. Please check the below linked technical article on this subject.
http://www.aspose.com/docs/display/cellsnet/Saving+an+MS+Excel+File

hello,


I have the licensed version of aspose.cells, but I am unable to make the webgrid object resize when the browser resizes. I realise you already sent me some javascript to do that, but I fail to make it work. Also, I used CSS but to no effect.

In fact, if the user resizes the screen, I want to resize the object and add/remove columns and rows as needed, whilst keeping the scrollbar. Is that possible.

Would it be possible to post a very simple Visual STudio project file that accomplishes that ?

Many thanks.

guido




Hi Guido,

Thank you for writing back.

The solution provided in our previous post works well on our side but it lacks your recent requirement to add/remove columns/rows to the control if browser window expands/retracts. The said JS solution adjusts the control size but does not add row/columns to the control when window size expands. A ticket has been logged in our database to look further into your requirement. Ticket Id for your future reference is CELLSNET-42337. Please spare us little time to properly analyze the request, and provide a solution for it. In the meanwhile, we will keep you posted with updates in this regard.

Hi Guido,


Please use the following JavaScript function to add/remove the rows/columns accordingly when GridWeb control expands/retracts.

JavaScript

$(function ()
{
$("#resizable").resizable(
{
resize: function (event, ui)
{
$("#GridWeb1").height($("#resizable").height());
$("#GridWeb1").width($("#resizable").width());
($("#GridWeb1")[0]).mOnResize(); } } );
}
);