Friday, August 8, 2014

Printing Running Totals :SQR Program

In order to print Running totals(as shown in below)  using SQR can be done using
Variables and Procedures


Program Outline:
1.Create a SQR file
2.Create HEADING section to create column headings
   begin-heading
   -----
   end-heading

Similarly create Footer using FOOTING section
  begin-footing
   -----
   end-footing
3.Call a procedure
    in our code Procedure "main" called using "do" command from PROGRAM section

4.Build definition for procedure "main" in PROCEDURE section
begin-procedure proc_name

---
end-procedure
5.Select database columns using PARAGRAPH "SELECT"
begin-select
------
end-select
6.Now create procedure to calculate Running sun
---"run_total" is the procedure used in below code to perform running sum

Thats all we done.

 Below is the SQR code:



begin-heading 3   ! Reserves 3 lines for Heading
print 'Customer Details' (1,1) underline bold
print $current-date (1,70) ! Prints Current Date
print 'User :  ' (+1,70)
print $username ()   ! Prints Database Username
print 'State' (3,1)
print 'Cust Num' (,10)
print 'Cust Name' (,20)
print 'Phone' (,53)
print 'Total' (,65)
print 'Running Total' (,75)
end-heading

begin-footing 2
page-number (1,1) 'Page '
last-page () ' of '
end-footing

begin-program
 do main
end-program

begin-procedure main
begin-select distinct    
state (,1)     on-break
 ! on-break will group the remaining data base one this column “state”
cust_num (,10)   
name (,20)       on-break  before=run_total
               ! before=run_total will call the procedure “run_total” before change in the value of “name”
phone
 if &phone = ''
 print 'No Phone' (,53)
 else
 print &phone (,53)
 end-if
Tot (,65)  edit 999
 position (+1)
from customers
order by state
end-select
print 'Final Tot:' (+1,60) bold
print #final_total  (,75) edit 999 bold
print 'Total Rows Selected:  ' (+1,60)
print #sql-count ()
end-procedure

begin-procedure run_total
let #total=#total+&tot
print #total (,75)   edit 999
!position (+3,1)
let #final_total=#total
end-procedure

17 comments:

  1. Printing services in Delhi Full services with guaranteed quality & on time delivery.We provide all printing service like Catalogue Printing , Letterhead Printing ,Book Printing etc.

    ReplyDelete
  2. Catalog Printing at Abhi Print- We offer Catalogue Design & printing services. Our catalogue designer in Delhi provides creative Product catalogue design. Catalog Printing with guaranteed quality and on-time delivery at low prices with expert support. Custom catalog sizes using your photos and text.

    ReplyDelete
  3. Letterhead printing online in India best in quality & customized letterhead printing online. Premium letterhead printing at affordable rates by Abhiprint. We here at abhiprint.com offers designing and printing of business card, letterhead and envelope at an affordable price in Noida & Delhi NCR, India.

    ReplyDelete


  4. A letterhead is the heading at the top of a sheet of letter paper (stationery).INDIA Best Letter Head service in Delhi That heading usually consists of a name and an address, and a logo or corporate design, and sometimes a background pattern. The term "letterhead" is often used to refer to the whole sheet imprinted with such a heading.

    ReplyDelete

  5. The Abhi Print offers the most comprehensive Letter Head printing Letterhead printing in Delhi solutions in offset printing of Letter Head |letterhead paper |INDIA Best Letter Head service in Delhi business cards letterhead printing letterhead maker letterhead printing online letterhead printing cost services at lowest price.Letterhead is an important part of the corporate image and is often inserted into envelopes for direct mail marketing. This vital promotional tool is often used for business transactions outside the company. However, they can also be used as inserts in product manuals, even as welcome letters and memos. Today, many business professionals use letterheads to gain business advantage by using very high quality offset color printing to showcase the best colors for their business. . If you also want to provide the ideal promotion for your business, then Abhiprint will help you from all angles here.

    ReplyDelete
  6. At AbhiPrint we assure you to provide some great paintings to create a uniquely compact catalog. We provide all printing service like catalogue Printing.The elegant product is just a small with a bare minimum copy of the text. With our minimalist design, your list will look attractive, informative and vague which will help attract the attention of potential customers. Image size. And background color as well as counts to achieve the desired result.Catalogs are a great resource to take any business to success. However, it is necessary that your catalog contains valuable information about the products and services you are offering. We know the importance of your catalog and therefore make sure to include complete information about your products including product pictures, charts, or pictures to complete your sales marketing materials.

    ReplyDelete
  7. At AbhiPrint we assure you to provide some great paintings to create a uniquely compact catalog. The elegant product is just a small with a bare minimum copy of the text. With our minimalist design, your list will look attractive, informative and vague which will help attract the attention of potential customers. catalog design and printing size. Best Catalog Printing Services In Delhi NCR, Catalog Printing In Rohini, Catalog Printing In Gurgaon Best Catalog Printing Services In All Over IndiaOur Catalog Designing in Delhi provides creative Online Product Catalog design Printing with guaranteed quality and on-time delivery at low prices with expert support.And background color as well as counts to achieve the desired result.

    ReplyDelete

  8. A letterhead, or letterheaded paper, is the heading at the top of a sheet of letter paper (stationery). That heading usually consists of a name and an address, and a logo or corporate design, and sometimes a background pattern.INDIA Best Letter Head service in Delhi The Abhi Print offers the most comprehensive Letter Head printing solutions in offset printing of Letter Head |letterhead paper |INDIA Best Letter Head service in Delhi business cards letterhead printing letterhead maker letterhead printing online letterhead printing cost services at lowest price.INDIA Best Letter Head service in Delhi

    ReplyDelete
  9. Even in this era, there are digital selling techniques trends are famous but the brochure printing services is a famous tool for selling yet. We provide all printing service like catalogue PrintingBrochures printing services atWhat makes a decent brochure? We know there is a cut-throat competition in the market. In this market, your brochure printing should be unique with content and attractive in designs. Printing Press in Delhi NCR abhiprint printing press Best Printing Press in Delhi, Gurgaon, Noida for quality and service. We assuring you for lowest price in industry. We are famous for quality and quantity at cheapest price abhiprint printing press A superbly designed brochure means there must be the best quality paper and a high-resolution printing technique. LPI should be minimum If there is dark colour background warnish or lamination must be done.

    ReplyDelete
  10. At AbhiPrint we assure you to provide some great paintings to create a uniquely compact catalog. catalog design and printingThe elegant product is just a small with a bare minimum copy of the text. With our minimalist design, your list will look attractive, informative and vague which will help attract the attention of potential customers. size. Best Catalog Printing Services In Delhi NCR, Catalog Printing In Rohini, Catalog Printing In Gurgaon Best Catalog Printing Services In All Over IndiaOur Catalog Designing in Delhi provides creative Online Product Catalog design Printing with guaranteed quality and on-time delivery at low prices with expert support.And background color as well as counts to achieve the desired result.

    ReplyDelete
  11. At AbhiPrint we assure you to provide some great paintings to create a uniquely compact catalog. The elegant product is just a small with a bare minimum copy of the text. With our minimalist design, your list will look attractive, informative and vague which will help attract the attention of potential customers. Catalog printing services in Delhi.size. Best Catalog Printing Services In Delhi NCR, Catalog Printing In Rohini, Catalog Printing In Gurgaon Best Catalog Printing Services In All Over IndiaOur Catalog Designing in Delhi provides creative Online Product Catalog design Printing with guaranteed quality and on-time delivery at low prices with expert support.And background color as well as counts to achieve the desired result.Our Catalog Designing in Delhi provides creative Online Product Catalog design Printing with guaranteed quality and on-time delivery at low prices with expert support.

    ReplyDelete
  12. At AbhiPrint we assure you to provide some great paintings to create a uniquely compact catalog. We provide all printing service like catalogue Printing We provide all printing service like catalogue PrintingThe elegant product is just a small with a bare minimum copy of the text. With our minimalist design, your list will look attractive, informative and vague which will help attract the attention of potential customers. size. Best Catalog Printing Services In Delhi NCR, Catalog Printing In Rohini, Catalog Printing In Gurgaon Best Catalog Printing Services In All Over IndiaOur Catalog Designing in Delhi provides creative Online Product Catalog design Printing with guaranteed quality and on-time delivery at low prices with expert support.And background color as well as counts to achieve the desired result.Our Catalog Designing in Delhi provides creative Online Product Catalog design Printing with guaranteed quality and on-time delivery at low prices with expert support.

    ReplyDelete
  13. I think your blog will easily to get the correct market, because its having the piece of content. so it can easily to attract the visitors.

    Click here for corporate print solutions

    ReplyDelete
  14. Consider a high-gloss, coated paper for

    catalogs
    where art and h images are important, and use an uncoated paper you can write on for

    product lists where readers may want to circle something or take notes. If your catalog will be

    mailed, be conscious of the total weight.

    ReplyDelete
  15. Abhiprint offer different type of Creative Brochure/catalog designing and printing services in Delhi. Full services with guaranteed quality & on-time delivery. The product catalog is a set of information about individual models. Models are specific versions or various configurations of an asset. ... Models published to the product catalog are automatically published to the Service Catalog. The service catalog includes information about goods (models) and services.

    ReplyDelete
  16. A standard print brochure (tri-fold brochure) is on 8 ½" × 11" paper, folded into thirds. On one side of the paper, you have the inside flap, the back cover, and the front cover, from left to right.The core content of the brochure is on the inside. Grid systems are a simple way to line up your content and organize it.

    ReplyDelete