i'm Opening Word File from my Application in HTTP Path
i.e. http:\Server\SiteName\TempFiles\filename.docx
Word File Showing message as "READ ONLY : This Document is Lock for Editing by another user"
because of this my macro didn't work
Protection = ActiveDocument.ProtectionType
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
ActiveDocument.Unprotect "password"
WordBasic.AcceptAllChangesInDoc
ActiveDocument.Protect Protection, False, "password"
Call updateCustomVariables
ActiveDocument.Saved = True
Exit Sub
End If
every thing is working fine
and still working fine on office (Word) 13,10 machines
this problem suddenly start from last 3- 4 days
i'm getting error as Command failed (Run time Error 4198) for office 16 for ActiveDocument.Unprotect "password" line
no office Updates
no windows update
please help..
Check trusted Location Setting of Word i.e. Allow documents from Network to be trusted
disable all Protected View options
I know this isn't an answer but I'm new here and can't comment yet ;)
Got the same problem with one of our customers. Issue appeared in the latest Office 365 monthly rollout (16.0.11901.20264) a few days ago. The semi-annual version (16.0.11328.20362) doesn't have the issue. Our files are served using a URL with parameters. With previous versions of office it displays Read Only in the title bar but allows the user to edit the content.
With the new monthly version there is a read-only message that displays under the ribbon with a link to Save As. User cannot change the document content unless he saves the file locally. Even worse Word makes requests without the parameters so our code abends. I changed the code locally to put the parameter information in the path and I can open the document. But it still says that it's locked and the user can't edit the content.
We open and manage documents them using a VSTO side panel so we don't need to save them using the Save button. The application has it's own Save button that retrieves the updated content, saves it using an AJAX call and closes Word. Nice change of behavior from MS ;)
Related
I am trying to generate pdf on clicking on url for different invoices on front end, using httphandler in asp.net web forms in the back end. The pdf generates well for all the invoices except for one, ON LIVE environment.
It opens a dialog box saying:
"Adobe Reader could not open '_XYZ__.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)"
While , when I try to replicate the same on my Dev / test enviroment , all the pdfs generate properly for all the invoices.
Hence, I am unable to debug the issue on Live. How do I solve it and what could be the reason. Please guide.
Thanks
My page shows a grid with two column. 1st column has the hyperlink which when clicked opens the associated pdf (hosted on remote machine) in a new window. Internally I think the pdf is downloaded to the client computer's machine and he/she sees the cached copy. 2nd column has a delete button which when clicked deletes the associated pdf.
My problem is that if the pdf is currently open in the window, the delete button fails to delete the pdf because of sharing violation. I can go ahead and close the pdf and this allows the delete button to work fine.
I was wondering if I should be getting a sharing violation error since the client sees the cached copy of the pdf and not the original pdf?
Also, is there a way in IIS to release remote resources? Which might help in deleting the remote pdf even if its open on client machine?
I'm having some serious issues trying to get a Crystal Reports report printed from an ASP.Net page. Here is the current setup:
A Crystal Reports viewer is set up on a page. The report appears fine when viewing the report.
The report viewer PrintMode is set to ActiveX
I am setting the report data source from a session variable, as per SAP's recommendation (found in one of their knowledge base articles). The report data source is being set by a call to a WCF service. The data being passed into the report is fine. (Again, the report displays just fine, showing all content like it should).
The build target for the ASP.Net application and related services are x86.
Everything is using Crystal Reports version 13, and the ASP.Net web application is using .Net 4. It is being viewed in Internet Explorer 8.
I've tried checking the ActiveX settings on Internet Explorer 8, and none of them should be a problem (everything is either set to allow or prompt).
The error happens regardless of running it from the IDE or from a set up website on a separate server.
The settings for the application pool in IIS on the other server are set to allow 32 bit applications.
When I click on the Print icon on the report viewer, I get the following error message:
"An communication error occurred. Printing will be stopped."
This same error happens more than one machine. If I click OK on the error message the dialog underneath says "Please wait while the Crystal Reports Print Control is loaded.". If I wait, nothing happens. There is no prompt to install an ActiveX control, and nothing pops up allowing me to select a printer (of which I know several are installed).
I've tried doing the following things, none of which have worked:
Switch the report type to PDF. If I do this, and click the print button on the report viewer I get the following error:
Microsoft JScript runtime error: Object required."
It breaks on this line in particular:
bobj.crv.stateManager.setComponentState('MainContent_reportViewer_UI',eval('('+document.getElementById('_CRYSTALSTATEctl00$MainContent$reportViewer').value+')'));
There are several dynamic images in the report, but all of them are being displayed correctly when viewing the report. They are the only binary objects that I can think of that would be associated with this report. The error is happening in the dynamically created code for the page - not something that I have written.
I've tried manually installing the ActiveX control from the correct .cab file. This made no difference in any of the scenarios.
I've installed the latest Crystal Reports service pack (service pack 3). Again, this didn't change anything.
I've tried setting up a Virtual Directory for the CrystalReportViewers13 inside the Default Web Site, as recommended by some forum posts I came across. This also has had no effect.
Enabling ViewState on the page has no effect on whether printing works or not.
I've tried adding my own print button and a drop down list with a list of available printers. When I click my own custom print button and call PrintToPrinter(), I get the same error message as trying to print a PDF report:
"Microsoft JScript runtime error: Object required"
...and it breaks on the same line as when trying to print a PDF report when clicking the Print button.
I've been beating my head against this for at least a day now, and I'm fresh out of ideas. Anyone have any idea what might be causing this?
EDIT:
Well, here's what I did in order to get things to work. It ended up being a lot simpler of a fix than what I was thinking:
Stuff the entire ReportDocument into the session. Your page load should look something like this:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["report"] != null)
{
reportViewer.ReportSource = Session["report"];
}
BuildReport();
}
Keep the ReportViewer as simple as possible - don't specify the report type (PDF or ActiveX). Setting it to anything seemed to result in problems. This is what it looks like in the page source:
... and that was it. I can't believe I spent about a day trying to get it to work when it ended up being so simple. Hopefully this post helps anyone else facing the same problem.
Its bad idea to store entire report in session if you are receiving lot of user requests.
While working with crystal reports you must reinitialize the report and its login and datasource, parameters etc in each request (post back or no postback does not matter ) before sending out the response. Crystal report does not maintain complete viewstate that is why it should reinitialized each time.
I think you are not reinitializing during postback requests hence the error.
Save yourself the headache and DISABLE activeX printing. It blows up your web server with temp files, only works with IE, and is limited to the number of reports you can print at the same time. Set the print mode to Pdf and be done with it. A lot of browsers can print pdfs directly.
crViewer.PrintMode = PrintMode.Pdf;
I know this question is old, but I thought I'd chime in just in case someone else has this problem.
I found this page had a number of options for problems that I think are very similar to yours. I was getting the titled 'bobj is undefined' error, but all it really comes down to is that IIS can't find a proper path to the JS files for Crystal.
For myself I ended up placing some folders in my aspnet_client directory in the root of my site (wwwroot) and ensuring that NETWORK_SERVICE had access to the aspnet_client folder. I had to do the same with the 'crystalreportviewers' folder from my x86 SAP folder under
'C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 20XX\crystalreportviewers'
I also had to add the config from that site into my web.config... and then the viewer started working properly.
Hope it helps!
I ran in the similar issue, the report was being generated correctly on the page, but when I try to Zoom, it was saying, "No valid report source is available". To overcome this issue, I simply load the report each time when page is loaded, no matter Postback or normal load.
Also make sure you are properly disposing the Crystal Report Document, otherwise it may start giving "Load Report Failed" error.
I have the following scenario, and I wanted suggestions on what is the best way to handle this. My web app (ASP.NET 2.0 / IIS 6) generates PDF files, and I have a results page with links to those PDFs.
Now, I noticed that if I visit the results page, click on a PDF file (it opens in a new window), then re-generate the PDF file, and click on the same link in the results page, the OLD PDF is shown, instead of the new one. I had to delete the temporary internet files in order to see the new one.
So, since I'm NOT serving an ASPX that actually writes the PDF (and I do not want the Save dialog to show), but straight linking to the PDF file, I want to know what the best way to make sure the user always sees the latest file in the server, not a cached version.
I'm guessing adding no-cache headers is out of the question. But the PDF request would still go through an HTTP handler, so I'd like to know if I should create a specific HTTP handler to intercept requests for PDFs, or if i should do this at the IIS level...however I dont necessarily want to avoid caching ALL PDF's on that site.
Any suggestions? Thanks in advance for the help.
If your link to the pdf document had a unique querystring appended I believe that would prevent caching. Time in ticks is a good one to use, eg:
string.Format("{0}?t={1}", pdfFileUrl, DateTime.Now.Ticks);
I just had a similar issue. I have my page allows users to input data and generate new a pdf file Save clicked. The new pdf file overwrites the old one. In IE8, when user click the pdf link after the Save, the old pdf will always showed (user need to clear the cache to display the new one).
After hours of searching, I found that in IIS6, go to 'Output Caching', add a new cache rule with file extension '.aspx', tick both 'User-mode caching' and 'Kernel-mode caching' then under both options, select 'Prevent all caching'. This is working for me!
The fact the clearing your temporary internet files gave you the new version shows the browser is the source of the cache. You could turn iis caching off but that wouldn't stop proxies caching the document. If you need to be 100% sure that the user sees that latest version, I suggest using a query string value to cause the url to be different. The query string could be the pdf generation timestamp.
What are the differences between
Response.AddHeader("Content-Disposition", "attachment;filename=somefile.ext")
and
Response.AddHeader("Content-Disposition", "inline;filename=somefile.ext")
I don't know the differences , because when I use one or another I always get a window prompt asking me to download the file for both of them. I read the specs, but it is clueless.
Because when I use one or another I
get a window prompt asking me to
download the file for both of them.
This behavior depends on the browser and the file you are trying to serve. With inline, the browser will try to open the file within the browser.
For example, if you have a PDF file and Firefox/Adobe Reader, an inline disposition will open the PDF within Firefox, whereas attachment will force it to download.
If you're serving a .ZIP file, browsers won't be able to display it inline, so for inline and attachment dispositions, the file will be downloaded.
If it is inline, the browser should attempt to render it within the browser window. If it cannot, it will resort to an external program, prompting the user.
With attachment, it will immediately go to the user, and not try to load it in the browser, whether it can or not.
It might also be worth mentioning that inline will try to open Office Documents (xls, doc etc) directly from the server, which might lead to a User Credentials Prompt.
see this link:
http://forums.asp.net/t/1885657.aspx/1?Access+the+SSRS+Report+in+excel+format+on+server
somebody tried to deliver an Excel Report from SSRS via ASP.Net -> the user always got prompted to enter the credentials. After clicking cancel on the prompt it would be opened anyway...
If the Content Disposition is marked as Attachment it will automatically be saved to the temp folder after clicking open and then opened in Excel from the local copy.