I am new to iscripts. I have tried to follow the help docs. Placed the pc to xls code in a derived field formula. placed the example given in a function called iscripts_pctoxls() in a weblib.
given full access for the iscript created.
Called the function from a push button on my page.
I am getting the following error.
Response.setcontenttype not available in this context. (2,967) derived_sri.perf053.fieldformula name:xml_init_file PCPC:3763 statement:88
called from : weblib_eocf.iscript1.fieldformula name : Iscript_pctoxls statement:2
called from:derived_sri.xfercode.fieldchange statement:1
this method cannot be run in current context. access to response methods write, writeln, clear and setcontenttype is not available.
pls let me know how to use it since i want to generate an excel based on my grid. The one feature available on the grid to extract an excel will not work for me.
Also i need some guidance on how to pass the rowsets to the iscript function.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Below is part of my code I used to make this work; you might find something in here that points to the problem you are having. Also, the following code has the example on how to pass parameters.
Note, the code below is partial, it is not the entire code. Reference the Manual for the complete coding instructions.
Hope this helps.
/*******************************************************************/
/* On PushButton/HyperLink FieldChange Code */
/*******************************************************************/
Function Execute_Report(&IScript, &Weblib_Field, &prcs);
&html_window_open = " window.open(""" | GenerateScriptContentRelURL("EMPLOYEE", "ERP", Record.WEBLIB_EXAMPLE, @(&Weblib_Field), "FieldFormula", &IScript | "?prcs=" | &prcs) | """);";
REPORT_WRK.HTMLAREA = "<script>" | &html_window_open | &html_function | &html_timer | "</script>"; /*This HTMLAREA field is on the page "REPORT_OKAY". */
TransferPage(Page.REPORT_OKAY); /*I send users to a default page to say that their report was executed.*/
End-Function;
/*********************/
/* Main Process */
/*********************/
&prcs = Get_Next_Report_PI(); /*My own PI counter*/
If &prcs <> 0 Then
Save_RC(&prcs); /*I save the data on the page to my own record with PI as my primary key on the table*/
DoSave();
&IScript = "IScript_Example"; /*this is the name of the function in the WebLib*/
&Weblib_Field = "Field.Example"; /*Replace "Example" to be the fieldname; could be "Field.Descr". Keep the words "Field" at the beginning.*/
Execute_Report(&IScript, &Weblib_Field, &prcs); /*See the function above.*/
End-If;
I am new to iscripts. I have tried to follow the help docs. Placed the pc to xls code in a derived field formula. placed the example given in a function called iscripts_pctoxls() in a weblib.
given full access for the iscript created.
Called the function from a push button on my page.
I am getting the following error.
Response.setcontenttype not available in this context. (2,967) derived_sri.perf053.fieldformula name:xml_init_file PCPC:3763 statement:88
called from : weblib_eocf.iscript1.fieldformula name : Iscript_pctoxls statement:2
called from:derived_sri.xfercode.fieldchange statement:1
this method cannot be run in current context. access to response methods write, writeln, clear and setcontenttype is not available.
pls let me know how to use it since i want to generate an excel based on my grid. The one feature available on the grid to extract an excel will not work for me.
Also i need some guidance on how to pass the rowsets to the iscript function.
Thanks
Below is part of my code I used to make this work; you might find something in here that points to the problem you are having. Also, the following code has the example on how to pass parameters.
Note, the code below is partial, it is not the entire code. Reference the Manual for the complete coding instructions.
Hope this helps.
/*******************************************************************/
/* On PushButton/HyperLink FieldChange Code */
/*******************************************************************/
Function Execute_Report(&IScript, &Weblib_Field, &prcs);
&html_window_open = " window.open(""" | GenerateScriptContentRelURL("EMPLOYEE", "ERP", Record.WEBLIB_EXAMPLE, @(&Weblib_Field), "FieldFormula", &IScript | "?prcs=" | &prcs) | """);";
REPORT_WRK.HTMLAREA = "<script>" | &html_window_open | &html_function | &html_timer | "</script>"; /*This HTMLAREA field is on the page "REPORT_OKAY". */
TransferPage(Page.REPORT_OKAY); /*I send users to a default page to say that their report was executed.*/
End-Function;
/*********************/
/* Main Process */
/*********************/
&prcs = Get_Next_Report_PI(); /*My own PI counter*/
If &prcs <> 0 Then
Save_RC(&prcs); /*I save the data on the page to my own record with PI as my primary key on the table*/
DoSave();
&IScript = "IScript_Example"; /*this is the name of the function in the WebLib*/
&Weblib_Field = "Field.Example"; /*Replace "Example" to be the fieldname; could be "Field.Descr". Keep the words "Field" at the beginning.*/
Execute_Report(&IScript, &Weblib_Field, &prcs); /*See the function above.*/
End-If;
/*******************************************************************/
/*******************************************************************/
/*******************************************************************/
/*******************************************************************/
/* On WebLib */
/*******************************************************************/
Declare Function xml_init_file PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_init_style PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_style_alignment PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_style_border PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_style_font PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_style_interior PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_style_numberformat PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_style_protection PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_finalize_style PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_init_worksheet PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_init_namedRange PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_init_col PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_init_row PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_cell_char PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_cell_formula PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_cell_datetime PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_cell_number PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_pagebreak PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_format_header_or_footer PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_finalize_worksheet_pagesetup PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_finalize_worksheet_print PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_finalize_worksheet_split PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_finalize_worksheet_allowoptions PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_finalize_workbook PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Declare Function xml_cell_comment PeopleCode EXAMPLE_XMLLINK.XMLLINK FieldFormula;
Function IScript_Example();
&prcs = %Request.GetParameter("prcs");
/*More Coding for Page*/
End-Function;
thx. iam able to get it now.