Error : Could not find a part of the path *

Stimulsoft Reports.WEB discussion
Post Reply
gammasaman
Posts: 4
Joined: Sat Oct 27, 2012 12:48 pm

Error : Could not find a part of the path *

Post by gammasaman »

Hi,
I'm using StimulSoft Ultimate 2012
I Get this Error while loading a report into webviewer
Could not find a part of the path [....]
but the path specified in the error is correct!
The error seems to happen when there's a '.' in the path
can anyone help?

Code:

string path = Server.MapPath("Report/AirPostSpec.mrt");
report.RegData("DS", postSpec);
report.Load(path); (I get Error on this line)
StiWebViewer1.Report = report;
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error : Could not find a part of the path *

Post by HighAley »

Hello.

Please, send us a full error message.
Send us a real path and the content of the path variable.

Thank you.
gammasaman
Posts: 4
Joined: Sat Oct 27, 2012 12:48 pm

Re: Error : Could not find a part of the path *

Post by gammasaman »

Hi,
Here's My Situation:
I have a APS.NET Web Application on .Net 4
Whith An ASPX Page containing the webViewer at the root of the Application
and A .mrt File at Path: [Root]\Report.
I get The Error on report.Load()

Code Behind:
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString.Count != 0)
{
//Getting Parameters and DataSource
StiOptions.Engine.ReportResources.AllowUseResourcesInWeb = true;
this.domainService = new PostLoadDomainService();
if (this.Request.QueryString["PID"] != null)
this.postID = Convert.ToInt32(this.Request.QueryString["PID"]);
Models.AirPostSpec postSpec = domainService.GetAirPostSpecReport(this.postID).SingleOrDefault();

//Loading Report File and DataSource
StiReport report = new StiReport();
string path = Server.MapPath("Report/AirPostSpec.mrt");
//path = ''E:\Projects\PostLoad\Code\Version 1.1.0.0\PostLoad\PostLoad.Web\Report\AirPostSpec.mrt"
report.RegData("DS", postSpec);
report.Load(path);
StiWebViewer1.Report = report;
}
}
-----------------------------------------------------------------------------------------------------------------------------------
ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StmRptViewer.aspx.cs" Inherits="PostLoad.Web.StmRptViewer" %>

<%@ Register Assembly="Stimulsoft.Report.Web, Version=2012.2.1304.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a"
Namespace="Stimulsoft.Report.Web" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<cc1:StiWebViewer ID="StiWebViewer1" runat="server"
DropDownMenuFontFamily="Tahoma" />

</div>
</form>
</body>

------------------------------------------------------------------------------------------------------------------------------------------------------
Error:
Server Error in '/' Application.

Could not find a part of the path 'E:\Projects\PostLoad\Code\Version 1.1.0.0\PostLoad\PostLoad.Web\Report\AirPostSpec.mrt'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\Projects\PostLoad\Code\Version 1.1.0.0\PostLoad\PostLoad.Web\Report\AirPostSpec.mrt'.

Source Error:
Line 61: string path = Server.MapPath("Report/AirPostSpec.mrt");
Line 62: report.RegData("DS", postSpec);
Line 63: report.Load(path);
Line 64: StiWebViewer1.Report = report;
Line 65: }

Source File: E:\Projects\PostLoad\Code\Version 1.1.0.0\PostLoad\PostLoad.Web\StmRptViewer.aspx.cs Line: 63

Stack Trace:
[DirectoryNotFoundException: Could not find a part of the path 'E:\Projects\PostLoad\Code\Version 1.1.0.0\PostLoad\PostLoad.Web\Report\AirPostSpec.mrt'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +224
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1352
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) +66
Stimulsoft.Report.StiReport.Load(String path) +224
PostLoad.Web.StmRptViewer.AirPostSpec() in E:\Projects\PostLoad\Code\Version 1.1.0.0\PostLoad\PostLoad.Web\StmRptViewer.aspx.cs:63
PostLoad.Web.StmRptViewer.Page_Load(Object sender, EventArgs e) in E:\Projects\PostLoad\Code\Version 1.1.0.0\PostLoad\PostLoad.Web\StmRptViewer.aspx.cs:49
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

--------------------------------------------------------------------------------------------------------------------------------------------------------
Hope this is enough!
PS: I did some checking and I found that the error happens when the path is long, when I put the .mrt file in a location that has a short path the error does not happen.
Thank you for your replay!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error : Could not find a part of the path *

Post by HighAley »

Hello.

Please, send message with description of this problem to the support@stimulsoft.com with link on this topic.

Thank you.
gammasaman
Posts: 4
Joined: Sat Oct 27, 2012 12:48 pm

Re: Error : Could not find a part of the path *

Post by gammasaman »

Hi, I'm still awaiting a response, you referred me to your support department, and after a few dialogues you told me to send my purchase information. It's True that I'm using the trial version of your software, but i need this issue resolved before i can purchase your software, because i'm doing a Feasibility Check on Reporting systems on behalf of the company I'm working for, and we're in a scenario that we can not work around this problem.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Error : Could not find a part of the path *

Post by Alex K. »

Hello,

Please send us a sample project which reproduces the issue for analysis.

Thank you.
Alisadri
Posts: 1
Joined: Tue Nov 29, 2016 8:02 am

Re: Error : Could not find a part of the path *

Post by Alisadri »

Hello,

Please try to set the following option:
StiOptions.Engine.AllowSetCurrentDirectory = false;

Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Error : Could not find a part of the path *

Post by Alex K. »

Hello,

Thank you for the additional information.
Post Reply