• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2093
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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