Create QRP

Discussion forum about all things Report Builder (all versions).
ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

Create QRP

Post by ivano_osti » 20 Oct 2011, 12:23

Hi.

I'm taking a look at "Report Builder ActiveX interface (ReportBuilder.apl)".

Attached a small sample (TD60) that inserts two lines in a page header and a field into the 1st line.

I tried a lot but I FAILED to create a "Background Text".

Is it my fault or it is not possible to do that?

I ask your help to do this or to tell me that "it is not possible".

Thank you.
You do not have the required permissions to view the files attached to this post.

Jeff Luther

Re: Create QRP

Post by Jeff Luther » 20 Oct 2011, 17:16

I tried a lot but I FAILED to create a "Background Text".
It would help me to see what you did try, Ivano, though it doesn't look like the AX/ReportBuilder.apl supports that. But if you found something (and does not work) that I don't see, I would like to know what that is.

ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

Re: Create QRP

Post by ivano_osti » 20 Oct 2011, 17:56

Hi Jeff.

There is CreateField( Object ) to create a field. I did not find the same to create a background text.

When I said that I tried a lot I was saying that I tried to find an equivalent function for background text...

Thank you...

TerryP
Australia
Posts: 272
Joined: 06 Mar 2017, 22:41
Location: Mackay QLD Australia

Re: Create QRP

Post by TerryP » 20 Oct 2011, 23:00

Hi Ivano,

I haven't looked at this for a while (circa 4.1), but my code from back then uses the CreateObject( ) function, then SetExpText( ) to set a literal expression to the desired text. From that I gather there is no way to define an actual background text item, or perhaps internally they're stored as fields with literal text expressions anyway. I couldn't find any class object, or functions in the IReportList class, interface to support them explicitly.

In the example below, I'm creating column titles in a page header line (oPageLine), setting the position using SetLeft( ) and a calculated width using SetWidth( ), then setting the text as a literal from the field name, surrounded by single quotes (the SQ constant).

Code: Select all

! ** Set Header Field Properties **
Call oPageLine.CreateField( oPageField )
Call oPageField.SetLeft( nLeft, bOK )
Call oPageField.SetWidth( anWidth[nField] * nWidth / nTotal, bOK )
Call oPageField.SetExpText( SQ || asName[nField] || SQ, bOK )
Hope this helps you out,
Terry Phythian
Reprise Consulting

ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

Re: Create QRP

Post by ivano_osti » 21 Oct 2011, 12:48

Hi Terry.

I already tried out your tip before writing here with no success.

I tried again using SetLeft and SetWidth (I have not used in previous test) and unfortunatelly no success. The bOK parameter of SetExpText is returning FALSE. See:
SetExpText.JPG
Maybe I'm doing something wrong. If you or a friend check this is true please tell me.

Thank you for your attention.

My best regards.
You do not have the required permissions to view the files attached to this post.

TerryP
Australia
Posts: 272
Joined: 06 Mar 2017, 22:41
Location: Mackay QLD Australia

Re: Create QRP

Post by TerryP » 22 Oct 2011, 00:24

Hi Ivano,

I may be wrong, but I think your call to SetExpText() is incorrect. You've specified the expression text as 'Header', which means only the word Header is being set as the expression. Unless you have an input item or variable called Header, the expression is invalid, and hence SetExpText() will return FALSE.

To include the literal value 'Header' (including the single quotes), then you'll need to enclose it in quotes, i.e. "'Header'" or '\'Header\'', so that the expression includes the literal constant 'Header', including the single quotes. In my example, the text value was obtained from an item in a string array, asName[nField], then prepended and appended with the single quote charater stored in the SQ global constant, and so the quotes are included in the expression to make it a literal text value.

Hope this helps,
Terry Phythian
Reprise Consulting

ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

Re: Create QRP

Post by ivano_osti » 24 Oct 2011, 12:29

Hi Terry.

It worked fine :D . See:
SetExpText_WorkedFine.JPG
In my opinion the ActiveX should have a function to create a background text but this "workaround" works fine.

Count on me.

Thank you.
You do not have the required permissions to view the files attached to this post.

TerryP
Australia
Posts: 272
Joined: 06 Mar 2017, 22:41
Location: Mackay QLD Australia

Re: Create QRP

Post by TerryP » 24 Oct 2011, 22:30

Hi Ivano,

Yes I agree with you, it would make it more obvious and easier to use!

I suppose you can always write your own wrapper class/function to synthesize one, but why should you have to for something equivalent to the facilities provided in the Report Builder UI ?

Cheers,
Terry Phythian
Reprise Consulting

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests