Is this possible? Session sharing etc.

  • Thread starter Thread starter HG
  • Start date Start date
H

HG

Hi gurus

Sorry the rather long post...

I am facing a real world problem here, and I dunno how to approach it.
Don't even know if this is the right group...but since my app is ASP.NET I
tried here first.

I have an ASP.NET WebApp running, database tier is SQL Server 2000 in a
intranet environment.
The front end is HTML (generated from ASP.NET pages). Nothing new here.

BUT:

I want to add letter writing and reporting facilities based on the data in
SQL Server.
The lette writing has to be done in Word and the reporting in Excel. So I
though of the following scenario:

- Have a template (.dot for Word), which is hosted on the Web Server. When
the user hits the link to the template my ASP.NET page will put some
parameters in the session, before it return the requested template as
content to the browser. In the document template a VBA OnLoad eventhandler
has been implemented. What it will do, comes later.
- When the template is received at the browser, it show a new document based
on this template AND the code in the VBA OnLoad eventhandler is executed.
- The VBA code, contacts a WebService hosted on the very same webserver that
the template was received from. The WebService fetches the parameters that
were placed on the session before returned the document template, and
executes a query against the database. The result of the quuery is returned
as XML to the client (ie. still the OnLoad eventhandler)
- The VBA code, parses the XML and performs inserts at the correct places in
the new document.
- Done.!

Serveral issue arise here:
1)
Does the template show up as a new document based on that template?
2)
Does security setttings allow the OnLoad eventhandler to be executed?
3)
Does WebService call share the same session as the browser? Is it possible
to get to the parameters that the ASP.NET page placed there?

These 3 issues a crucial for the above to work.

Are there any other way... What about the WebServices ToolKit for Office XP?

Anyone please
 
Hi HG:

#3 is an issue as the web service call from Office program will not
share a session with the browser. Any chance your requirements allow
you to prompt the user for a ticket number or login?
 
Hi Scott

Thanx for answering so fast.

My worst fear just realized itself :-)

No, I was kinda suspecting that... I do not have any chance of promting for
a login as this must happen as seamlessly as possible.

BUT, that said:

I have checked out the new "developer friendly" toolkit of Office 2003,
which happens to be what I can expect to be on the client.
Intranet environment you know..... You can actually predict what is on the
client...GREAT compared to Internet solutions...

From Office 2003 (Maybe Office XP, too, couldn't find that), Word and Excel
supports saving in XML format, that is Word ML and Excel ML.
How about this scenario then.
1)
Construct the Word/Excel ML based on a template and fill in the data
serverside.

2)
Stream the result to the client (browser) with content type
"application/ms-word". Just as you could stream a "tab-delimited-file" to
the browser nowadays with content type "application/ms.excel".

3)
Browser fires up Word/Excel and it knows exactly how to deal with the
Word/Excel ML content...

4)
Done. You have a report/letter containing the data and layout you want.

Can anyone confirm this is the way to go....maybe there's a even better
way...

Thanx in advance

Regards

Henrik
 
Hi Henrik:

I think this approach will be better. Creating the office xml markup
server side is a lightweight approach and much better than trying to
automate Word on the web server. Microsoft SQL Reporting Services can
use this approach and it works well (better than PDF rendering from a
performance standpoint).
 
Hi again Scott

Tremendous, thanx...and lightwight indeed.

I will check out reporting services

/Henrik
 
Back
Top