Thursday, September 24, 2015

Printing multiple copies of Same report page

Printing multiple copies of Same report page
  Ex :- For an Invoice Report you want to Print 3 copies
  1. Customer Copy
  2. Finance Copy 
  3. Delivery Copy

  Easiest way to do this is by setting COPIES report parameter.

 But this fails when you run the report for Multiple Invoice at the same time as it Prints   the 1st copy off all the invoice at once then the 2nd and then the 3rd Not all the 3 copies at once, also this fails if you want some different Labels on all the three copies ( Like Customer Copy,  Finance Copy…)

One of the shortest way to do this is to make a Cartesian Product as follows
               
                Let say your base query of report is
                SELECT invoice number, invoice_amount, customer_id FROM invoices ;
               
                To achieve 3 copy scenario.. revised query would be:
                SELECT copy_code, invoice_number, invoice_amount, customer_id  FROM invoices,
                (SELECT ‘Customer_Copy’  AS copy_code FROM dual
                UNION ALL
                SELECT ‘Finance_Copy’ AS copy_code FROM dual
                UNION ALL
                SELECT ’Dilivery_Copy’ AS copy_code FROM dual)
This will result all the three copies to come one after the other and also u can print the desired Label on all the copies.



European Currency Format
                If  suppose there is a Requirement  that only one RDF will be shared across the two countries (One European and other Non European) then its difficult to display the Currency in proper format for both the Countries
                Because the Normal Currency display format is Comma as Thousand separator and Dot as decimal separator
                ie like this 234,465,457,122.56
But for European Countries it’s the other way
Ie Dot for Thousands separator and Comma for Decimal separator
                ex 234.465.457.122,56

This might have been achieved easily if it was just for One territory, by doing some settings in the NLS parameters. But as the same RDF is to be shared in both the countries it seems to be difficult as the Report Builder and the Oracle Database Both does not support two type of format at the same time.
               
                To Achieve this an Alternate Solution will be to Set Number Format Mask from Format Trigger of Report Layout Field and put a condition that this will be applied only if the country is European and if the country is not European than put the general format mask in the Property Palate of the Report layout Field 
                E.G.(For SRW) SRW.SET_FORMAT_MASK(‘999”.”999”.”999”.”990”,”00’)
The only Drawback in this will be that the Number of ‘9’ you specify in above format mask can be the maximum length of the value coming from the D.B. if the length is more than the field may display as ****** in the output 

1 comment:

  1. We'll all be familiar with that moment before an important meeting; you're at the printer to collect a print job but instead find yourself sifting through piles of paper trying to locate your document in amongst those of your colleagues and goodness knows what else. 3dm8

    ReplyDelete

Clear BNE Cache for WebADI Changes

It Sometime happens that WebAdi Changes doesn't reflect once migrated in controlled instances. Here are the quick steps(Generally perfor...