hey i'm working on project in which I have webform which includes some editfields. I don't want to enter the data manually into that editfield. what I want is to extract data from a word document and fill that editfields. But the catch is, through which MS doc I fill the editfield?
Suppose We have a bunch of lectures uploaded on some page. so what should I do to retrieve the data from a particular document?
Is it necessary to open the MS-doc file first?
or I should download the file first?
If I goes with option 1 when should I have to use some library? what opens the file within browser, retrieve the data and the a pop-up message appears "the data has been retrieved now you can close the file". and next I can fill the form with that data.
or should I goes with the 2 Option when an individual hit the download button then the file will be stored into the local machine. how can I keep the track that which ms-file is downloaded or stored into the local machine?and is it necessary to open that file for retrieving the data again?
These are my point of views that how I can implement that module. So I need your suggestions? Is this the right way to achieve this goal or should I follow the other path? and which libraries are required to achieve this task or any tutorial similar to this problem ?
Thanks in Advance
I would suggest considering a third option: since the Word document files exist on the server, the cleanest place to pre-populate a form would be by extracting data from the document while it is on the server and filling in the form's fields before sending it down to the user in a codebehind. Trying to extract data on the client side from a recently-downloaded file via an application other than the browser seems ripe for kludgy-ness. Articles such as http://support.microsoft.com/kb/257757 should help get you started in the right direction.
For extracting data from ms word document using free .net word component and fill data to webform,
extract data,
Document doc = new Document();
doc.LoadFromFile("YouDocOrDocx.Docx");
string content = doc.GetText();
Related
Im doing a simple documentation management project which is like secretary usage. I'm keeping data in ms access. In main windows I have a listview which is listing existing document details. Also, I need add a file (excel,word,powerpoint,pdf) to document details in selected computer files. If a document has a file user would be add file for this document while it's creating like I said. I don't have any idea. Can you give me any document to do that please ?
Save the document to a byte[] and display the document name in the list that way you will know what you have.
I have a C# .NET Windows Form with text fields. The user enters data into this form and once they submit I need to generate a PDF file with their data arranged neatly. What is the best way to do this? Should I move the data into a database or can I directly export to PDF?
There is no need to add it to a database if you don't want to persist the data for later use. There are tons of libraries out there for pdf creation in c#.
Here's a post made not long ago with some great references. It also covers almost the same topic.
you want to export directly to pdf. are you have any specific format, how it should Looks.
otherwise create a crystal report. Design a format.After that write this code
Crystalreportobject.ExportToDisk(ExportFormatType.PortableDocFormat, name + ".pdf");
ExportToDiskMethod can Export directly to PDF
I have a PDF form which is used for the purpose of creating inspection reports.
I am currently using a c# WinForms GUI to accept data from users, insert this data into an MSSQL DB, and populate said PDF Form. The latter is achieved using the iTextSharp library.
I have been receiving requests that the process be reversed, whereby, the users enter the data into the form, for a more visually appealing interface, then, through means of a PDF button or something similar, take the data from the form fields in the background, and save it to the DB.
So the flow would be:
Users populate PDF Form > Button clicked > Data saved to DB > PDF Form saved to local machine.
Can anybody recommend a way of acheiving this? If there is a way of making PDF Buttons invoke C# scripts, that would be ideal, as I could simply have the button save the form, and then invoke a script passing the form filepath as a parameter.
Thanks in advance.
My preference would be to use a web interface or, as HighCore mentioned, WPF.
Acrobat does allow for a database interface with PDF forms. Look here at Adobe's website. The other option is that PDFs support JavaScript so you could use that to post data to a web service.
I created some mail merge template. It should create some email and sent to some contact. Template is using 'contact' entity.
How to create document from code using that template?
And, for example, send mail to specified contact.
MailMerge in CRM is a bit of a funny one. You upload a Word template (using a wizard) to create the MailMergeTemplate entity, during this process CRM will then inject a little macro into the document.
Downloading the document merged with data, actually just pushes the data into an HTML table that is placed as a comment in the word document, when you open the document (and go through the Word Mail-merge wizard again) the data is moved by the macro from the comment into the form fields.
So if you wan't to complete your mailmerge, you need both the template (stored as an xml blob in CRM), at this point I chose to insert the data manually (so I can't help you getting the sdk to inject the HTML table) by manually creating my own html table of data in a separate file (you need the entity data stored against display name and the calling user entity also against display name but prefixed with User_), you can then simply use the Word SDK to start and finish the mail merge in an automated way.
FYI the technique I used isn't supported by microsoft because Word churns out too many error messages to be automated so I got around this by installing a ClickOnce app on clients that did the merge so there would always be a user present. If you wan't to merge on a server, prepare to wage battle with DCOM also.
I've come across this a few times. When you say document, do you mean a Word attachment?
If so, this isn't a CRM thing, its a Word thing.
Similar Stackoverflow questions are a good place to start.
To get it working is complicated. Once you have populated your Word document, you have to get it back into CRM. It's messy...
What is a good way to display a click counter in HTML, if you are using a .aspx file that links to a .cs file which obtains headings from a SQL server without using an external text file to keep track by reading in and out? I'd really rather not use javascript because I want to associate it with a specific ID.
you'll need some sort of persistent storage to keep track over time. So either a text file, or recording each click to a database table.