Initial commit
This commit is contained in:
86
crystalreportviewers13/urlreporting/activexviewer.js
Normal file
86
crystalreportviewers13/urlreporting/activexviewer.js
Normal file
@@ -0,0 +1,86 @@
|
||||
|
||||
function writeActxViewer(sViewerVer, sProductLang, sPreferredViewingLang, bDrillDown, bExport, bDisplayGroupTree,
|
||||
bGroupTree, bAnimation, bPrint, bRefresh, bSearch,
|
||||
bZoom, bSearchExpert, bSelectExpert, sParamVer) {
|
||||
document.write("<OBJECT ID=\"CRViewer\"");
|
||||
document.write("CLASSID=\"CLSID:C0A870C3-66BB-4106-9A25-60A26F3C1DA8\"");
|
||||
document.write("WIDTH=\"100%\" HEIGHT=\"99%\"");
|
||||
document.write("STYLE=\"position:absolute\"");
|
||||
document.write("CODEBASE=\"" + gPath + viewerPath + "ActiveXControls/ActiveXViewer.cab#Version=" + sViewerVer + "\">");
|
||||
document.write("<PARAM NAME=\"LocaleID\" VALUE=\"" + sProductLang + "\">");
|
||||
document.write("<PARAM NAME=\"PreferredViewingLocaleID\" VALUE=\"" + sPreferredViewingLang + "\">");
|
||||
document.write("<PARAM NAME=\"EnableDrillDown\" VALUE=" + bDrillDown + ">");
|
||||
document.write("<PARAM NAME=\"EnableExportButton\" VALUE=" + bExport + ">");
|
||||
document.write("<PARAM NAME=\"DisplayGroupTree\" VALUE=" + bDisplayGroupTree + ">");
|
||||
|
||||
document.write("<PARAM NAME=\"EnableGroupTree\" VALUE=" + bGroupTree +">");
|
||||
document.write("<PARAM NAME=\"EnableAnimationControl\" VALUE=" + bAnimation + ">");
|
||||
document.write("<PARAM NAME=\"EnablePrintButton\" VALUE=" + bPrint + ">");
|
||||
document.write("<PARAM NAME=\"EnableRefreshButton\" VALUE=" + bRefresh + ">");
|
||||
document.write("<PARAM NAME=\"EnableSearchControl\" VALUE=" + bSearch + ">");
|
||||
|
||||
document.write("<PARAM NAME=\"EnableZoomControl\" VALUE=" + bZoom + ">");
|
||||
document.write("<PARAM NAME=\"EnableSearchExpertButton\" VALUE=" + bSearchExpert + ">");
|
||||
document.write("<PARAM NAME=\"EnableSelectExpertButton\" VALUE=" + bSelectExpert + ">");
|
||||
document.write("</OBJECT>");
|
||||
|
||||
document.write("<OBJECT ID=\"ReportSource\"");
|
||||
document.write("CLASSID=\"CLSID:C05C1BE9-3285-4ED8-B47E-8F408534E89D\"");
|
||||
document.write("HEIGHT=\"1%\" WIDTH=\"1%\"");
|
||||
document.write("CODEBASE=\"" + gPath + viewerPath + "ActiveXControls/ActiveXViewer.cab#Version=" + sViewerVer + "\">");
|
||||
document.write("</OBJECT>");
|
||||
|
||||
document.write("<OBJECT ID=\"ViewHelp\"");
|
||||
document.write("CLASSID=\"CLSID:C02176CF-8629-4AF6-8F96-00D2DAA4EFB2\"");
|
||||
document.write("HEIGHT=\"1%\" WIDTH=\"1%\"");
|
||||
document.write("CODEBASE=\"" + gPath + viewerPath + "ActiveXControls/ActiveXViewer.cab#Version=" + sViewerVer + "\">");
|
||||
document.write("</OBJECT>");
|
||||
}
|
||||
|
||||
String.format = function() {
|
||||
if(arguments.length == 0) {
|
||||
return null;
|
||||
}
|
||||
var str = arguments[0];
|
||||
for(var i=1;i<arguments.length;i++) {
|
||||
var re = new RegExp('\\{' + (i-1) + '\\}','gm');
|
||||
str = str.replace(re, arguments[i]);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
var PAGE_INITIALIZE_CODE = 'return function pageInitialize() {' +
|
||||
'try {'+
|
||||
'var webBroker = new ActiveXObject(\"CrystalReports14.WebReportBroker.1\");'+
|
||||
'var webSource0 = new ActiveXObject(\"CrystalReports14.WebReportSource.1\");'+
|
||||
'webSource0.ReportSource = webBroker;'+
|
||||
'var docUrl, qPos;'+
|
||||
'docUrl = window.location.href;'+
|
||||
'qPos = docUrl.indexOf(\"?\");'+
|
||||
'if(qPos > 0) {'+
|
||||
'docUrl = docUrl.substring(0, qPos);'+
|
||||
'}'+
|
||||
'webSource0.URL = docUrl + \"{1}\";'+
|
||||
'webSource0.PromptOnRefresh = {2};'+
|
||||
'webSource0.AddParameter(\"proxypath\", docUrl);'+
|
||||
'{3}'+
|
||||
'CRViewer.ReportSource = webSource0;'+
|
||||
'CRViewer.DownloadResourceCab(\"{4}\");'+
|
||||
'CRViewer.ViewReport();'+
|
||||
'}'+
|
||||
'catch(err) {'+
|
||||
'if((err.number & 0xFF) != 0) {'+
|
||||
'window.alert(\"The Crystal Report Viewer is unable to create its resource objects.\");'+
|
||||
'CRViewer.ReportName = {0};'+
|
||||
'}'+
|
||||
'}'+
|
||||
'};';
|
||||
|
||||
function renderPageInitialize(reportName, url, promptOnRefresh, rptParameters, resourceCab) {
|
||||
if(rptParameters == undefined) { rptParameters = ""; }
|
||||
var codePageInitialize = String.format(PAGE_INITIALIZE_CODE, reportName, url, promptOnRefresh, rptParameters, resourceCab);
|
||||
codePageInitialize = unescape(codePageInitialize);
|
||||
var fPageInitialize = new Function(codePageInitialize);
|
||||
window.pageInitialize = fPageInitialize();
|
||||
}
|
||||
|
||||
103
crystalreportviewers13/urlreporting/appletviewer.js
Normal file
103
crystalreportviewers13/urlreporting/appletviewer.js
Normal file
@@ -0,0 +1,103 @@
|
||||
function getArchiveParameters(lang)
|
||||
{
|
||||
var resultParameters = "ReportViewer.jar";
|
||||
if (!(lang in ["de", "en", "es", "fr", "it", "ja", "ko", "nl", "pt", "sv", "zh_CN", "zh_TW"]))
|
||||
{
|
||||
resultParameters += ",ReportViewer_" + lang + ".jar";
|
||||
}
|
||||
return resultParameters;
|
||||
}
|
||||
|
||||
function writeJavaViewer_part1(browser, lang, pvLang, rptName, sf, promptOnRefresh, param)
|
||||
{
|
||||
document.write("<P align=\"center\">");
|
||||
if (browser == "msie")
|
||||
{
|
||||
document.write("<OBJECT");
|
||||
document.write("\tclassid=\"clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA\"");
|
||||
document.write("\twidth=\"100%\" height=\"100%\"");
|
||||
document.write("\tcodebase=\"http://java.sun.com/update/1.6.0/jinstall-6u32-windows-i586.cab#Version=1,6,0,32\"");
|
||||
document.write("\tstyle=\"position:absolute\">");
|
||||
document.write("<param name=code value=\"com.crystaldecisions.ReportViewer.ReportViewer\">");
|
||||
document.write("<param name=codebase value=\"" + gPath + viewerPath + "JavaViewer/\">");
|
||||
document.write("<param name=archive value=\"" + getArchiveParameters(lang) + "\">");
|
||||
|
||||
document.write("<param name=Language value=\"" + lang + "\">");
|
||||
document.write("<param name=PreferredViewingLanguage value=\"" + pvLang + "\">");
|
||||
document.write("<param name=ReportName value=\"" + url + rptName + "\">");
|
||||
if (sf != "")
|
||||
document.write("<param name=SelectionFormula value=\"" + sf + "\">");
|
||||
document.write("<param name=ServerParameters value=\"" + url + rptName + "\">");
|
||||
document.write("<param name=PromptOnRefresh value=\"" + promptOnRefresh + "\">");
|
||||
document.write("<param name=ReportParameter value=\"" + param + "\">");
|
||||
} else if (browser == "safari") {
|
||||
document.write("<APPLET");
|
||||
document.write(" WIDTH=\"100%\" HEIGHT=\"100%\" ");
|
||||
document.write(" codebase=\"" + gPath + viewerPath + "JavaViewer/\"");
|
||||
document.write(" archive=\"" + getArchiveParameters(lang) + "\" ");
|
||||
document.write(" code=\"com.crystaldecisions.ReportViewer.ReportViewer\">");
|
||||
document.write("<param name=Language value=\"" + lang + "\">");
|
||||
document.write("<param name=PreferredViewingLanguage value=\"" + pvLang + "\">");
|
||||
document.write("<param name=ReportName value=\"" + url + rptName + "\">");
|
||||
if (sf != "")
|
||||
document.write("<param name=SelectionFormula value=\"" + sf + "\">");
|
||||
document.write("<param name=ServerParameters value=\"" + url + rptName + "\">");
|
||||
document.write("<param name=PromptOnRefresh value=\"" + promptOnRefresh + "\">");
|
||||
document.write("<param name=ReportParameter value=\"" + param + "\">");
|
||||
} else {
|
||||
document.write("<EMBED MAYSCRIPT name=\"AppletViewer\" scriptable=\"true\" ");
|
||||
document.write("style=\"width: 100%; height: 100%;\"");
|
||||
document.write("pluginspage=\"http://www.oracle.com/technetwork/java/javase/downloads/index.html\"");
|
||||
document.write("type=\"application/x-java-applet;version=1.4\"");
|
||||
document.write("java_codebase=\"" + gPath + viewerPath + "JavaViewer/\"");
|
||||
document.write("code=\"com.crystaldecisions.ReportViewer.ReportViewer\"");
|
||||
document.write("archive=\"" + getArchiveParameters(lang) + "\"");
|
||||
document.write("Language=\"" + lang + "\"");
|
||||
document.write("PreferredViewingLanguage=\"" + pvLang + "\"");
|
||||
document.write("ReportName=\"" + url + rptName + "\"");
|
||||
document.write("SelectionFormula=\"" + sf + "\"");
|
||||
document.write("ServerParameters=\"" + url + rptName + "\"");
|
||||
document.write("PromptOnRefresh=\"" + promptOnRefresh + "\"");
|
||||
document.write("ReportParameter=\"" + param + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
function writeJavaViewer_part2(browser, bDrillDown, bExport, bGroupTree,
|
||||
bShowGroupTree, bPrint, bRefresh, bSearch,
|
||||
bZoom, bSearchExpert, bSelectExpert, bLogo)
|
||||
{
|
||||
if (browser == "msie" || browser == "safari")
|
||||
{
|
||||
document.write("<param name=CanDrillDown value=\"" + bDrillDown + "\">");
|
||||
document.write("<param name=HasExportButton value=\"" + bExport + "\">");
|
||||
document.write("<param name=HasGroupTree value=\"" + bGroupTree + "\">");
|
||||
document.write("<param name=ShowGroupTree value=\"" + bShowGroupTree + "\">");
|
||||
document.write("<param name=HasPrintButton value=\"" + bPrint + "\">");
|
||||
document.write("<param name=HasRefreshButton value=\"" + bRefresh + "\">");
|
||||
|
||||
document.write("<param name=HasTextSearchControls value=\"" + bSearch + "\">");
|
||||
document.write("<param name=HasZoomControl value=\"" + bZoom + "\">");
|
||||
document.write("<param name=HasSearchExpert value=\"" + bSearchExpert + "\">");
|
||||
document.write("<param name=HasSelectExpert value=\"" + bSelectExpert +"\">");
|
||||
document.write("<param name=ShowLogo value=\"" + bLogo + "\">");
|
||||
if (browser == "msie")
|
||||
document.write("</OBJECT>");
|
||||
else if (browser == "safari")
|
||||
document.write("</APPLET>");
|
||||
} else {
|
||||
document.write("CanDrillDown=\"" + bDrillDown + "\"");
|
||||
document.write("HasExportButton=\"" + bExport + "\"");
|
||||
document.write("HasGroupTree=\"" + bGroupTree + "\"");
|
||||
document.write("ShowGroupTree=\"" + bShowGroupTree +"\"");
|
||||
document.write("HasPrintButton=\"" + bPrint + "\"");
|
||||
document.write("HasRefreshButton=\"" + bRefresh + "\"");
|
||||
document.write("HasTextSearchControls=\"" + bSearch + "\"");
|
||||
document.write("HasZoomControl=\"" + bZoom + "\"");
|
||||
document.write("HasSearchExpert=\"" + bSearchExpert + "\"");
|
||||
document.write("HasSelectExpert=\"" + bSelectExpert + "\"");
|
||||
document.write("ShowLogo=\"" + bLogo + "\"");
|
||||
document.write(">");
|
||||
document.write("</EMBED>");
|
||||
}
|
||||
document.write("</p>");
|
||||
}
|
||||
Reference in New Issue
Block a user