Correct place for SetTarget(?) Code in Report and Text Resize


I have a cpc templates report. C10

Printing multiple records in a file with a detail band
There is one textbox in the band for string filetext
Filetext is s500 (set as a text box)
The textbox is set to 1 line height so and the extend attribute set
When there is more than 1 line of text the textbox expands ok (deepens)

The detail band the textbox is sat in is set to the minimum height. Just under the textbox

When the report prints the text box size expands ok, but the detail band always prints with a very deep depth probably based on 500 chars. Maybe 5 or 6 lines deep.

I am trying to resize the detail band which I am ok with the code with.

I think I am putting the settarget for the detail band in the wrong place. Where is the best place to put the settarget and the code to resize please ?

My understanding of the reports is the detail band prints in the detail band area. What I mean by this is take page height then remove from the page the header and footer height so the remaining height left is the detail band area. And then the detail band(s)* prints multiple “lines” in the detail band area one after the other.

*Detail bands being not a header or footer, ie you could have multiple detail bands which print based on any conditions which control them printing or not.

So you could have your text box on its own detail band and then print that band when its got some value to print.

Does that make any sense? :confounded:

You want to use simply use SetTarget( REPORT ) not any ( ?feq ). Be sure to SetTarget() at the end of the PROP assignments so the Window is the default.

An alternative is no SetTarget, instead syntax: REPORT$?feq{prop:xxx}

As to where in the code it must be after Open(Report). If it affects each detail individually then before Print(Rpt:Detail)

CPCS has an Extension (or maybe Control) Template for printing a TEXT as individual STRING Detail lines effectively doing the Resize but in a way Larry thought was better.

Yes makes sense thanks

That is what I am pretty much doing.
The detail band has one control in it which is a text box. The text box is set shallow to 1 line height, with resize.

When printing the detail band the control prints to the correct height but the detail band is always to deep. About 6 lines deep.

So I want to control the height of detail band with Settarget and Prop:height

The issue is where to the cot

Thanks i read about

But I could not get this to work. Same embed points as set target.

I think you want the TEXT Height to be default to print all.

Also important the DETAIL Height must be Default i.e. not specified, that’s likely your problem.

The RESIZE attribute (PROP:RESIZE) specifies height of the TEXT control varies according to the amount of data to print in it, up to the maximum height specified by the control’s AT attribute.

The height parameter in the AT attribute of the DETAIL, HEADER, or FOOTER strcuture containing the TEXT control must not be set (let it default) for the RESIZE attribute to have any effect.

Ah now that makes sense ! I will try ta

Its killing me this lol.

Ok still can’t get it to work. I have disabled the said band and made this on demand band. PRINT(rpt:detailband1)

So I have embedded code as below after printing the first band.
settarget( report ,?detail1)

Anything wrong with the code?

liness# = ?PROF1:SubjectQuestion{PROP:LineCount}

PROF1:SubjectQuestion{Prop:Height} = liness# * 200
?detail1{Prop:Height} = liness# * 202
SetTarget ()

No need for the ?detail1 FEQ just: settarget( report )

If you have RESIZE on the TEXT, and no Height on the Detail Band, then it should resize without any of that code.

If you want to try that kind of code … What value are you getting in liness# = LineCount?

You are missing a “?” at the front of: PROF1:SubjectQuestion{Prop:Height} = liness# * 200

I would try adding a ?PROF1:SubjectQuestion{Prop:NoHeight} = True before getting LineCount

I found the CPCS templaye for printing TEXT: #CONTROL(TextBoxPrinter,'Print a TextBox with Overflow'),REPORT,FIRST

I have this tiny Report Test project that is made for figuring this kind of PROP stuff out. You just have the minimal code so inserting a lot of debug is not a problem. Its super quick to build and run.

Along time ago I put up some code somewhere some code which resized a detail band for (Avery) labels.

I had a quick look on Arnor’s website Download Clarion Templates and Tools from Icetips Alta LLC but cant see anything and cant see anything on the clarionmag website so its probably on the ngs which will probably be CLC, C6 or the 3rd party, it wouldnt have gone anywhere else. But that handled resizing quite well from memory.

I dont have anything like that here now, its all wiped clean.


Linecount is throwing our #1 , #2 or #3 as it should.

I think I had ? In there just my typing in mobile.

What does prop:noheight do ?

The text box is expanding ok, the issue is the detail band is always expanding to the default height so it is to big. When I have extend turned on the text box extends to default but then also + the extention from the text box.

Even if I set the detail band as default or 200 in the setup, it always extends.


Its still doing the same. Expanding the detail band to default so there is lots of white space. I think I have given up on this one lol !

I found the issue There was a tiny line control on the band which was forcing the band to expand. I only saw this by looking at the tab order assistant. Thanks for your help with this guys.

Yeah sometimes looking at the code highlights this. I’ve been caught that way before. :grinning: