Search Results

Search found 23316 results on 933 pages for 'content generation'.

Page 9/933 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • i had problem in adding the additional content in my pdf

    - by Ayyappan.Anbalagan
    I am converting my data set into a pdf document.My data set contains the product bill details.So,at the top of the pdf i need to added some more content like "my company name & address customer name, date of bill,bill no" Below code i am using to convert into pdf. public static void Exportdata(DataTable dataTable, HttpResponse Response, int val) { //String filename = String.Concat(name, "-", DateTime.Today.Day.ToString(), "/", DateTime.Today.Month.ToString(), "/", DateTime.Today.Year.ToString(), ".pdf"); Document pdfDoc = new Document(PageSize.A4, 30, 30, 40, 25); System.IO.MemoryStream mStream = new System.IO.MemoryStream(); PdfWriter writer = PdfWriter.GetInstance(pdfDoc, mStream); //int cols = 0; //int rows = 0; int cols = dataTable.Columns.Count; int rows = dataTable.Rows.Count; pdfDoc.Open(); iTextSharp.text.Table pdfTable = new iTextSharp.text.Table(cols, rows); pdfTable.BorderWidth = 1; pdfTable.Width = 100; pdfTable.Padding = 1; pdfTable.Spacing = 1; //creating table headers for (int i = 0; i < cols; i++) { Cell cellCols = new Cell(); Font ColFont = FontFactory.GetFont(FontFactory.HELVETICA, 8, Font.BOLD); Chunk chunkCols = new Chunk(dataTable.Columns[i].ColumnName, ColFont); cellCols.Add(chunkCols); pdfTable.AddCell(cellCols); } //creating table data (actual result) for (int k = 0; k < rows; k++) { for (int j = 0; j < cols; j++) { Cell cellRows = new Cell(); Font RowFont = FontFactory.GetFont(FontFactory.HELVETICA, 6); Chunk chunkRows = new Chunk(dataTable.Rows[k][j].ToString(), RowFont); cellRows.Add(chunkRows); pdfTable.AddCell(cellRows); } } pdfDoc.Add(pdfTable); pdfDoc.Close(); Response.ContentType = "application/octet-stream"; if (val == 1) { Response.AddHeader("Content-Disposition", "attachment; filename=Users.pdf"); } else if (val == 2) { Response.AddHeader("Content-Disposition", "attachment; filename=Customers.pdf"); } else if (val == 3) { Response.AddHeader("Content-Disposition", "attachment; filename=Materials.pdf"); } else { Response.AddHeader("Content-Disposition", "attachment; filename=Reports.pdf"); } Response.Clear(); Response.BinaryWrite(mStream.ToArray()); //Response.Write(mStream.ToString()); HttpContext.Current.ApplicationInstance.CompleteRequest(); Response.End(); }

    Read the article

  • i had problem in adding the additional content in my pdf...using asp.net c#

    - by Ayyappan.Anbalagan
    I am converting my data set into a pdf document.My data set contains the product bill details.So,at the top of the pdf i need to added some more content like "my company name & address customer name, date of bill,bill no" Below code i am using to convert into pdf. public static void Exportdata(DataTable dataTable, HttpResponse Response, int val) { //String filename = String.Concat(name, "-", DateTime.Today.Day.ToString(), "/", DateTime.Today.Month.ToString(), "/", DateTime.Today.Year.ToString(), ".pdf"); Document pdfDoc = new Document(PageSize.A4, 30, 30, 40, 25); System.IO.MemoryStream mStream = new System.IO.MemoryStream(); PdfWriter writer = PdfWriter.GetInstance(pdfDoc, mStream); //int cols = 0; //int rows = 0; int cols = dataTable.Columns.Count; int rows = dataTable.Rows.Count; pdfDoc.Open(); iTextSharp.text.Table pdfTable = new iTextSharp.text.Table(cols, rows); pdfTable.BorderWidth = 1; pdfTable.Width = 100; pdfTable.Padding = 1; pdfTable.Spacing = 1; //creating table headers for (int i = 0; i < cols; i++) { Cell cellCols = new Cell(); Font ColFont = FontFactory.GetFont(FontFactory.HELVETICA, 8, Font.BOLD); Chunk chunkCols = new Chunk(dataTable.Columns[i].ColumnName, ColFont); cellCols.Add(chunkCols); pdfTable.AddCell(cellCols); } //creating table data (actual result) for (int k = 0; k < rows; k++) { for (int j = 0; j < cols; j++) { Cell cellRows = new Cell(); Font RowFont = FontFactory.GetFont(FontFactory.HELVETICA, 6); Chunk chunkRows = new Chunk(dataTable.Rows[k][j].ToString(), RowFont); cellRows.Add(chunkRows); pdfTable.AddCell(cellRows); } } pdfDoc.Add(pdfTable); pdfDoc.Close(); Response.ContentType = "application/octet-stream"; if (val == 1) { Response.AddHeader("Content-Disposition", "attachment; filename=Users.pdf"); } else if (val == 2) { Response.AddHeader("Content-Disposition", "attachment; filename=Customers.pdf"); } else if (val == 3) { Response.AddHeader("Content-Disposition", "attachment; filename=Materials.pdf"); } else { Response.AddHeader("Content-Disposition", "attachment; filename=Reports.pdf"); } Response.Clear(); Response.BinaryWrite(mStream.ToArray()); //Response.Write(mStream.ToString()); HttpContext.Current.ApplicationInstance.CompleteRequest(); Response.End(); }

    Read the article

  • Random users randomly being unable to connect to my static content domain

    - by jls33fsls
    I store all of my images, js, and css files on a separate domain to try and speed up page load times (it isn't a CDN, just a separate domain on the same server). This works fine for 99% of the users, 99% of the time. However, there are users that randomly are unable to connect to the static content domain for periods of 1-5 hours. They can go to the main site, but no images will load and everything is just white because no css is being loaded. If they go to the static content domain itself, the page just idles for a while and then times out with a blank white page, no error messages. I have no idea what could be causing this, and it hasn't happened to me, any ideas? I am running Apache on CentOS 5.5.

    Read the article

  • AndroMDA maven code generation and JPA Annotations

    - by ArsenioM
    I am using the AndroMDA plugin for maven to generate code from an uml diagram made in MagicDraw. When the code is generated, AndroMDA desings the JPA annotation for the persitence layer. I think that at the compilation process AndroMDA uses Naming Strategies to determine the Table and Column names for the DataBase. I want to determine how AndroMDA desings this JPA annotations, because I need to display this DataBase names based on the UML entity and atributtes names. I was regarding if there is an API of AndroMDA that I could use to do this by giving it the uml diagram. Or at least, to know the Naming Strategies used by AndroMDA to achive that. AndroMDA at the compilation process design the JPA annotations for the Entities, Attributes, etc that are written in my java classes under a series of rules that exist within the EJB3 cartridge of AndroMDA. (The further Database is created using those JPA annotations). I want to create a program that returns me the same Table and Attributes names wrote on the JPA annotations, by giving it the .xml file of the uml diagram of a project. I was hoping that I could take advantage of the EJB3 cartridge to generate those Tables and Attribute names with my program. One way could be using an API of AndroMDA that do this(if it exits), or at least, by implementing the same rules used by the EJB3 cartridge for that matter. To be more illustrative, For example: If in my uml model I have an Entity called “CompanyGroup”, AndroMDA would generate the following code for the class definition: @javax.persistence.Entity @javax.persistence.Table(name = "COMPANY_GR") Public class CompanyGroup implements java.io.Serializable, Comparable< CompanyGroup This is just an example (not a real case), but nevertheless, the way how AndroMDA do the translation from “CompanyGroup” to “COMPANY_GR” has to be specified somewhere. Hope this explanation is useful enough. Thanks.

    Read the article

  • Google wave: PDF-generation (pdfjet)

    - by mike
    PDFjet says it supports App Engine, which by extension means it will run on Wave. e question is how can I get to to work on the Google WavE? The goal is to get a PDF-button in the wave which is able to output the whole wave into PDF Any assistance would be greatly appreciated.

    Read the article

  • Looking for a good world map generation algorithm

    - by FalconNL
    I'm working on a Civilization-like game and I'm looking for a good algorithm for generating Earth-like world maps. I've experimented with a few alternatives, but haven't hit on a real winner yet. One option is to generate a heightmap using perlin noise and add water at a level so that about 30% of the world is land. While perlin noise (or similar fractal-based techniques) are frequently used for terrain and is reasonably realistic, it doesn't offer much in the way of control over the number, size and position of the resulting continents, which I'd like to have from a gameplay perspective. See http://farm3.static.flickr.com/2792/4462870263_ff26c40365_o.jpg for an example (sorry, can't post pictures yet). A second option is to start with a randomly positioned one-tile seed (I'm working on a grid of tiles), determine the desired size for the continent and each turn add a tile that is horizontally or vertically adjacent to the existing continent until you've reached the desired size. Repeat for the other continents. This technique is part of the algorithm used in Civilization 4. The problem is that after placing the first few continents, it's possible to pick a starting location that's surrounded by other continents, and thus won't fit the new one. Also, it has a tendency to spawn continents too close together, resulting in something that looks more like a river than continents. See http://farm5.static.flickr.com/4069/4462870383_46e86b155c_o.jpg for an example. Does anyone happen to know a good algorithm for generating realistic continents on a grid-based map while keeping control over their number and relative sizes?

    Read the article

  • Creating a user-defined code generation system in PHP

    - by user270766
    My newest project that I'm looking to build with CodeIgniter would require some sort of system that would allow a user to drag and drop pre-defined functions/methods into mini-classes/objects and then run/test them in the browser. So it'd something similar to Scratch. I've designed a relational database that I think could work for this (storing the function names and have these classes "subscribe" to those functions) - but I'm wondering whether or not to go ahead with it. Is there a better way to do this or is there a system out there that would accomplish this for me? EDIT: It would have to be extremely simple for an end user, but hopefully be flexible enough to easily add more complex functionality in the future.

    Read the article

  • Rails PDF Generation with Prawn in IE7

    - by fluid_chelsea
    I'm using Prawn and Prawnto to generate a PDF in a Ruby on Rails app (Rails version 2.2.2) which works great and generates PDFs happily and sends them to the user to download in Firefox. The problem is in IE7. I have a route set up like so: map.invoice_pdf '/invoices.pdf', :controller => 'invoices', :action => 'index', :format => 'pdf' Which I then have a link like so to call: invoice_pdf_path(:year => params[:year], :month => params[:month], :unpaid_only => params[:unpaid_only]) And the following in my controller: def index params[:year] = default params[:year] params[:month] = default params[:month] params[:page] ||= 1 @invoices = Arobl.find_invoices_for_customer(current_customer.strCustomerID, params) respond_to do |format| format.html{ render :action => 'index' } format.pdf{ prawnto :inline => false, :filename => "#{current_customer.strCustomerID}_invoice.pdf" end In FF this works as expected, when the link is clicked the show action is invoked with a format of .pdf, and responds with the correctly named PDF. When it's hit with IE7 it says that the file or website could not be found, and references "invoices.pdf" instead of the expected customer_id_invoice.pdf filename. Any idea what could be causing this behaviour? Thanks!

    Read the article

  • LocalReport (WebForms) and Partial Trust, for PDF Generation

    - by Peet Brits
    My goal is to generate a PDF for display in a web page, either as aspx or with a generic handler. (This will link from a Silverlight page, but this is irrelevant to the problem.) The problem is that LocalReport (Microsoft.Reporting.WebForms; Microsoft.ReportViewer.WebForms.dll) requires full trust, and our hosting server does not allow full trust. I am aware that ReportViewer has a remote mode that will allow it to run with partial trust, but for that I need a report server url which should probably have full trust as well, which does not solve anything. So how do I generate PDFs from WebForms in a partially trusted environment?

    Read the article

  • XCode code generation

    - by Ali Shafai
    I was wondering if there is a tool (automator script or a third party) to generate code for simple scenarios like add another property. I don't like going to two or three places and write the same thing over and over again. instead I want to say "I want a new property of type int with name X" and it generates the lines in .h and .m files for me in one go.

    Read the article

  • Code Generation(based on templates) for COCOA

    - by Vikas
    Hi, I have written a library for I-phone which is based upon some object models(whose definitions I get via XML). Now I have one implementation for a sample model ready but to make the code library generic I want to write an application where I can templatize the code and provide placeholders for data model specific points. Is there any tool available for Xcode to enable me do this. In java "Velocity" does this job for me. Regards, Vikas

    Read the article

  • Class generation on the fly

    - by James P.
    Is it possible to generate subclasses at runtime or while an application is running? If so, how is this achieved and what precautions should be taken to prevent a rogue object wreaking havoc inside an application?

    Read the article

  • DTO and mapper generation from Domain Objects

    - by Nicolas
    I have plenty of java domain objects that I need to transform to DTOs. Please, don't start with the anti-pattern thing, the Domain Objects are what they are because of a long history, and I can't modify them (or not too much, see below). So, of course, we've passed the age of doing all that manually. I've looked around, and dozer seems the framework of choice for DTO mapping. But... what I'd really like is this: annotate classes and fields that I want in DTO, and run a tool that would generate the DTOs and the mappers. Does that sound too unreasonable? Does such a tool already exist?

    Read the article

  • Integrate code generation with eclipse c++ build

    - by Dan
    Hi, I am using Eclipse for C++ development on windows. I have also written a code generator that take an xml file and produces several C++ files. The project I am working on is currently setup to use the internal builder. What I would like to do is to run the code generator as part of the build process. My problem is that I haven't been able to find a way to make Eclipse identify that the files are present (or have been updated) without 'Refeshing' the project. So although I can run the code generator as a pre-build step, the files generated aren't guaranteed to be included in the build. Does anybody know whether there is a way to make Eclipse do a refresh after the pre-build step or something to that effect, using the internal builder? Thanks

    Read the article

  • PDF Report generation

    - by IniTech
    EDIT : I completed this project using ABCpdf. For anyone interested, I love this product and their support is A+. Everything I listed as a 'Con' for the HTML - PDF solution was easily doable in ABCpdf. I've been charged with creating a data driven pdf report. After reviewing the plethora of options, I have narrowed it down to 2. I need you all to to help me decide, or offer alternatives I haven't considered. Here are the requirements: 100% Data driven Eventually PDF (a stop in HTML is fine, so long as it is converted) Can be run with multiple sets of data (the layout is always the same, the data is variable) Contains normal analysis-style copy (saved in DB with html markup) Contains tables (data for tables is generated at run-time) Header/Page # on each page Table of Contents .NET (VB or C#) Done quickly Now, because of the fact that the report is going to be generated with multiple sets of data, I don't think a stamped pdf template will work since I won't know how long or how many pages a certain piece of the report could require. So, I think my best options are: Programmatic creation using an iText-like solution. Generate in HTML and convert to PDF using a third-party application (ABCPdf is the tool I have played with so far) Both solutions have their pro's and con's. Programmatic solution: Pros: Flexible Easy page numbering/page header/table of contents Free Cons: Time consuming (to write a layer on top of iText to do what I need and keep maintainable) Since the copy is already stored in the db with html markup, I would have to parse through the data before I place it into the pdf, ensuring I don't have to break the paragraph into chunks so I can apply bold, italic, underline, etc. to specific phrases. This seems like a huge PITA, and I hope I am wrong about that assumption. HTML - PDF Pros: Easy to generate from db (no parsing necessary) Many tools for conversion Uses technology I am already familiar with Built-in "Print Preview" - not a req, but nice Cons: (Edited after project completion. All of my assumptions were incorrect and ABCpdf is awesome) 1. Almost impossible to generate page headers - Not True 2. Very difficult to generate page numbers Not True 3. Nearly impossible to generate table of contents Not True 4. (Cross-browser support isn't a con; Since its internal, I can dictate what browser to use) 5. Conversion tool quirks - may not convert exactly as rendered in browser Not True 6. Overall, I think it would be very hard to format the HTML exactly as I would want it to appear/convert to PDF. Not True That's it - I need the communitys help in deciding which way I should go. I might be wrong about some of my Pro/Con assumptions. If I am, please tell me. All thoughts and suggestions are welcome and appreciated. Thanks

    Read the article

  • Is Pex (Test generation) really usefull tool?

    - by Yauheni Sivukha
    Yes, it is possible to generate tests on boundary values for functions like "Sum" or "Divide". Pex is a good tool here. But more often we create tests on business behaviour. Let's consider example from classic Beck's tdd book: [Test] public void ShouldRoundOnCreation() { Money money = new Money(20.678); Assert.AreEqual(20.68,money.Amount); Assert.AreEqual(2068,money.Cents); } Can this test be generated? No :) 95 % of tests in my projects check business logic, and can not be generated. Pex (Especially in pair with Moles) can give 100% code coverage, but a high code coverage rate of a test suite does never indicate, that code is well tested - It only gives false confidence that everything is tested. And this is very dangerous. So, the question is - Is Pex really usefull tool?

    Read the article

  • Is Lightweight Code Generation (LCG) dead?

    - by Greg Beech
    In the .NET 2.0-3.5 frameworks, LCG (aka the DynamicMethod class) was a decent way to emit lightweight methods at runtime when no class structure was needed to support them. In .NET 4.0, expression trees now support statements and blocks, and as such appear to provide sufficient functionality to build just about any functionality you could require from such a method, and can be constructed in a much easier and safer way than directly emitting CIL op-codes. (This statement is borne from today's experimentation of converting some of our most complex LCG code to use expression tree building and compilation instead.) So is there any reason why one would use LCG in any new code? Is there anything it can do that expression trees cannot? Or is it now a 'dead' piece of functionality?

    Read the article

  • Admin auto generation

    - by Me-and-Coding
    Hi, I create custom CMS sites and then go ahead for the backend/admin side. Is there any tool out there to automatically create admin side of my sites, for example, based on table relationships or whatever customization we may put in place. PHPMaker seems to claim something like what i ask for but i have not used it. Any tool out there to auto-create admin side or PHPMaker is up to the point? Thanks

    Read the article

  • Controlling symbol generation in Clojure macros

    - by mikera
    I'm trying (as a self-learning exercise) to create a Clojure macro that will generate code to apply a function to a sequence of integers and sum the result, e.g. f(0) + f(1) + f(2) + f(3) This is my attempt: (defmacro testsum [func n] `(fn [x#] (+ ~@( map (fn [i] `(~func x#)) (range n))))) However something seems to go wrong with the x# gensym and I end up with two different versions of x and hence the function doesn't work: (macroexpand '(testsum inc 3)) gives: (fn* ([x__809__auto__] (clojure.core/+ (inc x__808__auto__) (inc x__808__auto__) (inc x__808__auto__)))) This is pretty much exactly what I want apart from the different 809 and 808 versions of x..... What am I doing wrong? I thought that the auto gensym was meant to create a single unique symbol for exactly this kind of purpose? Is there a better way of doing this?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >