Use C1Window to Get Configuration Info for C1XLBook

Posted by: carverjc on 10 September 2017, 11:39 am EST

  • Posted 10 September 2017, 11:39 am EST

    I have a webform that displays a dropdownlist of available reports, along with some other controls that enable the user to select report-configuration options that apply to all reports. When the user clicks "OK", control is passed to the applicable webform (which has no visible content) to instantiate a C1XLBook object, generate the report data, etc.; no problem. However, some of the reports also need to have the user select additional, report-unique configuration options, and that's where I'm running out of good ideas. Obviously I could include all of the options' controls on the main webform and hide/display them based on the currently-selected report in the dropdownlist; however, one of the unique-option reports is also to be generated when the user clicks a linkbutton on a totally different webform, so that's no help.

    What I'm trying to figure out is this: If I put a C1Window control on one of the report's webforms and pop it up to ask the user a question, what does the page-generation code look like then? If I insert the JavaScript code to close the C1Window (works fine by itself) and then save the C1XLBook and stream it into the HttpResponse (works fine by itself), or vice versa, the two actions stomp all over each other:

    "Error: Sys.WebForms.PageRequestManagerParserException: The message received from the server could not be parsed"

    Does anyone have any advice on how I can make this work? I.e., how do I close the popup, use the info it got from the user, and save the C1XLBook and pipe it to the HttpResponse?

    Thanks,
    Jeff
  • Replied 10 September 2017, 11:39 am EST

    Hello Jeff,

    You can save the value selected by the user in a hidden variable and cause Postback when the C1Window closes. In the Page_load event check for a postback and save the C1XLBook depending on the value of the hidden variable.

    If the above approach does not solve your problem then please share your sample.

    Thanks,
    Richa
  • Replied 10 September 2017, 11:39 am EST

    Hi, Richa,

    I really appreciate your response. The use of a hidden field for communication makes sense, but one thing continues to elude me: How, exactly, do I "cause Postback when the C1Window closes"?

    Thanks,
    Jeff
  • Replied 10 September 2017, 11:39 am EST

    Hello Jeff,

    You need to handle the "OnClientHidden" client side event of C1Window which iss fired when window is closed/hidden.
    To do postback you can use "document.forms[0].submit();" in this event.

    Please find attached a small sample in which postback is observed when C1Window is closed and a hidden value is set which can be used in server side.

    Thanks,
    Richa
    2011/07/Sample_Window.zip
  • Replied 10 September 2017, 11:39 am EST

    Thanks, Richa, that was exactly what I needed!

    Jeff
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels