opening odc:OfficeDataConnection and opening few columns by default

nihirshah

New Member
Joined
Mar 13, 2014
Messages
1
am generating an excel file using odc:OfficeDataConnection xml method. My command type is cube and commandText is cube name.

Now this works fine and generates an empty excel at runtime. People can choose the fields they want and see the pivotTable.

But my issue is I need to set a few columns as default, so when excel opens it automatically puts 2-3 fields in pivot table, so the user doesn't see an empty screen.

This is kind of my sample code

<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit;">****** name=Catalog content="Adventure Works DW"> ****** name=Table content="Adventure Works"> <title>Adventure Works</title> <xml id=docprops><o:DocumentProperties xmlns:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice" xmlns="http://www.w3.org/TR/REC-html40"> <o:Name>Adventure Works</o:Name> </o:DocumentProperties> </xml><xml id=msodc><odc:OfficeDataConnection xmlns:eek:dc="urn:schemas-microsoft-com:eek:ffice:eek:dc" xmlns="http://www.w3.org/TR/REC-html40"> <odc:Connection odc:Type="OLEDB"> <odc:ConnectionString>Provider=MSOLAP.3;Integrated Security=SSPI;Persist Security Info=True;Data Source=myolapserver;Initial Catalog=Adventure Works DW</odc:ConnectionString> <odc:CommandType>Cube</odc:CommandType> <odc:CommandText>Adventure Works</odc:CommandText> <odc:SSOApplicationID>Application1</odc:SSOApplicationID> <odc:CredentialsMethod>Stored</odc:CredentialsMethod> <odc:AlwaysUseConnectionFile/> </odc:Connection> </odc:OfficeDataConnection> </xml>I was wondering if there is a way to add certain column in these settings so it opens those columns at runtime or use macro to run when excel is generating and loading.

Any help will be appreciated</code></pre>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,985
Messages
6,122,602
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top