Click to See Complete Forum and Search --> : Suppress Formula


adisan
August 8th, 2005, 08:06 AM
I am new in CR and I need to now haw to suppress an object in my report.
I write a simplify example to well understand what I want.
Note: I use CR XI.
. . . . . . . . . . . . . .
oCRRep = oCRRun.NewReport
oAdoRS.ActiveConnection = pi.sql.Connection
oAdoRS.Open(selectComand)
. . . . . . . . . . . . . .
CR1 is a class what handle my needs
cr1.PageSetup(cPageSize, cPageOrientation)
cr1.MakeReport1(cAntet, cTitle, cColoane, 320)

MakeReport1 Method
---------------------------
oCRRep.FormulaSyntax= 0
crxReportHeader = oCRRep.Sections.Item("RH")
crxPageHeader = oCRRep.Sections.Item("PH")
crxDetail = oCRRep.Sections.Item("D")
crxReportFooter = oCRRep.Sections.Item("RF")
crxPageFooter = oCRRep.Sections.Item("PF")
crxReportFooter.PrintAtBottomOfPage = .T.
crxPageFooter.PrintAtBottomOfPage = .T.
. . . . . . . . . . . . . .
REPORT HEADER
*************
. . . . . . . . . . . . . .
objReport = crxReportHeader.AddTextObject(cAntet, 0, nTop)
WITH objReport
.Width = INT(xWidth/2)
.Height = INT(230*abtVFont)
.Font.Name = pi.cRapFontName
.Font.Size = pi.nRapFontSize
.Font.Bold = .T.
.HorAlignment = 1
.TextColor = pi.nRapFontColor
.KeepTogether = .T.
ENDWITH
. . . . . . . . . . . . . .
objReport = crxReportHeader.AddTextObject(cTitle, 0, nTop)
WITH objReport
.Width = This.xWidth
.Font.Name = pi.cRapFontName
.Height = INT(250*abtVFont)
.Font.Size = pi.nRapFontSize+1
.Font.Bold = .T.
.Font.Underline = .T.
.HorAlignment = 2
.TextColor = pi.nRapFontColor
.KeepTogether = .T.
ENDWITH
. . . . . . . . . . . . . .
\\ PAGE HEADER
\\***************************************************
. . . . . . . . . . . . . .
Hear are the problem. I want to suppress this object at first page and show him on next pages.
I do not now where and how to write a formula.
objReport = This.crxPageHeader.AddTextObject(cTitle,0,0)
WITH objReport
.Height = 230
.Width = xWidth
.Font.Name = pi.cRapFontName
.Font.Size = pi.nRapFontSize
.Font.Bold = .T.
.TextColor = pi.nRapFontColor
???.Suppress = True or False is not enough…
.KeepTogether = .T.
ENDWITH
. . . . . . . . . . . . . .

Please help me!!!

Thanks a lot,
Ady

Bastet
August 8th, 2005, 11:34 AM
Try this
right click on the object in design view and selecrt format text/graphic, depending on what the object is

select the suppress checkbox and then click the formula button, in there type

PageNumber = 1

Hopefully this will suppress the object in page one only

This has worked on one of my reports, hope it helps

adisan
August 10th, 2005, 04:52 AM
Thanks Bastet,
But I don’t have a RPT. I create all the report with code.
I need other solution.

Madhi
August 13th, 2005, 08:19 AM
something like

CR.object.suppress="Page Number=1"

adisan
August 16th, 2005, 03:43 AM
Thanks Madhi,

However, I apply this solution by first time and I receive a mismatch error message.
CR do not evaluate the expression grivet in suppress. This property needs only true or false values (???).

I need other solution.