PageRenderTime 30ms CodeModel.GetById 16ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 1ms

/aspnet_client/system_web/2_0_50727/CrystalReportWebFormViewer3/js/export.js

http://github.com/khaneh/Orders
JavaScript | 177 lines | 164 code | 9 blank | 4 comment | 16 complexity | d8f2a5ef2b95841eec8362f5fe6429b7 MD5 | raw file
  1// export.js
  2// This file contains the funcitons needed to construct the HTML for the export / print dialog.
  3//
  4// Global variable
  5var print = false;		// default to export, so set print to false
  6var crystal_postback =
  7        "<INPUT type=\"hidden\" name=\"reportsource\" id=\"reportsource\"/>" +
  8        "<INPUT type=\"hidden\" name=\"viewstate\" id=\"viewstate\"/>";
  9
 10function getPageTitle() {
 11	if (print) {
 12		return L_PrintPageTitle;
 13	}
 14	else {
 15		return L_ExportPageTitle;
 16	}
 17}
 18
 19function getOptionsTitle() {
 20	if (print) {
 21		return L_PrintOptions;
 22	}
 23	else {
 24		return L_ExportOptions;
 25	}
 26}
 27
 28function getFormatDropdownList() {
 29	if (print) {
 30		return "<INPUT type=\"hidden\" name=\"exportformat\" id=\"exportformat\" value=\"PDF\"/>";
 31	}
 32	else {
 33		var list =
 34		"<TABLE width=\"100%\">" +
 35		"<TD align=\"center\"><SPAN class=\"exportMessage\"><LABEL for=\"exportFormatList\">" + L_ExportFormat + "</LABEL></SPAN></TD>"  +
 36		"<TR>" +
 37		"<TD class=\"exportSelect\" align=\"center\">" +
 38		"<SELECT id=\"exportFormatList\" class=\"exportSelect\" name=\"exportformat\" onchange=\"checkDisableRange()\">" +
 39		"<OPTION selected value=\"\">" + L_Formats +"</OPTION>";
 40		if( rpt )
 41		{
 42			list += "<OPTION value=\"CrystalReports\">" + L_CrystalRptFormat + "</OPTION>";
 43		}
 44		if( pdf )
 45		{
 46			list += "<OPTION value=\"PDF\">" + L_AcrobatFormat + "</OPTION>";
 47		}
 48		if( word )
 49		{
 50			list += "<OPTION value=\"MSWord\">" + L_WordFormat + "</OPTION>";
 51		}
 52		if( xls )
 53		{
 54			list += "<OPTION value=\"MSExcel\">" + L_ExcelFormat + "</OPTION>";
 55		}
 56		if( recXls )
 57		{
 58			list += "<OPTION value=\"RecordToMSExcel\">" + L_ExcelRecordFormat + "</OPTION>";
 59		}
 60		if( rtf )
 61		{
 62			list += "<OPTION value=\"RTF\">" + L_RTFFormat +"</OPTION>";
 63		}
 64		
 65		list += "</SELECT>" +
 66		"</TD>" +
 67		"</TR>" +
 68		"</TABLE>";
 69		return list;
 70	}
 71}
 72
 73function getSelectPageRangeSentence() {
 74	if (print) {
 75		return L_PrintPageRange;
 76	}
 77	else {
 78		return L_ExportPageRange;
 79	}
 80}
 81
 82function getPrintSteps() {
 83	if (print) {
 84		var steps =
 85		"<TR height=40 valign=\"bottom\">" +
 86		"<TD><SPAN class=\"exportMessage\">" + L_PrintStep0 + "</SPAN></TD>" +
 87		"</TR>" +
 88		"<TR valign=\"top\">" +
 89		"<TD><SPAN class=\"exportMessage\">" + L_PrintStep1 + "</TD>" +
 90		"</TR>" +
 91		"<TR height=40 valign=\"top\">" +
 92		"<TD><SPAN class=\"exportMessage\">" + L_PrintStep2 + "</SPAN></TD>" +
 93		"</TR>";
 94		return steps;
 95	}
 96	else {
 97		return "";
 98	}
 99}
100
101function getExportDialog() {
102	var exportDialog =
103		"<HTML>" +
104		"<HEAD>" +
105		"<STYLE>" +
106		"SPAN.exportMessage {" +
107		"   FONT-SIZE: 12pt; FONT-FAMILY: Arial, Helvetica, sans-serif" +
108		"}" +
109		"SPAN.exportSelect {" +
110		"   FONT-SIZE: 10pt; FONT-FAMILY: Arial, Helvetica, sans-serif" +
111		"}" +
112		"</STYLE>" +
113		"<TITLE>" + getPageTitle() + "</TITLE>" +
114		"</HEAD>" +
115		"<BODY bottomMargin=0 topMargin=5 onload=\"init()\">" +
116		"<FORM name=\"Export\" method=\"POST\">" +
117		crystal_postback +
118		"<TABLE cellSpacing=\"0\" cellPadding=\"3\" width=\"97%\" align=\"center\" border=\"0\">" +
119		"<TBODY>" +
120		"<TR bgColor=#008080><TD>&nbsp;</TD></TR>" +
121		"<TR bgColor=#000000><TD>&nbsp;</TD></TR>" +
122		"<FIELDSET style=\"border-style:none\">" +
123		"<TR><TD><LEGEND align=\"center\"><SPAN class=\"exportMessage\">" + getOptionsTitle() + "</SPAN></LEGEND></TD></TR>" +
124		"<TR>" +
125		"<TD align=\"center\">" +
126		getFormatDropdownList() +
127		"</TD></TR>" +
128		"<TR><TD><SPAN class=\"exportMessage\">&nbsp;&nbsp;&nbsp;" + getSelectPageRangeSentence() +
129		"</SPAN></TD>" +
130		"</TR>" +
131		"<TR>" +
132		"<TD>" +
133		"<TABLE>" +
134		"<TR>" +
135		"<TD><INPUT type=\"radio\" id=\"radio1\" checked name=\"isRange\" value=\"all\" onclick=\"return toggleRangeFields(this);\"/></TD>" +
136		"<TD><SPAN class=\"exportMessage\"><LABEL for=radio1>" + L_All + "</LABEL></SPAN></TD>" +
137		"</TR>" +
138		"</TABLE>" +
139		"</TD>" +
140		"</TR>" +
141		"<TR>" +
142		"<TD>" +
143		"<TABLE>" +
144		"<TR>" +
145		"<TD><INPUT type=\"radio\" id=\"radio2\" name=\"isRange\" value=\"selection\" onclick=\"return toggleRangeFields(this);\"/></TD>" +
146		"<TD><SPAN class=\"exportMessage\"><LABEL for=radio2>" + L_Pages + "</LABEL></SPAN></TD>" +
147		"</TR>" +
148		"</TABLE>" +
149		"</TD>" +
150		"</TR>" +
151		"<TR>" +
152		"<TD>" +
153		"<TABLE>" +
154		"<TR>" +
155		"<TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>" +
156		"<TD><SPAN class=\"exportMessage\"><LABEL for=from>" + L_From + "</LABEL></SPAN></TD>" +
157		"<TD><INPUT type=\"text\" width=\"20\" size=\"6\" maxLength=\"6\" name=\"from\" id=\"from\" value=\"1\" disabled></TD>" +
158		"<TD><SPAN class=\"exportMessage\"><LABEL for=to>" + L_To + "</LABEL></SPAN></TD>" +
159		"<TD><INPUT type=\"text\" width=\"20\" size=\"6\" maxLength=\"6\" name=\"to\" id=\"to\" value=\"1\" disabled></TD>" +
160		"</TR>" +
161		"</TABLE>" +
162		"</TD>" +
163		"</TR>" +
164		"</FIELDSET>" +
165		getPrintSteps() +
166		"<TR>" +
167		"<TD align=\"center\" colspan=6><BR><INPUT type=\"button\" id=\"submitexport\" width=\"30\" title=\"" + getPageTitle() + "\" value=\"&nbsp;&nbsp;&nbsp;" + L_OK + "&nbsp;&nbsp;&nbsp;\" onclick=\"checkValuesAndSubmit();\"/></TD>" +
168		"</TR>" +
169		"</TBODY>" +
170		"</TABLE>" +
171		"</FORM>" +
172		"</BODY>" +
173		"</HTML>";
174
175		return exportDialog;
176}
177