0

We need to provide a "export to excel" option, the problem is that all data comes from a WCF service (also developed by us). In the binding configuration we cannot increase the default value (that's the rule).

So, the main concern is how to get all data through the WS?, or if there is a better approach to export to excel, using WCF.

This is the code we use:

[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public static Result getDataFromDB() {
    using (AppServiceClient ws = new AppServiceClient()) {
        return ws.getAllDataFromDB();
    }
}

Result is where all data will be returned, which has a list attribute with all data.

When executing the method above, an error raises indicating the max cuota has reached.

gabaros
  • 743
  • 1
  • 6
  • 24
  • Check http://stackoverflow.com/questions/884235/wcf-how-to-increase-message-size-quota – jparaya May 21 '15 at 21:28
  • @jparaya - OP said **"we cannot increase the default value (that's the rule)."** – Tim May 21 '15 at 21:35
  • Take a look at [Streaming or Chunking](http://blogs.msdn.com/b/webapps/archive/2012/09/06/wcf-chunking.aspx) – Tim May 21 '15 at 21:36
  • @Tim you're right. My mistake. Thansk for the clarification – jparaya May 21 '15 at 21:49
  • thanks jparaya. I meant we are not allowed to increase the value. – gabaros May 21 '15 at 21:49
  • Hmm I'm not really sure if this can help, but in our case we were forced in certain circumstances to send the data in a different format. For example, concatenating the entire rows in one line, separated by a special char. Can you send the data as csv, for example? – jparaya May 21 '15 at 21:48
  • Thanks @Tim, Streaming was the way to go. – gabaros Jun 11 '15 at 18:26

0 Answers0