If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Excel and OWC 11

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-29-08, 01:20
dawriter67 dawriter67 is offline
Registered User
 
Join Date: Jan 2008
Posts: 1
Excel and OWC 11

One of our customers has created a pivot table in Excel. He wants us to publish this sheet on our intranet website. So by using OWC11, there is no license issues with roll out to a few members of his team. He wants them to see it as it is rather than copying the file to team members thus centralizing the data.



The pivot table contains drop downs with options of turning off columns etc.



This is simply going to be a read only page. No data is being added or modified. I could publish it using the file stream method but it is rather awkward thus I think the OWC 11 offers a smoother transition.



I adding a reference to OWC 11 for the project and kicked in the following command:



using Microsoft.Office.Interop.Owc11;



Next, on the page load:



string strConn2 = "Provider=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=c:\\NET_AFISSummary\\AFISData.xls;" +

"Extended Properties=" + (char)34 + "Excel 8.0;HDR=Yes;" + (char)34;



if (Request.Browser.ActiveXControls)

{

Response.Write("<OBJECT id='pTable' style='Z-INDEX: 109; LEFT: 8px; WIDTH:502px; POSITION: absolute; TOP: 8px; HEIGHT: 217px' height='217' width='502'classid='clsid:0002E55a-0000-0000-C000-000000000046'VIEWASTEXT></OBJECT>");

//cause the object to load data on the client

Response.Write(@"<script>document.all.pTable.Conne ctionString ='" + strConn2 + "'</script>");

Response.Write("<script>document.all.pTable.Resour ceID = 'FundTable'</script>");



}



There is no objections of OWC not being registered but I suspect the problem lies with the connection string command. The name of the excel worksheet is 'FundTable' as indicated in ResourceID. The connection string is strConn2.



If anyone has any luck doing this in Excel on their projects, I'd be grateful.



The Pivot Table shows up but with the following error notes:



The query could not be processed: The "" object could not be found.



"" is truly blank. Not sure why. I'm using local host, meaning my c:\ drive for now.



There are also warnings of an 'unsafe' data provider but to proceed if I think it's okay. Wonder how to suppress that, too.



thanks,
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On