How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document? How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
Go Back  Xtreme Visual Basic Talk > > > How do you save a dynamic URL as a document?


Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2010, 04:04 AM
dryde1m dryde1m is offline
Newcomer
 
Join Date: Apr 2010
Posts: 1
Default How do you save a dynamic URL as a document?


HELP NEEDED SAVING A URL/WEB DOCUMENT PLEASE!

I have a problem whereby I wish to automate the running of a report from an internal (intranet) web based asp application within my company. I know it would be much simpler/tidier if I could run the SQL myself but for security reasons we are not able to have access to the database. This leaves me with the nasty approach of automating IE using vba/vb.net which is something I'm not overly skilled at! Here's where I've got to so far:

Using SHDocVw & MSHTML open a new IE window and login to the app
Thankfully the app allows GET processing (where the parameters are passed in the URL) so I can navigate to the reporting screen and set the criteria using the url.
I then initiate the submit button to run the report. This displays a pretty useless 'fancy' page-by-page view of the report, but there is the option to export to Excel which is where my problem starts...
The export hyperlink runs a Java script so the href="#". I managed to find the element on the page that holds the dynamic url and by adding the Excel export option I was able to build the url that triggers the downloading of the report in Excel format:
exportUrl = "://serveraddress/" & HTMLDoc.getElementById("ctl00_body_ReportViewer1").ClientController.m_ exportUrlBase & "Excel"
This is my problem: I was hoping I would be able to use InetCtls.Inet to download the url but the link will only work if it is opened in the same ie window otherwise I get a "ASP.NET session has expired" error (the server performs some validation against the dynamic url). If i navigate to this link in the same window the IE open/save dialog is displayed. I could set the MIME on the machine to always open the xls document in the window but then I don't know how to save that to my machine (although it would already exist in the temp directory I suppose). I was just after a cleaner way of downloading the generated xls file without seeing the open/save dialog. Maybe by validating where the call came from? Hopefully this makes sense to someone!
This is what the URL looks like:

://serveraddress/Reserved.ReportViewerWebControl.axd?Mode=true&ReportID=d4c592664322403 dbea46a71edf09973&ControlID=8bbaf57f471947a6ba406acc588b82cf&Culture=2 057&UICulture=1033&ReportStack=1&OpType=Export&FileName=OutstandingFol lowUpReport&ContentD

Many Thanks

Matt
Reply With Quote
  #2  
Old 02-02-2014, 04:12 PM
champagne_charl champagne_charl is offline
Newcomer
 
Join Date: Jun 2008
Posts: 8
Default

Did you manage to succeed? I have a similar problem and am unsure how to resolve. If you have a solution I would be most grateful.
Reply With Quote
Reply

Tags
automation, inet, inetctls, mshtml, shdocvw


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document? How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document? How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
 
How do you save a dynamic URL as a document?
How do you save a dynamic URL as a document?
 
-->