Show chart by default

5 posts / 0 new
Last post
mohamed
Offline
Joined: 07/27/2015 - 03:45
Show chart by default

Hi,
I have an idea script with the following steps
1. Create a chart based on a database, say db1.
2. Execute extraction on another database, say db2.
3. Open chart of db1
4. Open extracted database from step2.
Problem I am facing is that, the chart generated is not showing up while opening db1. It is showing data instead of chart. Is there any way to show chart by default?
I am using Client.OpenDatabase(db1) to show graph.
Thanks,
Shafeer

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Shafeer,

I just tried different scenarios out and it doesn't look like you can have a file open to a default chart.  Probably the best alternative is to have a message saying for the user to open the chart on their own.

Brian

mohamed
Offline
Joined: 07/27/2015 - 03:45

Thanks Brian

mohamed
Offline
Joined: 07/27/2015 - 03:45

Hi Brian, 
There is an option to show chart by default. We can use Database.SelectResult method to show chart after opening database. This information is available in IDEA help. Give the chart name as the parameter.
Database.SelectResult
Selects a specified result by name. The selected result becomes the active result.
Syntax
Database.SelectResult(resultName As String)
Parameters
[in] resultName
The name of the result.
Return Value
 
Example
Sub Main
' Open the database.
Set db = Client.OpenDatabase("Sample-Detailed Sales.IDM")
' Select the result to use.
db.SelectResult "Aging"
' Clear the memory.
Set db = Nothing
 
End Sub
 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Thanks, I had missed that function.  Thanks for letting me know.