Search website

How to batch preview and print

The following code sample shows how to write code to do a batch preview and print.

Code Snippet
  1. // The following code direct access to a local AutoCount database called AED_MOBILE_0, there is no login window to prompt out to allow users to select a database.
  2. BCE.Data.DBSetting dbSetting = new BCE.Data.DBSetting(BCE.Data.DBServerType.SQL2000, @”(local)\A2006″, “sa”, BCE.AutoCount.Const.AppConst.DefaultPassword, “AED_MOBILE_0″);
  3. BCE.AutoCount.MainEntry.Startup.Default.SubProjectStartup(dbSetting);
  4. if (BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).Login(“ADMIN”, “ADMIN”))
  5. {
  6.     BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceListingReport report = BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceListingReport.Create(dbSetting);
  7.     // Uncomment the below code to pass by document keys
  8.     //long[] docKeys = new long[] { 333, 347 };
  9.     //report.BatchPreview(docKeys, false, true);
  10.     string[] docNos = newstring[] { “I-00079″, “I-00081″ };
  11.     report.BatchPreview(docNos, false, true);
  12. }

The following table lists the reports that contains the method above:

Report that contains BatchPreview method
Cancel SO Listing Report
Cash Sale Listing Report
Credit Note Listing Report
Debit Note Listing Report
Delivery Order Listing Report
Delivery Return Listing Report
Invoice Listing Report
Quotation Listing Report
Sales Order Listing Report
Cancel PO Listing Report
Cash Purchase Listing Report
Goods Received Note Listing Report
Goods Return Listing Report
Purchase Invoice Listing Report
Purchase Order Listing Report
Purchase Return Listing Report
Request Quotation Listing Report