Forum Stats

  • 3,782,429 Users
  • 2,254,644 Discussions


Form output to csv

Paulo Ventura
Paulo Ventura Member Posts: 35
edited Mar 19, 2018 10:37AM in Forms

Hi everyone!!

guys, I have a "problem" here in my work and wonder if you could give me a hand!

I have a form that generates a report.

In it's trigger, has that code that call that report:

if :blk_parameters.cb_excel = 'N' then    w_file_name := get_form_property('form507f',file_name);   w_pos := instr(w_file_name,'form507f');   w_nm_dir := substr(w_file_name,1,w_pos-1);pl := create_parameter_list( 'report507r' );add_parameter( pl, 'p_condicao', text_parameter, w_condicao );add_parameter( pl, 'PARAMFORM', text_parameter, 'NO' );run_product ( reports,w_nm_dir ||'report507r',asynchronous,runtime,filesystem,pl );destroy_parameter_list( pl );

as you can notice, there's an IF that checks if the flag is marked or not. if N, means that it shall call the report, which is already okay.

If there's Y, it shall (I'm developing it) generate that report in excel (could be csv file).

I do need to create a second report and call it from form like this or does we have a simpler, easiest solution running directly from the form? ofc, respecting the IF where is seted if it should or not be excel (csv) file.

   elsefile_name := 'c:\data\report'||to_char(sysdate,'dd_mm_yyyy')||'.csv';pl := create_parameter_list( 'report508r' );add_parameter( pl, 'p_condicao', text_parameter, w_condicao );add_parameter( pl, 'p_operadora', text_parameter, w_parametro );add_parameter( pl, 'PARAMFORM', text_parameter, 'NO' );add_parameter( pl, 'DESNAME', text_parameter, file_name);run_product ( reports,          w_nm_dir ||'report508r',        asynchronous,        runtime,      filesystem,      pl );destroy_parameter_list( pl );    message ( 'your file will be generated at'||file_name||'!' );   end if;  

Thanks in advance!!



  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,940 Employee
    edited Mar 16, 2018 6:52PM

    In the future, please be sure to include the relevant product versions you are using.  I'm going guess and say this code likely comes from pre-6.0.8.  The exact version might help whoever decides to offer suggestions.

    If you happen to be be using Forms or newer, this might be a good time to update some of your code to be more compatible with newer versions since you may decide to do that eventually.  Some of your current code won't run in anything newer than 6.  For example RUN_PRODUCT is now obsolete.  These calls should be replaced with RUN_REPORT_OBJECT, which is supported in and newer (although using or newer was recommended as I recall).  The Builder Help and content on OTN can help you to update this very out-dated code.

    Refer to the Forms-Reports Integration paper found on this OTN page.  It has information about using RRO instead of RUN_PRODUCT.  The context of the paper leans more toward web deployment, but the use of RRO would be the same for client/server.

    Michael Ferrante

    Senior Principal Product Manager


    Twitter: @OracleFormsPM

  • Paulo Ventura
    Paulo Ventura Member Posts: 35
    edited Mar 19, 2018 10:37AM

    Hi, Michael!

    Firstly, thanks for your time!


    Does it help?

    Im working with legacy code. That's why it's making use of obselete content.

This discussion has been closed.