Xojo Report Creator Terrible controls shifted and platform print differences

Hello Guys,

After few years , today i had to create some reports and i went crazy with the report creation, the labels are shifted, the sizes are not taken in consideration and so on . Any idea how to create a proper report that it should work ?

I just printed the same report on windows and on mac, the differences are so weird.

Let`s say that i can deal with the controls shiftings , i can manage to align them , but what i do with the report itself ? it should put some checks depending on the OS ?

Because i reached at this point, is there a way to have those 2 pages in one page ? to have like column print type ? as i don`t want to waste to much papers on this.

Thanks again.

below you have the controls shifting . and the reports for both platforms.

Report Designer snapshot

Mac Report

Windows Report

They don’t look massively different to me, although I can see the heading box doesn’t fit.

Print smaller?

This looks like a pretty simple list to me. Is this the actual report?
If so, printing direct isnt that difficult.
get a graphics context from the printer

then this sort of thing will do the job…

dim numrows as integer
dim rowheight as integer
dim titletop as integer
dim topmargin , bottommargin as integer
dim rowpos as integer

topmargin = 5
rowheight = 14
bottommargin = 20
titletop = topmargin + rowheight

numrows =( g.height - rowheight - topmargin - bottommargin ) / heightofrow
numrows = numrows -1
rowpos = heightoftitle + heightofrow * 2


//repeat this part for as many pages as you need
g.textsize = rowheight -2

g.drawstring  "Column1", col1Left, titletop
g.drawstring  "Column2", col2Left, titletop

for x as integer = 1 to numrows
g.drawstring  value1(x), col1Left, rowpos
g.drawstring  value2(x), col2Left, rowpos
rowpos = rowpos + heightofrow
next
//end of the repeating bit

I had to print a data base contents as list three years ago and didn’t had time to learn the native reports.

So, I do it by my own.

Nota:

a. I added a front page with the association Logo and db specs (+ the print day date / time),
b. I also added a page header (you have this one) and footer (print day, page number, etc.)
c. I draw a light grey line background on an alternate way (1 line with, the next one without).

Have a nice day :wink:

[quote=317467:@Jeff Tullin]dim numrows as integer
dim rowheight as integer
dim titletop as integer
dim topmargin , bottommargin as integer
dim rowpos as integer

topmargin = 5
rowheight = 14
bottommargin = 20
titletop = topmargin + rowheight

numrows =( g.height - rowheight - topmargin - bottommargin ) / heightofrow
numrows = numrows -1
rowpos = heightoftitle + heightofrow * 2

//repeat this part for as many pages as you need
g.textsize = rowheight -2

g.drawstring “Column1”, col1Left, titletop
g.drawstring “Column2”, col2Left, titletop

for x as integer = 1 to numrows
g.drawstring value1(x), col1Left, rowpos
g.drawstring value2(x), col2Left, rowpos
rowpos = rowpos + heightofrow
next[/quote]
Hi Jeff,

I did not quite get that but thanks a lot, i`ll try to look into the code and see how i can adapt the data , so far i save a simple data fetch and post :

[code] dim rpt As New rptColorList

	dim colorList As RecordSet
	
	colorList = App.aDB.GetColorList
	
	If colorList = Nil Then
			Beep
			
			MsgBox("Color list table is empty, no records found to print.")
			
	Else
			
			dim ps As New PrinterSetup
			
			ps.MaxHorizontalResolution = 600
			ps.MaxVerticalResolution = 600
			
			
			
			If ps.PageSetupDialog Then
					
					Dim g As Graphics
					
					g = OpenPrinterDialog(ps, Nil)
					
					If g <> Nil Then
							
							If rpt.Run(colorList, ps) Then
									rpt.Document.Print(g)
							End If
					End If
			End If
	End If[/code]

and on the report i have 2 fields one for id and one for color , so the id has to be next to the right , like 33 has to be on the same row as 1 i assume that it is possible but you will have to define the columns, and then to calculate the field size and to add them while they come , once they don`t fit anymore move them to the column 2 . In the report fields i have as DataField “id” for the Color ID and “color” for the Color name , i should add those dynamically on the code ? and duplicate the fields ?

Thanks again.