I am having an issue with the "view" option within ePortfolio. I get an error:"Object doesn't support this property or method" on every report. It's failing in viewreport.csp.
Can anyone see anything wrong here???
Here's the code:
<%
SetPageExpiry();
try
{
// Get the current info store
var iStore = CheckSession("view");
// Get parameters, build uri query string
var id = String( Request.QueryString.Item( "id" ) );
var initCommand = String(Request.QueryString.Item("init"));
var uriQueryString = "id=" + id;
var sf = Request.QueryString.Item("sf");
if (sf.Count != 0)
uriQueryString += "&sf=" + Server.URLEncode (sf);
var viewer1;
var rptSrc;
var cachedRptSrcID = GetSession("RptSrcID");
if ((cachedRptSrcID == id) && (initCommand != "connect"))
{
// Use the cached report source
rptSrc = GetSession("RptSrc");
}
// If we didn't find a report source, just make a new one
if (typeof(rptSrc) != "object")
{
// Info object
var objCol = iStore.Query( "SELECT SI_CUID FROM CI_INFOOBJECTS WHERE SI_ID = " + id );
var rptObj = objCol.Item( 1 );
// Report source
var rptSrcFactory = iStore.EnterpriseSession.Service ("", "PSReportFactory");
rptSrc = rptSrcFactory.OpenReportSource(rptObj);
SetSession("RptSrcID", id);
SetSession("RptSrc", rptSrc);
}
EnsureImageCleanerIsRunning();
viewer1 = Server.CreateObject( "CrystalReports.CrystalReportViewer" );
// set selection formula
if ( sf.Count != 0 )
viewer1.ViewTimeSelectionFormula = String(sf);
viewer1.ReportSource = rptSrc;
viewer1.IsOwnForm = true;
viewer1.IsOwnPage = true;
viewer1.IsDisplayGroupTree = true;
viewer1.PageToTreeRatio = 5.0;
viewer1.IsDisplayToolbar = true;
viewer1.IsDisplayPage = true;
viewer1.URI = String(Request.ServerVariables.Item("SCRIPT_NAME")) + String(Request.ServerVariables.Item("PATH_INFO")) + "?";
viewer1.URI = viewer1.URI + uriQueryString;
viewer1.HasRefreshButton = VIEWER_HASREFRESH;
viewer1.HasExportButton = VIEWER_HASEXPORT;
viewer1.HasGotoPageButton = VIEWER_HASGOTOPAGE;
viewer1.HasCrystalLogo = VIEWER_HASLOGO;
viewer1.HasPageNavigationButtons = VIEWER_HASPAGENAV;
viewer1.HasPrintButton = VIEWER_HASPRINT;
viewer1.HasSearchButton = VIEWER_HASSEARCH;
viewer1.HasToggleGroupTreeButton = VIEWER_HASTOGGLEGROUPTREE;
var dvprint = String(GetSubCookie("ePortfolio_prefs", "dvprint"));
if (dvprint == "acro")
dvprint = 0; // Acrobat Reader print control
else if (dvprint == "actx")
dvprint = 1; // ActiveX print control
else
dvprint = 1; // ActiveX print control
viewer1.PrintMode = dvprint;
viewer1.ProcessHttpRequest( Request, Response, Session );
}
catch(e)
{
WriteErrorRetrieve(e);
}
%>
Can anyone see anything wrong here???
Here's the code:
<%
SetPageExpiry();
try
{
// Get the current info store
var iStore = CheckSession("view");
// Get parameters, build uri query string
var id = String( Request.QueryString.Item( "id" ) );
var initCommand = String(Request.QueryString.Item("init"));
var uriQueryString = "id=" + id;
var sf = Request.QueryString.Item("sf");
if (sf.Count != 0)
uriQueryString += "&sf=" + Server.URLEncode (sf);
var viewer1;
var rptSrc;
var cachedRptSrcID = GetSession("RptSrcID");
if ((cachedRptSrcID == id) && (initCommand != "connect"))
{
// Use the cached report source
rptSrc = GetSession("RptSrc");
}
// If we didn't find a report source, just make a new one
if (typeof(rptSrc) != "object")
{
// Info object
var objCol = iStore.Query( "SELECT SI_CUID FROM CI_INFOOBJECTS WHERE SI_ID = " + id );
var rptObj = objCol.Item( 1 );
// Report source
var rptSrcFactory = iStore.EnterpriseSession.Service ("", "PSReportFactory");
rptSrc = rptSrcFactory.OpenReportSource(rptObj);
SetSession("RptSrcID", id);
SetSession("RptSrc", rptSrc);
}
EnsureImageCleanerIsRunning();
viewer1 = Server.CreateObject( "CrystalReports.CrystalReportViewer" );
// set selection formula
if ( sf.Count != 0 )
viewer1.ViewTimeSelectionFormula = String(sf);
viewer1.ReportSource = rptSrc;
viewer1.IsOwnForm = true;
viewer1.IsOwnPage = true;
viewer1.IsDisplayGroupTree = true;
viewer1.PageToTreeRatio = 5.0;
viewer1.IsDisplayToolbar = true;
viewer1.IsDisplayPage = true;
viewer1.URI = String(Request.ServerVariables.Item("SCRIPT_NAME")) + String(Request.ServerVariables.Item("PATH_INFO")) + "?";
viewer1.URI = viewer1.URI + uriQueryString;
viewer1.HasRefreshButton = VIEWER_HASREFRESH;
viewer1.HasExportButton = VIEWER_HASEXPORT;
viewer1.HasGotoPageButton = VIEWER_HASGOTOPAGE;
viewer1.HasCrystalLogo = VIEWER_HASLOGO;
viewer1.HasPageNavigationButtons = VIEWER_HASPAGENAV;
viewer1.HasPrintButton = VIEWER_HASPRINT;
viewer1.HasSearchButton = VIEWER_HASSEARCH;
viewer1.HasToggleGroupTreeButton = VIEWER_HASTOGGLEGROUPTREE;
var dvprint = String(GetSubCookie("ePortfolio_prefs", "dvprint"));
if (dvprint == "acro")
dvprint = 0; // Acrobat Reader print control
else if (dvprint == "actx")
dvprint = 1; // ActiveX print control
else
dvprint = 1; // ActiveX print control
viewer1.PrintMode = dvprint;
viewer1.ProcessHttpRequest( Request, Response, Session );
}
catch(e)
{
WriteErrorRetrieve(e);
}
%>