Normal Topic PrintString Subform lines (Read 567 times)
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
PrintString Subform lines
Aug 1st, 2010 at 2:01pm
Print Post Print Post  
Is it possible to print either row or column lines, or row & column lines while using PrintString?

Thanks.
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: PrintString Subform lines
Reply #1 - Aug 2nd, 2010 at 2:45pm
Print Post Print Post  
Hello Tcgeo,

Do you mean lines in between the rows and columns of data, so vertical and horizontal lines? If so, Yes you can. You'd use PrintBox to draw the lines. Below is a piece of sample code. Run this in a Mass Update on a parent record with some subforms, such as the Argentina record, in the Countries sample database.

Code
Select All
Var vY as Int
Var vStartingY as Int
Var vHeight as Int
Var vTallest as Int
Var vLoop as Int
Var vCnt as Int

	NewPage(850, 1100)
	PrintRGBColor(0, 0, 0)
	PrintString("Country: " + Country, 100, 100, 0, "BArial", 12, 0)
	PrintString("CITIES", 100, 150, 300, "BArial", 12, 0, 2)

	vY = 175
	PrintBox(14, 100, vY, 300, 2)

	vCnt = @FormResultSetTotal("Cities")
	vLoop = 1
	While vLoop <= vCnt
	{
		FormResultSetCurrentPosition("Cities", vLoop)
		vTallest = 0
		vStartingY = vY
		//Add 5 for spacing between the line and the data
		vY = vY + 5

		PrintString(@FormFieldValue("Cities", "City", 0), 110, vY, 130, " Arial", 12, 0)
		vHeight = @PrintLastHeight()
		If vHeight > vTallest Then
		{
			vTallest = vHeight
		}
		PrintString(@Decimals(@FormFieldValue("Cities", "Population", 0), 0), 260, vY, 130, " Arial", 12, 0, 1)
		vHeight = @PrintLastHeight()
		If vHeight > vTallest Then
		{
			vTallest = vHeight
		}
		//Add 5 for spacing between the data and the line
		vY = vY + vTallest + 5
		//Add 10 to height to account for spacing and 2 to account for horizontal line height
		PrintBox(14, 100, vStartingY, 2, vTallest + 12)
		PrintBox(14, 250, vStartingY, 2, vTallest + 12)
		PrintBox(14, 398, vStartingY, 2, vTallest + 12)
		PrintBox(14, 100, vY, 300, 2)
		vLoop = vLoop + 1
	}
	FinishPage() 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: PrintString Subform lines
Reply #2 - Aug 2nd, 2010 at 2:57pm
Print Post Print Post  
Hi Ray,

Sorry, yes I did mean between the rows & columns.

This code works beautifully, thank you very much, you're outstanding!

Brandon

  
Back to top
IP Logged