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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection issue with PivotTable Office Web Component

Status
Not open for further replies.

haqyunus

Programmer
Jun 24, 2003
11
PK
Hi,

Here is a code snippet for adding a PivotTable MS Office control in a (ASP)webpage:

-------------------------------------------
Function Window_OnLoad()

Set c = PTable.Constants

'Connect to the data source.
PTable.ConnectionString = _
"provider=msolap;data source=YourServer;inital catalog=Foodmart 2000;"
PTable.DataMember = "Sales"

Set oView = PTable.ActiveView

'Add Dimensions to the column, row, and filter axes.
oView.ColumnAxis.InsertFieldSet oView.FieldSets("Time")
oView.ColumnAxis.DisplayEmptyMembers = True
oView.RowAxis.InsertFieldSet oView.FieldSets("Store")
oView.RowAxis.DisplayEmptyMembers = True
oView.FilterAxis.InsertFieldSet oView.FieldSets("Product")

'Add a total to the data area.
oView.DataAxis.InsertTotal oView.Totals("Store Sales")
oView.Totals("Store Sales").NumberFormat = "_($* #,##0_)"

aStates = Array("Cleared", "Checked", "Gray")

End Function
-------------------------------------------

I want to hide the ConnectionString value from my webpage. Is there any way to do that? Or else the user of the application can click 'View Source' in the browser and read the credentials. I know PivotTable MS Office control is a client-side Active-X component and it is also intialized on client-side. But is there a solution? A workaround?. Any help will be greatly appreciated.

Thanks.
Haq
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top