crystal reports Issue in path file - c#

After making a published version of asp.net webform application and uploading it to my clients server the application worked correctly.
But after time it showed this error:
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
at LogisticSystem.eokReports.ExportReportPage.GetReport()
in D:\Mostafa\LogisticSystem\LogisticSystem\eokReports\ExportReportPage.aspx.cs:line 390
this path is my local pc path
"D:\Mostafa\LogisticSystem\LogisticSystem\eokReports\ExportReportPage.aspx.cs" not a path at the clients server

It looks like you are trying to load a file that is not present at the clients server. Make sure that your report path is correct and the file exists. If "D:\Mostafa\LogisticSystem\LogisticSystem\eokReports\ExportReportPage.aspx.cs" not a path at the clients server is your error, then it's pretty clear that the file path you specify in your code does not exist on the server. Put the report file on the client's server and change your code to point to that file location instead of the location on YOUR machine.
Hope that helps,
Chris

Related

ASP.NET FileUpload control retrieving server path not local path

I am currently having a problem when uploading a file using a file upload control in asp.net
I have published my page using IIS on a remote server and I am accessing that link on my local computer.
Currently when im trying to upload a file I get an error saying that path not found meaning its looking for the file path that is on my pc, on the server which of course doesn't exist.
How do I get this to get the path from my pc because im trying to copy/saveAs the file from my pc to the server.
My code:
String pathCombine = System.IO.Path.Combine(destinationDirectory, Path.GetFileName(file));
File.Copy(sourcePath, pathCombine);

How to find my exe is running in local or network shared folder

How to construct root path from registry editor when execute program in web server,while executing in local path i am getting as ""C:\Users\Desktop\SPHelper.exe" "%1"" but in web server i am getting in this format ""webserver\Dot net upload\SPHelper.exe" "%1".
How to construct root path in web server in complete format? for example("\\webserver\Dot net upload\SPHelper.exe""%1")
Hi We can use this to find the Location
System.Reflection.Assembly.GetExecutingAssembly().Location

Load report failed on client machine windows application

I am working on windows application and I am using crystal report for reporting. At the time of set up creation i have also added merge module for crystal report. When I run the application in my machine and open the report ,it is working as expected.
For testing i have created simple report without any database connection with static content.
But when I install same set up on some other machine , I am getting Load report failed error from below line.
rpt.Load(path);
-- I have verified rpt file on path , it is there only.
Stack Trace
Load report failed.
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
at MyApplicaion.frmreports.Button1_Click(Object sender, EventArgs e)
As i remember there is an option about the report to be included in the application. So when you send it to the client it is already included. I suppose this is your problem. Cannot remember exactly which but let me check. I think something like property file. Sorry for not the complete answer but there has been a long time since i used it.

The SaveAs method is configured to require a rooted path, and the path is not rooted

we are moving our web application which is running in 32 bit server as website and also in the 64 bit server.
while uploading text file into server i got the error like :
"The SaveAs method is configured to require a rooted path, and the path http:\\mypath\CitiDirect\TimeSheet2.txt is not rooted.
"
but its working fine 32 bit server as in web application.
the file upload code is :
FileUpload1.SaveAs("\\" & Request.ServerVariables("LOCAL_ADDR") _
& "\CitiDirect$\TimeSheet2.txt")
you can use this workaround:
upload your file in a temporary folder then using
Fileupload1.SaveAs("\\" & yourtmppath)
file.move(source,destination)
then use this coz if the source is in use it will be copied but not deleted from original directory
if file.exist(source) then file.delete(source)

WmAutoUpdate - anyone used it? Won't roll back

I've built a Compact Framework application and I'm using WmAutoUpdate to deploy new versions to the mobile devices (http://www.sebastianvogelsang.com/2009/09/23/wmautoupdate-a-net-compact-framework-auto-update-library/). Has anyone used this? It's cool but I've got a problem.
If I cause the application to crash half-way through updating it is supposed to recover by copying the backup version back into the main directory. This doesn't work because the exe file is "locked" by the operating system because it is currently in use. I can verify this is the case because I can't delete it using Windows Explorer either. The error details are:
System.IO.IOException was unhandled
Message="IOException"
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.File.Move(String sourceFileName, String destFileName)
at WmAutoUpdate.Updater.assertPreviousUpdate()
at WmAutoUpdate.Updater..ctor(String url)
The error occurs on this line in Updater.assertPreviousUpdate():
File.Move(f, appPath + "\\" + getFilenameFromPath(f));
The code manages to update the application exe file when it's allowed to run normally (I'm not sure how). The problem is that it doesn't work when rolling back.
Cheer
Mark
I've used WmAutoUpdate and I've found the same problem. The issue is that you can move the files of the actual running process, but you cannot overwrite them. If you check the update part, WmAutoUpdate moves the running application to a backup directory and then it writes the update version to the original directory. I have fixed the rollback part this way:
if (Directory.Exists(backupDir))
{
string tmpDir = Path.Combine(Path.GetTempPath(),Path.GetFileNameWithoutExtension(Path.GetTempFileName()));
Directory.Move(appPath, tmpDir);
Directory.Move(backupDir, appPath);
}
First we move the running application files to a random directory in Temp. Then we copy the backup folder to the application original directory. Of course, this will generate a .TMP file in the Temp directory of your device, and a folder with the actual running process. You will have to delete this temporary folder once in a while in production code.

Categories

Resources