[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1926
  • Last Modified:

Package AS_PDF3 by Anton Scheffer

Hello,

does anyone know how to sord feched data you get from using this (AS_PDF3 Package) package.

What i did so far is load data in cursor then loop trough every record displaying it one by one.

Problem is with sorting number so they are displayed like this:
         8.670,01
         6.789,1
11.234.654,01

and not like this:
      8.670,01
       6.789,1
11.234.654,01.

My so far procedure looks like this:


DECLARE
    v_pdf     BLOB;
    v_message CLOB := 'E-mail!';
 
    cursor c1 is 
    
          SELECT
              job_id,
			  manager_id,
			  department_id,
			  DEPARTMENT_NAME
		  from EMP_DETAILS_VIEW;
          
          
BEGIN
    as_pdf3.init;


    as_pdf3.set_page_orientation('PORTRAIT');
    
  
   as_pdf3.set_font( 'times', 'b' ,16);
   as_pdf3.WRITE('Title',180,700); 
   as_pdf3.horizontal_line( 180, 695, 305, 2);
   as_pdf3.WRITE('from: ' || to_char(SYSDATE,'dd.mm.yyyy') || ' to: ' || to_char(SYSDATE,'dd.mm.yyyy'),190,680);
   as_pdf3.horizontal_line( 180,675, 300, 2);
   
   as_pdf3.set_font( 'times', 'b' ,10); 
  
   
   as_pdf3.put_image( 'logo_dir', 'logo.jpg', 200, 700);  
   

    FOR c IN c1 loop
    BEGIN
    
      as_pdf3.set_font( 'times', 'N' ,10);  
      as_pdf3.WRITE(c.job_id ||'  ' || initcap(C.manager_id) || '  ' || c.department_id || '  ' || c.DEPARTMENT_NAME,-1,-1);
   
   
    END;
    END LOOP;
    

    v_pdf := as_pdf3.get_pdf;

    sdsemail.send_attach_blob(
        p_sender          => 'no-replay@domain.com',
        p_recipients      =>  'example@example@mail.com', --mail of recipient
        p_subject         => 'Subject' || sysdate,
        p_message         => v_message,
        p_attachment      => v_pdf,
        p_att_inline      => FALSE,
        p_att_mime_type   => 'application/pdf',
        p_att_filename    => 'report_' || to_char(SYSDATE,'DD_MM_YYYY') || '.pdf'
    );
    
END;

Open in new window


Thank you!
0
Caruso_eu
Asked:
Caruso_eu
1 Solution
 
sdstuberCommented:
convert your numbers to strings, right pad values that only have one decimal place,  then left pad the strings to the same length and use a fixed width font
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now