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!

Need help Printing programatically

Status
Not open for further replies.

Clamp

Programmer
Jul 9, 2003
8
US
Hi all

I have RAS 9, Cr Dev. 9.. and im writing a VB6 app that needs to gather parameters, pass them into an ASP page that interacts with RAS, but instead of viewing the report.. I want the ASP page to route the report right to the default printer.. CR's knowledgebase sucks, so I have to turn to the community

Thanks

Clamp
 
I should add to this... I have everything working.. I just need the code that actually sends the report to the printer..

Clamp
 
Here's Seagate's example....
<HTML>
<HEAD>
<TITLE>Seagate Crystal Smart Viewer for ActiveX</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6>

<OBJECT ID=&quot;CRViewer&quot;
CLASSID=&quot;CLSID:C4847596-972C-11D0-9567-00A0C9273C2A&quot;
WIDTH=0% HEIGHT=0%
CODEBASE=&quot;/viewer/activeXViewer/activexviewer.cab#Version=2,2,4,37&quot;>
<PARAM NAME=&quot;EnableRefreshButton&quot; VALUE=0>
<PARAM NAME=&quot;EnableGroupTree&quot; VALUE=0>
<PARAM NAME=&quot;DisplayGroupTree&quot; VALUE=0>
<PARAM NAME=&quot;EnablePrintButton&quot; VALUE=1>
<PARAM NAME=&quot;EnableExportButton&quot; VALUE=0>
<PARAM NAME=&quot;EnableDrillDown&quot; VALUE=0>
<PARAM NAME=&quot;EnableSearchControl&quot; VALUE=0>
<PARAM NAME=&quot;EnableAnimationControl&quot; VALUE=0>
<PARAM NAME=&quot;EnableZoomControl&quot; VALUE=0>
</OBJECT>



<SCRIPT LANGUAGE=&quot;VBScript&quot;>
<!--
dim timer
dim printerTimer
dim pageOne
PageOne = True
Sub window_onLoad()
Page_Initialize()
End Sub

Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject(&quot;WebReportBroker.WebReportBroker&quot;)
if ScriptEngineMajorVersion < 2 then
window.alert &quot;IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site.&quot;
CRViewer.ReportName = Location.Href
else
Dim webSource
Set webSource = CreateObject(&quot;WebReportSource.WebReportSource&quot;)
webSource.ReportSource = webBroker
webSource.URL = &quot; webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub

Sub CRViewer_DownloadFinished(byval downloadType)
if downloadType = 1 and PageOne then
PageOne = False
timer = window.settimeout(&quot;OnMyTimeOut&quot;,1000)
end if
end sub

Sub OnMyTimeOut()

if not CRViewer.IsBusy then
window.ClearTimeout(timer)
'window.alert &quot;My timeout&quot;
CRViewer.PrintReport
printerTimer = window.SetTimeOut(&quot;OnPrinterTimeOut&quot;, 1000)

end if
end sub

Sub OnPrinterTimeOut()
if not CRViewer.IsBusy then
window.ClearTimeOut(printerTimer)
window.History.Back
end if
end sub
-->
</SCRIPT>

</BODY>
</HTML>

Not sure I follow it all exactly.
I see where they call the CRViewer.PrintReport, but I'm not totally sure how they get there, so I'd prolly stick to what they got there.
 
Yeah.. I been looking at that code for a while now, and ill tell ya.. it doesnt seem to make much sense to me.. I was hoping for a one-liner i could throw into my ASP code to send it to the printer.. however, as with everything else.. I am stuck with seagates code.. blarg

Clamp
 
Honestly,
I dont see what the code is that sends it to the printer either.

If you do find something, please post it.
I'm sure others (as well as myself) would be interested in seeing it.
 
I talked to Seagate about this two days ago, and what I was told is that RAS uses another &quot;Model&quot;.. and that this printing code isnt meant for RAS.. there is however another way to do it.. (I think she called it the &quot;Object Model&quot;, but i cant rememebr it)... It just doesnt seem likely to me that RAS cant print.. BUt it may be yet another tricky way for seagate to squeeze licenses out of us

Clamp
 
Thier main office is in vancover B.C.
 
RAS can print - you export report to pdf (or word or excel or text) and client can print that on his/her local printer...

HTH,
Lady Linet
 
How is this any different then allowing the report to open in a browser, and then having the client print it manually.. what I want is to run the report on the server.. and send it to the clients local printer..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top