Welcome! Log In Create A New Profile

Advanced

Finding report properties from a window

Posted by StefanoG 
StefanoG
Finding report properties from a window
November 10, 2018 04:37AM
Hi.
Is there a way to retrieve by code the properties of a report?

I mean.. A report is a resource of a project. So can I write, for example, something like
Trace(RPT_Prova..LabelWidth) inside a window code?

I'm afraid I can't because I get "The 'RPT_Prova' control is unknown" error message even trying it inside the project initialization code. So how can I get a report property before running iConfigureReport(RPT_Prova) in order to skip the dialogue box?

If I have report size in program's startup then I could force it before printing by iParameter function but I need to get those parameters before in some way. The only way I found now is hard-coding them as contants for each single label report but this means being very careful on keeping things aligned (constants VS reports) when changing something on reports. Not a very comfortable solution...

Thanks.
Al
Re: Finding report properties from a window
November 11, 2018 05:55AM
Hello StefanoG

You can create a file to hold all the data parameters required by each report in a memo file.
It might be possible to use one of the enumerate functions to retrieve the report parameters to set the file up in the first place and then maintain it when it runs. You could set a sytem variable to run a report to a file after an update and this would pick up the changes and write them out. If there is no report enumerate function then you could use paste a function into the reuired fields that would write out the "Myself.." data for the field into the memo field

In the first instance, you write a line into the memo field with the report fieldname and value and then read the values back in the report header before it prints to set the values such as width

Just an idea as I haven't proven the enumerate option but I use this method on a smaller scale for my reports.

Regards
Al
StefanoG
Re: Finding report properties from a window
November 12, 2018 08:29PM
Thank you for the answer.

I will try to save parameters as you say.
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: