1 2 Previous Next 22 Replies Latest reply on Jun 30, 2009 3:12 PM by 657571 Go to original post
      • 15. Re: Is there an inexpensive APEX report printer for invoices/checks/statements?
        Ok, good stuff.

        Copy your Oracle ODBC driver to the 'C:\apache-tomcat-5.5.12\webapps\birt\WEB-INF\platform\plugins\org.eclipse.birt.report.data.oda.jdbc_2.3.2.vxxxxxxxx\drivers' folder.
        Copy your report file ie. the .rptdesign file to 'C:\apache-tomcat-5.5.12\webapps\birt' folder.

        In your Apex application create a page, add a button link eg. an image type button with #IMAGE_PREFIX#/menu/printer_32.gif specified as the image. Specify the target as a URL with the following URL target :-
        javascript:popUp2('http://' + location.hostname + ':8089/birt/run?__report=YOUR_REPORT_NAME.rptdesign&__format=pdf');

        To pass a parameter to the report the URL target would be as follows :-
        javascript:popUp2('http://' + location.hostname + ':8089/birt/run?__report=YOUR_REPORT_NAME.rptdesign&PARAM1=&P116_ID.&__format=pdf');
        PARAM1 is the actual name of the parameter as defined in your BIRT report.

        Where P116_ID is a page item. You can obviously pass as many parameters as you like in URL following the same syntax for additional parameters. You can also create links in reports and use the # syntax to pass parameters. The 'location.hostname' bit makes testing and deployment easier as you don't have to hard code the IP address of the server running BIRT.

        Have a look at http://www.eclipse.org/birt/phoenix/deploy/viewerSetup.php and http://www.eclipse.org/birt/phoenix/deploy/viewerUsage.php for more info on the running and viewing of reports.

        Hope I haven't missed anything out.

        Good Luck.

        Vis Naidu
        • 16. Re: Is there an inexpensive APEX report printer for invoices/checks/stateme
          Vis Naidu wrote:
          In your Apex application create a page, add a button link eg. an image type button with #IMAGE_PREFIX#/menu/printer_32.gif specified as the image.
          Actually, there should be no slash between #IMAGE_PREFIX# and the directory: #IMAGE_PREFIX#menu/printer_32.gif
          • 17. Re: Is there an inexpensive APEX report printer for invoices/checks/statements?
            Hello Martijnke,

            Based on your mail merge example, I was able to upload certain rtf files. But I have rather larger files that I want to upload. And when I attempt to do so, I get this error message: ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6457, maximum: 2000)

            It seems to fail during the insert into the rtf table. Which is on this insert ...

            insert into rtf
            select id, name, filename, mime_type, doc_size, utl_raw.cast_to_varchar2(blob_content)
            from wwv_flow_files

            Do you know a workaround for this?


            • 18. Re: Is there an inexpensive APEX report printer for invoices/checks/statements?
              I was wondering if anyone could provide some input to how to integrate PL-FPDF to Oracle Apex, I can't see to find any information online about it.
              Where would I get started?
              • 19. Re: Is there an inexpensive APEX report printer for invoices/checks/statements?
                Since it is just a pl/sql library to call I would think it should be pretty easy to use, however with no visual designer interface, it seems kinda hokey.. There are visual xsl editors available that when used with FOP/Cocoon will get you nice reports for $65 a Developer license plus the time to install setup Cocoon/FOP..

                Otherwise, you COULD post a message to the PL-FPDF authors site and ask him how to mesh APEX and PL-FPDF..
                Site is: http://www.erasme.org/PL-FPDF,1337

                Thank you,

                Tony Miller
                Webster, TX
                • 20. Re: Is there an inexpensive APEX report printer for invoices/checks/statements?
                  Great, I sent them a message, and I hope I can try to understand French, hehe

                  I guess they stopped allowing posts on their forums, I wish they would provide more support.

                  Thanks for you help Tony.
                  • 21. Re: Is there an inexpensive APEX report printer for invoices/checks/statements?
                    if you look at


                    syntax used is almost same other than the package name.

                    here is what i did( this is part of the code to give you idea )



                    FOR rec1 in cur1 loop l_comments := rec1.value_id; END LOOP;

                    FOR rec2 in cur2 loop l_strengths := rec2.value_id; END LOOP;

                    FOR rec3 in cur3 loop l_area_to_address := rec3.value_id; END LOOP;

                    --reset page margin











                    pl_fpdf.Text(pl_fpdf.GetX+8.875,pl_fpdf.GetY+.25,'Areas to Address');



                    l_yPosition :=pl_fpdf.GetY;






                    look at


                    this is the foundation on which this whole package is built

                    hope it help you

                    Edited by: binepal on Jun 11, 2009 2:26 PM
                    • 22. Re:Mail Merge method?
                      You're having trouble with large files.
                      I implemented this ages ago to use from Forms, and recently transcribed it to Apex.
                      I store the rtf file as a blob - so the upload (for me) is simply
                      insert into rtf
                      select filename
                      from wwv_flow_files
                      where ....

                      so then we have to convert to char in chunks (possibly) to do the replace.
                      Our tag identifiers are "<<" and ">>" e.g. "<<EMPNO>>"
                      Seems to work with any size of file - I tried it on a massive one with a large logo with no problems.
                      We also store the completed letter in a log file - easily removed if you don't need it!

                      I'll reproduce the full procedure - I think it's self-explanatory.
                      (fetch_det and replace_data should be obvious)

                      procedure mailmerge (p_module in varchar2
                      ,p_empno in number := 1)

                      v_module rtf.module%type;
                      v_input blob;
                      v_output blob := null;
                      v_raw blob;
                      -- Buffer for log blob content
                      v_blob blob;

                      v_default_bufflen number := 16384; -- 16k
                      v_bufflen number;
                      v_offset number := 1;

                      v_start_pos number;
                      v_end_pos number;

                      v_content varchar2(32000);
                      v_first boolean := true;

                      v_log_seq letter_log.seqno%type;

                      v_where varchar2(200);

                      cursor c_lob is
                      select content
                      from rtf
                      where module = v_module;

                      cursor c_seq is
                      select nvl(max(seqno),0) + 1
                      from letter_log;


                      v_module := UPPER(p_module);
                      v_where := 'Retrieving RTF file';

                      open c_lob;
                      fetch c_lob
                      into v_input;
                      if c_lob%notfound then
                      error_flag := true;
                      htp.print('Module not found');
                      end if;
                      close c_lob;

                      -- Now retrieve the variables



                      v_where := 'Processing letter contents';
                      v_bufflen := v_default_bufflen;
                      dbms_lob.read(v_input, v_bufflen, v_offset, v_raw);
                      v_content := utl_raw.cast_to_varchar2( v_raw );
                      /* Now count backwards to find the last occurrence of "<<" */
                      v_start_pos := instr(v_content,'<<',-1,1) ;
                      if v_start_pos > 0 then -- found
                      /* Now , do we have a close symbol? */
                      v_end_pos := instr(v_content,'>>',v_start_pos);
                      IF v_end_pos = 0 then -- no close and we have a split replacement string
                      v_bufflen := v_start_pos - 1; -- cut buffer down to posn. BEFORE replace start
                      goto reread;
                      end if;
                      end if;
                      v_content := replace_data(v_content);
                      v_raw := utl_raw.cast_to_raw(v_content);
                      if v_first then
                      v_output := v_raw;
                      v_first := FALSE;
                      end if;
                      v_offset := v_offset + v_bufflen;

                      end loop;

                      when no_data_found then
                      -- htp.print('end of file');


                      v_where := 'Log Seq';

                      open c_seq;
                      fetch c_seq
                      into v_log_seq;
                      if c_seq%notfound then
                      v_log_seq := 1;
                      end if;
                      close c_seq;

                      v_where := 'Logging details';
                      insert into letter_log

                      when others then
                      error_flag := TRUE;
                      htp.print('<h1>'||'Error in Letter Log '||SQLERRM ||'<h1>');

                      if not error_flag then

                      v_where := 'Setting mime details';

                      v_where := 'Displaying processed content';
                      end if;
                      1 2 Previous Next