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

Access Snapshot Viewer

Status
Not open for further replies.

arst06d

Programmer
Joined
Nov 29, 2002
Messages
324
Hi
I need to print a snapshot report file from our intranet.
I can display the report using the snapshot viewer embedded in an asp page, setting the SnapshotPath property in code.
I cannot, however, figure out how to print the report automatically.
i know the user can press the print icon on the embedded viewer, but I want to give the option to just print a report (or several) automatically.

Any ideas, please?
 
I believe printing automatically would require some fairly complex programming something along the lines of an ActiveX component.

The next best option would be to put the following in the page:

<body onload="window.print()">

This will bring up the print dialogue box automatically when the page opens.
 
window.print() just prints what appears is visible in the browser window. The viewer control is a scrollable container for multipage reports.
 
managed with the following javascript:

Code:
function printReport2(strReport)
{
	var strObj;

	strObj = "<OBJECT id=SnapshotViewer style='LEFT: 0px; TOP: 0px' height='0%' width='0%' classid='CLSID:F0E42D60-368C-11D0-AD81-00A0C90DC8D9' VIEWASTEXT>"
	strObj = strObj + "<PARAM NAME='_ExtentX' VALUE='16933'>"
	strObj = strObj + "<PARAM NAME='_ExtentY' VALUE='12700'>"
	strObj = strObj + "<PARAM NAME='_Version' VALUE='65536'>"
	strObj = strObj + "<PARAM NAME='SnapshotPath' VALUE='[URL unfurl="true"]http://apollo04.shb.co.uk/David/Snapshots/Reports/20060306/Options/ibisandintas.snp'>"[/URL]
	strObj = strObj + "<PARAM NAME='Zoom' VALUE='4'>"
	strObj = strObj + "<PARAM NAME='AllowContextMenu' VALUE='-1'>"
	strObj = strObj + "<PARAM NAME='ShowNavigationButtons' VALUE='-1'></OBJECT>"

	
	var snpDiv = document.getElementById("snapshotDiv");
	snpDiv.innerHTML = strObj;
	var snp = document.getElementById("SnapshotViewer");
	snp.PrintSnapshot(false);

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top