TNTmips

HOME

FREE PRODUCTS
  TNTlite
  TNTatlas
  TNTsim3D

DOWNLOADS
  Release Version
  Development Version
  FTP
  Language Kits
  Sample Geodata
  Reseller Resources
  Promotional

DOCUMENTATION
  Tutorials
  Technical Guides
  Quick Guides

SITE MAP


cb_report.sml


#############################################################
#  cb_report.sml                                                                                                              #
#  Project to form a Crystal Report from TNTmips internal database records   #
#  Author: Jeremy Johnson                                                                                           #
#  March 30, 2004                                                                                                           #
#############################################################

#Import the Visual Basic Form
$import cbsoils_report.crystal_form
#create a instance of the form's class in SML
class crystal_form cf;

string symbol, name;
numeric acres, wheat, oats, haydry, haywet;

#Get a vector for input of the data
vector v;
GetInputVector(v);

numeric num_d_records = NumRecords(v.poly.DESCRIPTN);
numeric num_y_records = NumRecords(v.poly.YIELD);
numeric current;

#Initialize the Datatable in Visual Basic
cf.InitializeDataTable();

#Add the records from the Vector to Visual Basic
for current  = 1 to num_d_records {
	symbol = TableReadFieldStr(v.poly.DESCRIPTN, "SYMBOL", current);
	name = TableReadFieldStr(v.poly.DESCRIPTN, "NAME", current);
	acres = TableReadFieldNum(v.poly.DESCRIPTN, "ACRES", current);
	cf.AddDescriptnRecord(symbol, name, acres);
}
for current  = 1 to num_y_records {
	symbol = TableReadFieldStr(v.poly.YIELD, "SYMBOL", current);
	wheat = TableReadFieldNum(v.poly.YIELD, "WHEAT", current);
	oats = TableReadFieldNum(v.poly.YIELD, "OATS", current);
	haydry = TableReadFieldNum(v.poly.YIELD, "HAYDRY", current);
	haywet =TableReadFieldNum(v.poly.YIELD, "HAYWET", current);
	cf.AddYieldRecord(symbol, wheat, oats, haydry, haywet);
}


#Once all the records are added, create and show the report
cf.InitializeReport();
cf.ShowForm();


Back Home ©MicroImages, Inc. 2008 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010   USA
Business & Sales: (402)477-9554  Support: (402)477-9562  Fax: (402)477-9559
Business info@microimages.com  Support support@microimages.com  Web webmaster@microimages.com

20 May 2008

page update: 13 Aug 07