How Can i do a excel graphic with jsp?

have to create an excel graph in jsp taken there values of a database.
thanks a lot,
Federico.

"is used to spawn Excel from a JSP page, from the output of a HTML table but i dont know how (or if you can) to manipulate Excel through java so that you can get a chart."
Let me rephrase this hehe =P
You create an HTML table from the data you pull from the database. You then use the setContentType
<%
response.setContentType("application/vnd.ms-excel");
%>
this is to tell the browser it should look for Excel on the client machine, to dispay the output.
Again i hope this helps even a little =)

Similar Messages

  • How can I create a Login-page with jsp???

    Hello,
    I have to create a page with JSP code on the Netweaver Developer Studio.
    But I do not know how I do it.
    Can anyone tell me what to write in the portalapp.xml?
    An example would be very helpful.
    Thank you
    Greetings

    As you can see in the example:
    The portalapp.xml file (deployment descriptor) provides configuration information for your application, and defines the components and services in your application. For each component and service, you specify the implementing Java class and configuration information.
    For more information on the format of the portalapp.xml, see Deployment Descriptor (portalapp.xml).
    <application>
        <application-config>
            <property name="SharingReference" value="com.sap.portal.navigation.service, com.sap.portal.navigation.api_mimeservice, com.sap.portal.navigation.helperservice"/>
            <property name="Vendor" value="MY_COMPANY"/>
            <property name="SecurityArea" value="PERMISSION"/>
        </application-config>
        <components>
            <component name="SimpleNavigationExample">
                <component-config>
                    <property name="ClassName" value="MY_CLASS"/>
                    <property name="SecurityZone" value="no_safety"/>
                </component-config>
                <component-profile/>
            </component>
        </components>
        <services/>
    </application>
    You can only update in this example, your class name and other details:
    <property name="Vendor" value="sap.com"/>
    <property name="SecurityArea" value="MyCompany"/>
    <property name="ClassName" value="LOGINCLASS"/>
    <property name="SecurityZone" value="no_safety"/>
    Modify this portalapp.xml file as follows:
           1.      NAVIGATION SERVICE, so you must add references to the following portal applications that define these services:
            com.sap.portal.navigation.service
            com.sap.portal.navigation.api_mimeservice
            com.sap.portal.navigation.helperservice
           2.      In the <application-config> section, create the following properties that help to define the security zone for all components and services in this application:
    ○     Vendor: String identifying the company or organization that provided the application, for example, sap.com.
    ○     SecurityArea: String identifying the security area for the application, for example, NetWeaver.portal.
           3.      In the <component-config> section for the mySiteMap component, create the property SecurityZone to define the specific security zone for the component.
    For Permission, check this document:
    http://help.sap.com/saphelp_nw04s/helpdata/en/44/489e2df5ee4e35e10000000a1553f6/frameset.htm

  • How can i compare two excel files with different no. of records.

    Hi
    I am on to a small project that involves us to compare two excel files. i am able to do it but am struck up at a point. When i compare 2 different .csv files with different no. of lines i am only able to compare upto a point till when the number of lines is same in both the files.
    Eg. if source file has 8 lines and target file has 12 lines. The difference is displayed only till 8 lines and the remaining 4 lines in source lines are not shown.
    Can you help me in displaying those extra 4 lines in source file. I am attaching my code snippet below..
    while (((strLine = br.readLine()) != null) && ((strLine1 = br1.readLine())) != null)
                     String delims = "[;,\t,,,|]";
                    String[] tokens = strLine.split(delims);
                    String[] tokens1 = strLine1.split(delims);
                   if (tokens.length > tokens1.length)
                    for (int i = 0; i < tokens.length; i++) {
                        try {
                            if (!tokens.equals(tokens1[i])) {
    System.out.println(tokens[i] + "<----->" + tokens1[i]);
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + tokens1[i]);
    out.println();
    sno++;
    } catch (Exception exception)
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + "");
    out.println();
    Thanks & Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    A CSV file is not an Excel file.
    But apart from that your logic makes no sense.
    If the 2 files are of different sizes the files are different by definition, so further comparison isn't needed, you're done.
    If you want to compare individual records, you need to compare all records from one file with all records from the other, unless the order of records is important in which case your current system might work.
    That system however is overly complicated for comparing CSV files.
    As you assume a single record per line, and if one can assume those records to have identical layout (so no leading or trailing whitespace in or between columns in one file that's not in the other) comparing records is simply a matter of comparing the entire lines.

  • How can I make ANY vector  graphics with graphics2D and save on clipboard?

    I am at my wits end here, and need some help. Simply put, I have a program that creates a basic x-y graph, drawn in a jpanel. I want to create the graph as a vector (emf, eps, svg, I don't care anymore, any of them would be good). But, all I get is a jpg or bitmap.
    I tried using the infamous FreeHEP programs, but it won't recognize the output as anything but "image" which means bitmap/jpg.
         The user enters x/y data, clicks a button, which crreates a jpanel thusly:
    public class GraphMaker extends JPanel {
    static BufferedImage image = new BufferedImage(600, 500, BufferedImage.TYPE_INT_ARGB);
    GraphMaker(double[] xVals, double[] yVals, double[] sems){
    setPreferredSize(new Dimension (600,500));     
    symSize = 10;
    XminV = 0;
    XmaxV = 0;
    // code here just converts input x and y's to pixel coordinates, spacing of ticks, etc...
    for (int i =0;i < ArLn; i++){
    gX[i] = xO + (gX[i] * xRat);
    gX[i] -= xStart;
    gY[i] = gY[i] * yRat;
    gY[i] = yEnd - gY;
    semVal[i] = semVal[i]*yRat;
         Ymin = yEnd - (Ymin*yRat);
         Ymax = yEnd - (Ymax*yRat);
    BufferedImage anImage = new BufferedImage(600, 500, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2 = anImage.createGraphics();
    g2.setBackground(white);
    g2.setColor( Color.WHITE );
    g2.fillRect(0,0,600,500);
    g2.setStroke(stroke);
    // here I use the values to draw lines and circles - nothing spectacular:
              g2.setPaint(Color.blue);
              int ii = 0;
              for ( int j = 0; j < ArLn[ii]; j++ ) {
    g2.fill(new Ellipse2D.Float(LgX[ii][j] - symOffst, gY[ii][j]-symOffst, symSize,symSize));
    g2.draw(new Line2D.Float(LgX[ii][j],(gY[ii][j]-semVal[ii][j]),LgX[ii][j],(gY[ii][j]+semVal[ii][j])));
    g2.draw(new Line2D.Float(LgX[ii][j]-2.0f,(gY[ii][j]-semVal[ii][j]),LgX[ii][j]+2.0f,(gY[ii][j]-semVal[ii][j])));
    g2.draw(new Line2D.Float(LgX[ii][j]-2.0f,(gY[ii][j]+semVal[ii][j]),LgX[ii][j]+2.0f,(gY[ii][j]+semVal[ii][j])));
                        g2.draw(new Line2D.Float(xLoVal[ii],yLoVal[ii],xHiVal[ii],yHiVal[ii]));
    image = anImage;
    And, when the user clicks on the "copy" button, invokes this:
    public class Freep implements Transferable, ClipboardOwner {
         public static final DataFlavor POSTSCRIPT_FLAVOR = new DataFlavor("application/postscript", "Postscript");
         private static DataFlavor[] supportedFlavors = {
              DataFlavor.imageFlavor,
              POSTSCRIPT_FLAVOR,
              DataFlavor.stringFlavor
         private static JPanel chart;
         private int width;
         private int height;
         public Freep(JPanel theGraph, int width, int height) {
              this.theGraph = Graphs;
              this.width = width;
              this.height = height;
    //******This is the key method right here: It is ALWAYS imageFlavor, never anything else. How do I make this an EPS flavor?
         public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
    if (flavor.equals(DataFlavor.imageFlavor)) {
    return GraphMaker.image;
    else if (flavor.equals(POSTSCRIPT_FLAVOR)) {
                   return new ByteArrayInputStream(epsOutputStream().toByteArray());
    else if (flavor.equals(DataFlavor.stringFlavor)) {
                   return epsOutputStream().toString();
              } else{
                   throw new UnsupportedFlavorException(flavor);
         private ByteArrayOutputStream epsOutputStream() throws IOException {
    EPSDocumentGraphics2D g2d = new EPSDocumentGraphics2D(false);
    g2d.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
    ByteArrayOutputStream out = new ByteArrayOutputStream();
         public DataFlavor[] getTransferDataFlavors() {
              return supportedFlavors;
         public boolean isDataFlavorSupported(DataFlavor flavor) {
              for(DataFlavor f : supportedFlavors) {
                   if (f.equals(flavor))
                        return true;
              return false;
         public void lostOwnership(Clipboard arg, Transferable arg1) {
    The same happens with FreeHEP - I want the flavor to be EMF, but the program sees an image so it is always imageFlavor. I know I am missing something, but what, I don't know.
    thanks for your help.

    I don't think there's a built-in solution. One workaround I've seen is to create a dummy graphics class that overrides the desired drawing functions. Instead of actually drawing pixels, the object writes postscript commands to a buffer. There also seems to be commercial code that does exactly this.

  • How do I fill an Excel spreadsheet with the contents of a DataTable? (C#, OleDb)

    The following fills a DataTable with the contents of an Excel spreadsheet.
        oledbCmd.CommandText = "SELECT * FROM [" + stSheetName + "$]";
        DataTable dtDataTable = new DataTable();
        using (OleDbDataAdapter oledbAdapter = new OleDbDataAdapter(oledbCmd))
        oledbAdapter.Fill(dtDataTable);
    How do I fill an Excel spreadsheet with the contents of a DataTable?
    bhs67

    You can try this Excel library, it can help u to
    export datatable to excel to Database.
    After add the reference to your project ,add the following code:
    private void button1_Click(object sender, EventArgs e)
    //connect database
    OleDbConnection connection = new OleDbConnection();
    connection.ConnectionString @"Provider=""Microsoft.Jet.OLEDB.4.0"";Data Source=""demo.mdb"";User Id=;Password="
    OleDbCommand command = new OleDbCommand();
    command.CommandText = "select * from parts";
    DataSet dataSet = new System.Data.DataSet();
    OleDbDataAdapter dataAdapter = new OleDbDataAdapter(command.CommandText,connection);
    dataAdapter.Fill(dataSet);
    DataTable t = dataSet.Tables[0];
    //export datatable to excel
    Workbook book = new Workbook();
    Worksheet sheet = book.Worksheets[0];
    sheet.InsertDataTable(t, true, 1, 1);
    book.SaveToFile("insertTableToExcel.xls");
    System.Diagnostics.Process.Start("insertTableToExcel.xls");
    http://www.e-iceblue.com/Tutorials/Spire.XLS/Spire.XLS-Program-Guide/Data-Export-/Import-Export-Datatable-to-Excel-from-Database.html

  • How do I merge multiple Excel files with more than one tab in each file using PowerQuery?

    Hello
    I have 12 Excel (.xlsx) files and each file has three identically named and ordered tabs in them. 
    I know how to merge multiple Excel files in a folder using M (those guides are all over the web) but how do I merge multiple Excel files with multiple (yet identically named and ordered) tabs? Surely it is possible? I just don't know how to do it in M.
    Cheers
    James

    What Laurence says is correct, and probably the best thing to do when the sheets have differing structures. Here is an alternate approach that works well when the sheets all have the same structure.
    When you first open the Excel file from Power Query, you can see its structure in the navigator at the right-hand-side of the screen. If you select the root (which is the filename itself) and click Edit, you'll see all the tabs in the sheet as a single table.
    You can now do filtering based on the Name, Item and Kind values. When you've reduced the set of things down to the sheets you want, select the Data column and say "Remove Other Columns". If the sheets don't have any header rows, you can just click the expand
    icon in the header and you'll be done.
    Otherwise, if the sheets have headers or if some other kind of sheet-level transformation is required against each sheet before doing a merge, you'll have to write some M code manually. In the following example, each sheet has a header row consisting of
    two columns: Foo and Bar. So the only step I need to perform before merging is to promote the first row into a header. This is done via the Table.TransformColumns operation.
    let
        Source = Excel.Workbook(File.Contents("C:\Users\CurtH\Desktop\Test1.xlsx")),
        RemovedOtherColumns = Table.SelectColumns(Source,{"Data"}),
        PromotedHeaders = Table.TransformColumns(RemovedOtherColumns,{{"Data", each Table.PromoteHeaders(_)}}),
        ExpandData = Table.ExpandTableColumn(PromotedHeaders, "Data", {"Foo", "Bar"}, {"Data.Foo", "Data.Bar"})
    in
        ExpandData

  • How can I create an Excel file?

    Hi,
    How can I create an Excel file using Forms 6i.
    What I'm doing is to create a file using TEXT_IO package an name it .XLS. If a read it double-clicking over the file, it opens Ok but If I open directly from Excel it opens the Convert dialog.
    I need to create an excel file as it was made from within Excel.
    Thank in advance,
    Benjamin

    When you are talking about subfiles, are you talking like Package contents of an application?
    Terminal application in Applications -> Utilities can give a command line grasp of all your files using the du command.
    Type
    man du
    when entering the terminal, followed by the enter key.
    Note, by default the terminal opens at the Home folder.   To navigate outside the Home folder enter "/Volumes/name of mounted drive/folder/subfolder" as your path.  If there are spaces in the name, putting quotes around the whole path can help.    If you end your du command with a > name.txt a text file with the name name.txt will be plugged into your Home directory.  That you can open with Excel and parse by /es thus giving you everything in Excel.

  • How can we use    27" thunderbold screen with  macpro 2010 - 2011  model ?

    how can we use    27" thunderbold screen with  macpro 2010 - 2011  model ?
    regards
    paykom.com.tr
    orhan batur

    Unfortnately you cannot. Thunderbolt is an onboard chip that will require an updated Mac Pro. It is not a graphics card upgrade, but a full logicboard upgrade.
    Apple has not updated the Mac Pro in 580 days - as of this post. Hopefully one is right around the corner...but I've been hoping for that for over a year.

  • How can I convert to excel?

    How can I convert to excel?

    Hi Garry,
    You can use the ExportPDF online subscription to convert PDF files to Excel format (as well as Word and RTF). It's a very straightforward process, but this short document will walk you through the steps: Getting Started with ExportPDF | Adobe Community
    Please let us know if you have additional questions.
    Best,
    Sara

  • How can I disable the memory sharing with the video?

    how can I disable the memory sharing with the graphic card? it makes me impossible to run a software, grandMA2, on windows 7 installed and run via bootcamp. where should I look for changing the preferences of memory and video, on lion or on windows7? thank you

    so what do you think. I run a software on windows 7 running via bootcamp on my mbp, but I can't open it. the software is compatible with windows 7 on mac. I tried opening it as administrator or changing the compatibility options, like running it as windows xp, and changing the resolution of the video. it can't build the window and then it crashes. on internet I found a compatibility list of the software where it says please do not use any shared memory for the graphic card. what does it mean? I have just to remove the check in automatic graphics switching? what should I try to do? thank you. 

  • How can I recover my old account with a new one?

    Hi, my hotmail account it was hacked, I can't have acces to my adobe account anymore.
    How can I get acces to my old account with a new Adobe ID?
    I'm already subscribed to creative cloud and I can't have acces to my account and upgrade my products.
    what can I do?
    Thanks

    Thanks Romshina
    I read the link you send me and thanks, but the thing is that I still can't get into my Adobe Id, because when I try they ask me to reset my password in an email they will send me to my old account and there is the problem, because I don't have acces to that old acount, [email protected]
    now this is my new email, because the las one it was hacked and I just can't get back to it.
    So I would like to have access to my account and update this new email account, to have acces to my CC account.
    Thanks
    Date: Fri, 27 Dec 2013 06:51:15 -0800
    From: [email protected]
    To: <Removed by Moderator>
    Subject: Re: How can I recover my old account with a new one? How can I recover my old account with a new one?
        Re: How can I recover my old account with a new one?
        created by Romsinha in Adobe Creative Cloud - View the full discussion
    Hi Guillermo Castellanos,
    Please refer the knowledge base article: http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sig n-faq.html.
    Regards,
    Romit Sinha
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5959347#5959347
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Re: How can I recover my old account with a new one?
    To unsubscribe from this thread, please visit the message page at Re: How can I recover my old account with a new one?. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Adobe Creative Cloud at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • How can we view the data asociated with Request ID

    Hi All,
    I have data loaded in an ODS there are multiple files loaded in this ODS. Now i want to view data for a perticuler request OR i want to know how can we know the data associated with a perticular request.
    Please help me out.
    Thanks & Regards
    Amit Kumar

    Copy the request number (not request ID) from the ODS manage screen, Goto RSRQ give the request number and execute. it shows the monitor screen- now goto PSA from the top and check the data. But this possible only if you are loading data to PSA also along with ODS.
    Otherwise, Goto Display Data of ODS from the right click on it -- in the selection screen give the Request ID that you want to check the data. Then it displays only that request data.
    Hope this helps.
    Veerendra.
    Edited by: denduluri veerendra kumar on Dec 1, 2009 12:40 PM
    Edited by: denduluri veerendra kumar on Dec 1, 2009 12:43 PM

  • How can I use my Apple ID with 2 Apple devices?

    I just got an ipad mini and I registered it with the same Apple ID I use for my iphone 4s. Everything was fine until I downloaded apps to the ipad and noticed that the ones I had on both devices  no longer opened on my iphone. Why is this? How can I use my Apple ID with 2 Apple devices and how can I recover my apps on my iphone?

    I've had an iPad for almost two years. When I purchased an iPhone last fall I set it up to use the same Apple ID as my iPhone. I've had no problems doing this. Try resetting each device and see what happens.
    First thing to try is to reset your device. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider should one appear until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • How can i use my apple ID with the itune store over my windows laptop

    how can i use my apple ID with the itune store over my windows laptop

    If you don't have iTunes installed on your laptop then you can download and install it from here : http://www.apple.com/itunes/download/
    You can then log into your account on it via the Store > Sign In menu option (on iTunes 11 on a PC you can get the menus to show via control-B) :
    And you can then select the Store on the left-hand sidebar (you can enable the sidebar via control-S), and then browse items in the store and buy them by clickin on their price.

  • I am new to IPAD and I want o use facetime, how can I use it to communicate with my mac at home, do I need to create another account with a different email account

    I am new to IPAD and I want o use facetime, how can I use it to communicate with my mac at home, do I need to create another account with a different email account

    do I need to create another account with a different email account
    Yes, the email addresses need to be unique to each device. You may use the same Apple ID on each device, but the email address used by each device needs to be different.

Maybe you are looking for

  • My ibook G4 powerpc 10.4.11 is locking up. What kind of disk do I need to buy to repair it?

    I need to buy a copy of the OS X software to repair it but I'm confused about what I need.  Install disk or restore disk?  Is there a difference? Can I use 10.5 instead of 10.4?  All I do is surf the internet with it so I don't care about ilife and w

  • How to change DNS zone, or how to host email outside of BC

    I have BC from Creative Cloud Suite, so I have the cheapest possible plan for BC.  Meaning I don't get any email hosting.  So I was looking to host email outside of BC.  I looked it up on google to see if it could be done (I'm really new with all thi

  • Sending and recieving message problems

    hi. I am used to use skype from my samsung galaxy note and it was working fine but suddenly skype has been disturbing lately I can see whom I am talking to but when I am sending any message I am not being able to see what I am sending on my screen an

  • Data lineage subject area in DAC

    Hello All, can anyone provide me the details of the predefined inactive subject area "data lineage" in the DAC. I mean what all this subject area contains. Any help would be appreciated.

  • Loss style when overriding the function 'set data' for a TileList

    Hi! In a TileList, I set the itemRenderer for a components from where I override the function set data like in this example: but, by doing this, I'm loosing all the built-in CSS behavior. The onMouseOver effect the change the backgroundColor and the