Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • Issue exporting to client with export filename containing single quote characters.

    Isomorphic,

    I am using the following code to export as pdf to the client. This works fine unless the export filename contains more than one single quote character.

    Code:
    DSRequest requestProperties = new DSRequest();
    requestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
    requestProperties.setExportFilename("MyChart");
    RPCManager.exportContent(AbstractChart.this, requestProperties)
    Without single quotes in the export filename, the HTTP request URL looks like this:

    Code:
    http://127.0.0.1:8888/sandbox/sc/IDACall/MyChart?isc_rpc=1&isc_v=v10.1p_2017-03-11&isc_tnum=68
    With single quotes in the export filename (e.g 'My'Chart), the HTTP request URL is truncated:

    Code:
    http://127.0.0.1:8888/sandbox/sc/IDACall/'My
    The HTTP response has the following exception:

    Code:
    java.lang.Exception: Non-RPC request ignored.<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:2105)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.rpc.RPCManager.&lt;init&gt;(RPCManager.java:370)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.rpc.RPCManager.&lt;init&gt;(RPCManager.java:350)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:147)<BR>
    SmartClient Version: v10.1p_2017-03-11/Pro Deployment (built 2017-03-11)
    Chrome Version: 59.0.3071.115 (Official Build) (64-bit)

    Thanks.

  • #2
    It works with double quotes but these are encoded in the request URL.

    Code:
    http://127.0.0.1:8888/sandbox/sc/IDACall/%22My%22Chart?isc_rpc=1&isc_v=v10.1p_2017-03-11&isc_tnum=104

    Comment


    • #3
      Hi Isomorphic,

      Do you have an update on this? Is it possible to escape single quote characters in the export filename or do they need to be removed/replaced.

      Thanks.

      Comment


      • #4
        Sorry for the delay. No, single quote characters should not be escaped or removed, there was a bug. It is fixed now and will be available for download in nightly builds since Aug 10 (tomorrow). Let us know please how it worked for you.

        Comment


        • #5
          It works with the Aug 10 build. Thanks!

          Comment


          • #6
            Isomorphic,

            I've done some additional testing and there appears to be an issue with using / or \ characters in the export filename as well. In this case, the request URL looks to be generated correctly, however, there is no content-disposition header in the response.

            Code:
            HTTP/1.1 400
            Content-Length: 0
            Date: Fri, 11 Aug 2017 13:52:53 GMT
            Connection: close
            Thanks.

            Comment


            • #7
              This is due to Tomcat not allowing encoded slash characters in the request URL for security reasons.

              Comment


              • #8
                We'd reached a similar conclusion just now - it doesn't appear that there's anything we can do client-side as we have already encoded the character correctly, and server-side, Tomcat stops the request before it reaches our code.

                So if you want to allow this character it will require a Tomcat settings change.

                Comment

                Working...
                X