Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SuggestRoiName

Status
Not open for further replies.

PeteWalburn

Programmer
Jan 13, 2004
63
GB
Hi,

Is it possible to use some of the data from a report in the SuggestRoiName function? One field of the my data has a unique number generated for the report. I would like to have the SuggestRoiName include this unique number in it's name.

I know that this value is not known when the report is initially loaded - it is only known once the SQLQuery has been executed. So the report would need to alter the RoiName once the SQL has been executed.

Can it be done?

Pete
 
It's strange, but it always seems to happen like this.

After trying to find a solution to my problem for hours, I finally posted a question to this board. And then I found the Function SuggestRoiName( row As AcDataRow ) As String

so, I now know how I should be able to get the report to do what is needed. However, I have found that the value returned by row.GetValue("ReportID") is 0 and not the actual value that should be in the field.

Also, because my report is a report loaded from a hyperlink on another report, the ROI file is not written to the Encyclopedia twice - it is only written for the initial report. Is there a setting that can be set so that the subsequent (hyperlink) reports also write their ROI files to the encyclopedia?

Pete
 
OK, I must admit defeat on this issue.

I have a report with a SQLQuerySource. In th eStart Function of this SqlQuerySource, a new ID value is created and stored in a global variable.

Then in the Fetch Function, new records are written to a table for each row in the SqlQuerySource and given the ID of the global variable.

I would like to have the ROI file created with the new ID. However, in the SuggestRoiName functions the value of the global variable is 0 (or has not been set).

I really need to be able to generate the ROI filename after the global variable has been set. Is there a way to do this?

Pete
 
Are you using Function SuggestRoiName( row As AcDataRow ) As String or Function SuggestRoiName( ) As String ?
 
I've tried using both of these functions. When I use the SuggestRoiName(row As AcDataRow) version, the row is always "nothing". I have put a check for:

If Not (row Is Nothing) Then

but it is always nothing and so the code does not get executed. I have tried just using the global variable instead of row.GetValue("ReportID"), but the variable always seems to be 0.

Pete
 
hmm..sounds like the variable or the row.getvalue is null when your trying to run the hyperlinked report.

How are you doing that?
 
The variable is NULL when the hyperlink report is loaded. It then does a calculation to figure out the value to pu in the variable. It is at this point that I would like to change the SuggestRoiName.

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top