I am in need of generating a PDF document (or some other type of formatted document such as an rtf) on the fly from a weg page. I am aware of components such as PDFLIb, which I currently use on a few applications, however, quite expensive. Would anyone be able to suggest another method or component to do so? I need to have good formatting capability and additionally, not have the URL's display on the page generated, whne printed.
I have a designer working on several pages in Dreamweaver. The designer is creating .aspx files with the Page directive at the top. These are getting shipped to me and I'm adding them to the Visual Studio ASP.NET WebForms Web Application Project. The problem is that there's no code-behind file by default, and I'm trying to find a shortcut to have them autogenerated as if I've added a fresh page from Visual Studio.
I need to get data from a database and I need to spit out this data in html formatk using my command line app. For this I am planning to use some sort of template-engine. I was wondering if there is anything in .NET that can do this for me?
The best option would be if I could reuse the asp.net mvc template engine (razor) in my app, this way I should not need to reinvent the wheel.
When trying to generate rdp files on a web server with C#, when I try to save the rdp file it always fails with access denied. ASPNET and Network Services has full access, and even added EVERYONE as full permissions and it still won't save?
I am using LINQ to SQL with C#. Is there a method through which we can generate entity class files from the table schema? By dragging tables onto the graphical designer classes are generated but they are not the real class files(i mean actual files with the extension cs).
I am aware of that we can code the class files first and then create the schema manually or programmatically, but i wanted to know if the reverse is possible, may be using some third-party tools. I feel it will be very convenient to use LINQ that way.
I am trying to generate a pdf document using the following code which i picked up from one of these forums. It had worked fine when I exported a gridview to pdf.
Now I need to export HTML code to pdf. Can someone suggest how to proceed, possibly using the gridview exporting code below? Any other approach is also welcome.
Code:
Response.ContentType = "application/pdf"; filename = "DocumentName.pdf"; Response.AddHeader("content-disposition", "attachment;filename=" + filename); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); gridView1.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); Document pdfDoc = new Document(PageSize.B2, 10f, 10f, 10f, 0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); PdfWriter.GetInstance(pdfDoc, Response.OutputStream); string sFinanceReportpath = ConfigurationManager.AppSettings["UploadFinanceReportPath"].ToString(); PdfWriter writer = PdfWriter.GetInstance(pdfDoc, new FileStream(sFinanceReportpath + filename, FileMode.Create)); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); //Response.Write(pdfDoc); //Response.End();
I'm trying to redirect to another page by calling an action in controller with a specific parameter. I'm trying to use this line:
window.open('<%= Url.Action("Report", "Survey", new { id = ' + selectedRow + ' } ) %>');
But I couldn't make it work; it gives the following error:
CS1012: Too many characters in character literal.
Can't I generate the action URL this was on the client side? Or do I have to make an Ajax call by supplying the parameter and get back the needed URL? This doesn't seem right, but I want to if it's the only way.
I'm currently running a site of a dedicated server but want to scale up using Microsofts Azure cloud platform in the future but im unsure if a certin part of my code will work on azure.The site consists of a gallery of items with an image for each item.The images are stored in a sqlserver database.
I have created a http handler that caches the images to disk and redirects the request to the image (as shown at the end of the post).The images are saved into a virtual directory called "imagecache" inside my ASP.NET application. (i.e. ~/imagecache/ ).
As the web app will run in many virtual machine instances on the Azure platform the images will need to be shared between the instances right?So my question really is.. What is the best way of achieving what I already have on that is compatible wit azure?Image gen code..
public class getimage : IHttpHandler { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public void ProcessRequest (HttpContext context) { [code]....
I have 3 tables(Status,Clist,longlead) having "WOnumber" common column in 3 tables and 3 web forms(status.aspx,Clist.aspx,longlead.aspx), on main page(status.aspx) i have buttons to redirect the clist.aspx and longlead.aspx to give the inputs and save it to database.I have button called scheduleReport on status.aspx when i click this button I want the values from Clist table and longlead table of corresponding WONumber values should be listed either in word or pdf.on the top of the report it should have WONUmber.
i have an application where users are allowed to fill in a form, once saved the form is given a unqiue # in this format: YYYY/MM/DD/### where ### is a 3 digit number, starts at 001, next one would be 002, etc.. the the YYYY/MM/DD is the date the form was saved, so if we had 2 saved today we would get these two:
2011/01/10/001 2011/01/10/002
I just wanted to know how to be sure that those numbers are always unqiue, if two people submit a form at the same time to make sure they are not given the same number? As we had that happen recently now that the application is being used a lot more, two people saved about the same time and once someone clicked save twice while the first save was happening and 2 of the same IDs were generated. Just want to make sure no matter what a unqiue one is always generated. I 'm able to calculate the ###, just wanted to know if there is a way to make sure it's not being used by a process saving right now.
I'm trying to generate a bitmap off a WPF border. The whole thing sits in a asp.net app (server side of course) running .net 4.0. The problem is, that the generated image is, well, empty. Does anyone have an idea why? Here's the code.
public static byte[] Draw(int width, int height) { MemoryStream memoryStream = new MemoryStream(); Thread t = new Thread(delegate() { System.Windows.Controls.Border border = new System.Windows.Controls.Border() { Background = Brushes.Red, BorderBrush = Brushes.Green, CornerRadius = new System.Windows.CornerRadius(5), Width = width, Height = height }; border.ApplyTemplate(); RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap(width, height, 90, 90, PixelFormats.Pbgra32); renderTargetBitmap.Render(border); BitmapEncoder bitmapEncoder = new PngBitmapEncoder(); bitmapEncoder.Frames.Add(BitmapFrame.Create(renderTargetBitmap)); bitmapEncoder.Save(memoryStream); }); t.SetApartmentState(ApartmentState.STA); t.Start(); bool success = t.Join(5000); if (success) return memoryStream.ToArray(); else throw new Exception("Fail"); }
The result is quite bad, as I said the thing returns the image with the right width and height, but it's empty, so I guess I don't mess the thing up with the threading bit.
I am currently watching the 80 minute ASP.NET MVC introduction. Automatically generating views from a model is pretty neat, but it seems to me that that the automatically generated views could be much better. For a start, instead of inputing dates with text boxes, there could be a date control. Additionally, number inputs could be verified client side. There are probably other improvements that could be made as well. Is it possible to automatically generate better views?
I know that this issue has been raised on so many occasion and I am stuck with two options, one being to create a thumbnail folder whenever a picture is uploaded to the server, here I am using a folder with so many subfolder, upon saving on the server folder, I pass in the subfolder name and the file name, to retrieve the image i need the two parameters but also the resize sizes and as such this measure is almost abosulte.
the other way is to resize on the fly when the user is requesting the picture, this is where I have been stuck on and need some guidance. and here is the code
I have a file that I need to copy, run a command against the copy that specializes it for the person downloading it, and then provide that copy to a user to download. I'm using ASP.Net MVC2, and I've never done anything like this. I've searched around for the simplest way to do it, but I haven't found much, so I've come up with a plan.
I think what I'll do is generate a guid, which will become the name of a folder I'll generate at the same level of the source file that the copy is made from. I'll then copy the file to that folder, run my command against it, provide a link to the file, and I'll have some service that runs every now and then that deletes directories that are more than a day old.
In my current role, I support and develop a .net 1.1 website which was developed by my predecessor.
For generating reports/ invoices/ etc, the site uses a find and replace system reading a template rtf file with a stream reader and writing the output using a streamwriter to an rtf file.
I have been asked to generate a new report for the system which has many more tables than the previous reports and is generally more sophisticated.
I have taken a lot of time in trying to develop this report with not much success as the rtf formatting (e.g par for a line break) is to me quite difficult to master causing the document to crash infrequently in word (!) The rtf solution although frustrating is quite a simple format that can be managed in code. But it takes a lot of time to set up the documents...
Is there a .net code library or similar anyone is aware of that can write rtf to generate tables and other simple formatting. I am restricted to using .net 1.1
If I have the time would like to redevelop this system. I have googled for a more sophisticated system and have seen how to use html, etc. in word docs, but I don't really want to run word on the web server. What are the current best practices to generate invoices/ reports etc. from data using .net? Should I stick with this rtf method or is there an easier/quicker/friendlier way! In this regard I'd consider anything - .net 1 to 4
The application is a typical business system so any links to other resources for requirements such as a document generation system, email system, diary management (tasks to do for a specific user )
In my .aspx.cs I have a code that reads a .xml file and I deserialize the xml into an object called Post. Problem is that in my .aspx page I have a div and I want to fill in the content of this div from code behind using the html generated from the code behind.. How can I do this?
i am using the above code for pdf generation from html text in HTMLEditor(ajax control). If i hardcode a table with each column of different width, into HTMLEditor text than while generating pdf the column get devided equally i.e all column have fixed size on pdf even if i specify some custom width for each column.
I want to generate pdf that can convert html to pdf,also divide table column with specified width. How to do it?
I have a simple page inside a master page (well, in a master in a master).
In the top master I have the head tag with runat="server", with a number of bits such as scripts, stylesheets, etc. and also a contentplaceholder. There is no title tag here.
In the page that uses this master, the content for the placeholder contains the <title>pagename</title> bit in it. I really have to set it in there.
Unfortunately when the page is rendered I get my title which is all good, but also get a second blank title tag - I presume dumped in there by .NET.
Is there any way of stopping this second title tag coming out?