Lines Over Rectangles

Lines Over Rectangles

Forum member · Jul 6, 2007
Hi, I'm trying to make a grid that uses different coloured rectangles as backgrounds to display rows, and then uses lines to seperate the columns. Even though I'm sure the code for the column lines comes after the code for the rectangles, the rectangles still appear over the lines. Is there any reason for this? Thanks.

Re: Lines Over Rectangles

Support · Jul 6, 2007
Hello, If the lines are added to the page after adding the rectangles then the lines will appear on top of the rectangles only. Please double check your code if any where you are adding the lines to the page prior to adding the rectangles. Thanks, ceTe Software Support Team.

Re: Lines Over Rectangles

Forum member · Jul 9, 2007
Hi, I've double checked my code, maybe you can see something that I can't. It's been loosely based on the SimpleReport.asp example. Sub BuildDocument() ' Builds the PDF MyDocument with data from the DataReader Call AddNewPage() Do While Not MyRecordSet.EOF ' Add current record to the MyDocument AddRecord() MyRecordSet.MoveNext() Loop AddGrid() End Sub After looping through a recordset, adding records with rectangles to seperate rows, the AddGrid() Sub is run, which is shown below: Sub AddGrid() Dim DocTemplateLine1, DocTemplateLine2, DocTemplateLine3 columncount = 0 columnwidth = 80 Set DocTemplateLine1 = MyDocTemplate.AddLine ( 0, 15, 713, 15, 1 ) Set DocTemplateLine2 = MyDocTemplate.AddLine ( 0, maxReqHeight + 23, 813, maxReqHeight + 23, .1 ) OpenRecordSet2 Do While Not MyRecordSet2.EOF If MyRecordSet2("column_name") <> "EmpFullName" Then Set DocTemplateLine3 = MyDocTemplate.AddLine ( columnwidth - 4, maxReqHeight + 23, columnwidth - 4, bodyBottom - 2, .01 ) columnwidth = columnwidth + 16 End If columncount = columncount + 1 MyRecordSet2.MoveNext Loop MyRecordSet2.Close() Set MyRecordSet2 = Nothing Set DocTemplateLine3 = MyDocTemplate.AddLine ( columnwidth - 4, maxReqHeight + 23, columnwidth - 4, bodyBottom - 2, .01 ) End Sub The only lines on the page are all added using AddGrid() and the vertical lines are only visible where the rectangles are not covering them. Can you see anything wrong? Thankyou.

Re: Lines Over Rectangles

Support · Jul 9, 2007
Hello, The reason you see this behavior is because you are adding the lines to the template. The template always gets applied to the document first before any other page element gets added to the page. So in your case, all the lines are added first before any rectangle gets drawn on the page. If you do not add the Line page element to the template and add it directly to the Page, then it may solve your problem. Otherwise the rectangles you add to the page will appear on top of the lines. Thanks, ceTe Software Support Team