Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Form output to csv

Paulo VenturaMar 16 2018 — edited Mar 19 2018

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.

   else

file_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!!

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 16 2018
Added on Mar 16 2018
2 comments
162 views