Error Code 103 & 102

clock April 29, 2015 17:31 by author htmltreegrid

A few of you have reported this error, and we just wanted to ensure you knew what it means

Error Code 103 = Trial version expired. 

Error Code 102 = Build is deployed on a server it is not licensed for. This happens if there is a change in your URL, or the URL that you are deploying the file on is not the same URL that you embedded in your build request that you submitted when you purchased the product.

In either case, for 103, you just need an updated trial, and for 102, you may submit a build request with the correct information

 

 



Excel, Word and Html Export and the Echo URL

clock April 29, 2015 04:39 by author htmltreegrid

This is another topic that we get some questions from our customers about:

When the HTMLTreeGrid is used to export data, the file generated can be saved onto the users desktop in one of two ways

 

  • Using the downloadify library, where the file is saved directly on the client (Downloadify internally uses the Flash player plugin)
  • Using server buffering - The generated text is sent to the server, and the server buffers it back as a file. The grid has a property, grid.excelOptions.echoUrl  - this defaults to http://www.flexicious.com/Home/Echo. 

 

When you do a export , we basically build a string on the client application. If Flash player is available, we will use it via the downloadify library. If not, we need to go through the traditional http File Buffering process. So what we do is this : We build the excel/word/html string, and send it to the server, which simply writes it back, in addition to setting the content type. Now, we advise that you implement your own url to buffer this string back, but do provide our own url - the one mentioned above to perform the buffering. The server side code for this is very simple:

//This is C# code, you could just as easily do the same thing in Java or PHP or whatever it is that sits on your server.

            var extension = Request["extension"];
            var contentType = Request["contentType"];
            var body= Request["body"];
            Response.ClearContent();
            Response.AddHeader("content-disposition", string.Format("attachment; filename=Download.{0}",extension));
            Response.ContentType = contentType;
            Response.Write(body);
            Response.End();

As always, do not hesitate to reach out if you have any questions.


EDIT : With the new 2.0 release, we have included support for filesaver, so you can have downloads without the need for Flash player.

On modern browsers, you can do file save without the need for having flash. So the download mechanism will check to see if filesaver exists and is supported, if so, will use that. If it is not there or is not supported, it will fall back to flash. All you have to do is to use the new release and include FileSaver.js. If you include our PDF support, FileSaver is automatically included.

 

<script type="text/javascript" src="http://htmltreegrid.com/demo/external/js/thirdparty/jspdf-combined.js"></script>

You can also import filesaver independently:

https://github.com/eligrey/FileSaver.js/