I want create a graph in excel

hi
    I have created a program using field-symbols and add excel download using OLE object everything finished now i want to download graph in the excel how can do that help me.now the program completed until excel download the data now i want to create graph usinf the data.
regards,
Siva

Hi Siva,
Use the foll code, just give 1 / 2 in Sheets parameter.
*& Report  ZJOTHI_GRAPHICS_IN_EXCEL                                    *
report  zjothi_graphics_in_excel  no standard page heading
include ole2incl .
data: gs_excel type ole2_object ,
gs_wbooklist type ole2_object ,
gs_application type ole2_object ,
gs_wbook type ole2_object ,
gs_activesheet type ole2_object ,
gs_sheets type ole2_object ,
gs_newsheet type ole2_object ,
gs_cell1 type ole2_object ,
gs_cell2 type ole2_object ,
gs_cells type ole2_object ,
gs_range type ole2_object ,
gs_font type ole2_object ,
gs_interior type ole2_object ,
gs_columns type ole2_object ,
gs_charts type ole2_object ,
gs_chart type ole2_object ,
gs_charttitle type ole2_object ,
gs_charttitlechar type ole2_object ,
gs_chartobjects type ole2_object .
data gv_sheet_name(20) type c .
data gv_outer_index like sy-index .
data gv_intex(2) type c .
data gv_line_cntr type i . "line counter
data gv_linno type i . "line number
data gv_colno type i . "column number
data gv_value type i . "data
parameters: p_sheets type i .
start-of-selection .
do p_sheets times .
*--Forming sheet name
gv_intex = sy-index .
gv_outer_index = sy-index .
concatenate 'Excel Sheet #' gv_intex into gv_sheet_name .
*--For the first loop, Excel is initiated and one new sheet is added
if sy-index = 1 .
create object gs_excel 'EXCEL.APPLICATION' .
set property of gs_excel 'Visible' = 1 .
get property of gs_excel 'Workbooks' = gs_wbooklist .
get property of gs_wbooklist 'Application' = gs_application .
set property of gs_application 'SheetsInNewWorkbook' = 1 .
call method of gs_wbooklist 'Add' = gs_wbook .
get property of gs_application 'ActiveSheet' = gs_activesheet .
set property of gs_activesheet 'Name' = gv_sheet_name .
*--For the rest of loops, other sheets are added
else .
get property of gs_wbook 'Sheets' = gs_sheets .
call method of gs_sheets 'Add' = gs_newsheet .
set property of gs_newsheet 'Name' = gv_sheet_name .
endif .
gv_line_cntr = 1 . "line counter
*--Title
*--Selecting cell area to be merged.
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = 1
#2 = 1.
call method of gs_excel 'Cells' = gs_cell2
exporting
#1 = 1
#2 = 4.
call method of gs_excel 'Range' = gs_cells
exporting
#1 = gs_cell1
#2 = gs_cell2.
call method of gs_cells 'Select' .
*--Merging
call method of gs_cells 'Merge' .
*--Setting title data
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = gv_line_cntr
#2 = 1.
set property of gs_cell1 'Value' = 'KISHAN' .
*--Formatting the title
get property of gs_cell1 'Font' = gs_font .
set property of gs_font 'Underline' = 2 .
set property of gs_font 'Bold' = 1 .
set property of gs_cell1 'HorizontalAlignment' = -4108 .
get property of gs_cell1 'Interior' = gs_interior .
set property of gs_interior 'ColorIndex' = 15 .
set property of gs_interior 'Pattern' = -4124 .
set property of gs_interior 'PatternColorIndex' = -4105 .
gv_line_cntr = gv_line_cntr + 1 .
*--Writing some additional data for the title
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = gv_line_cntr
#2 = 1.
set property of gs_cell1 'Value' = 'Sheet No' .
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = gv_line_cntr
#2 = 5.
set property of gs_cell1 'Value' = ':' .
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = gv_line_cntr
#2 = 6.
set property of gs_cell1 'Value' = gv_intex .
*--Formatting the area of additional data 1
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = 1
#2 = 1.
call method of gs_excel 'Cells' = gs_cell2
exporting
#1 = gv_line_cntr
#2 = 5.
call method of gs_excel 'Range' = gs_cells
exporting
#1 = gs_cell1
#2 = gs_cell2.
call method of gs_cells 'Select' .
get property of gs_cells 'Font' = gs_font .
set property of gs_font 'Bold' = 1 .
*--Formatting the area of additional data 2
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = 1
#2 = 5.
call method of gs_excel 'Cells' = gs_cell2
exporting
#1 = gv_line_cntr
#2 = 5.
call method of gs_excel 'Range' = gs_cells
exporting
#1 = gs_cell1
#2 = gs_cell2.
call method of gs_cells 'Select' .
get property of gs_cells 'Columns' = gs_columns .
call method of gs_columns 'AutoFit' .
*--Bordering title data area
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = 1
#2 = 1.
call method of gs_excel 'Cells' = gs_cell2
exporting
#1 = gv_line_cntr
#2 = 6.
call method of gs_excel 'Range' = gs_cells
exporting
#1 = gs_cell1
#2 = gs_cell2.
call method of gs_cells 'Select' .
call method of gs_cells 'BorderAround'
exporting
#1 = 1 "continuous line
#2 = 4. "thick
*--Putting axis labels
gv_colno = 2 .
gv_line_cntr = gv_line_cntr + 5 .
gv_linno = gv_line_cntr - 1 .
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = gv_linno
#2 = 1.
set property of gs_cell1 'Value' = 'X' .
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = gv_line_cntr
#2 = 1.
set property of gs_cell1 'Value' = 'Y' .
*--Generating some data
do 3 times .
gv_value = gv_outer_index * sy-index * 10 .
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = gv_linno
#2 = gv_colno.
set property of gs_cell1 'Value' = sy-index .
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = gv_line_cntr
#2 = gv_colno.
set property of gs_cell1 'Value' = gv_value .
gv_colno = gv_colno + 1 .
enddo .
*--Source data area
gv_colno = gv_colno - 1 .
call method of gs_excel 'Cells' = gs_cell1
exporting #1 = gv_linno
#2 = 1.
call method of gs_excel 'Cells' = gs_cell2
exporting #1 = gv_line_cntr
#2 = gv_colno.
call method of gs_excel 'Range' = gs_cells
exporting #1 = gs_cell1
#2 = gs_cell2.
call method of gs_cells 'Select' .
get property of gs_application 'Charts' = gs_charts .
call method of gs_charts 'Add' = gs_chart .
call method of gs_chart 'Activate' .
set property of gs_chart 'ChartType' = '51' . "Vertical bar graph
call method of gs_chart 'SetSourceData'
exporting #1 = gs_cells
#2 = 1.
set property of gs_chart 'HasTitle' = 1 .
get property of gs_chart 'ChartTitle' = gs_charttitle .
get property of gs_charttitle 'Characters' = gs_charttitlechar .
set property of gs_charttitlechar 'Text' = 'Sample Graph' .
*--Locate the chart onto the current worksheet
*--Activate current sheet
call method of gs_excel 'WorkSheets' = gs_activesheet
exporting #1 = gv_sheet_name.
call method of gs_activesheet 'Activate' .
call method of gs_chart 'Location'
exporting #1 = 2
#2 = gv_sheet_name.
*--Reposition the chart on the worksheet (cut&paste)
call method of gs_activesheet 'ChartObjects' = gs_chartobjects .
call method of gs_chartobjects 'Select' .
call method of gs_chartobjects 'Cut' .
*--Select new area
gv_line_cntr = gv_line_cntr + 2 .
call method of gs_excel 'Cells' = gs_cell1
exporting
#1 = gv_line_cntr
#2 = 1.
call method of gs_excel 'Cells' = gs_cell2
exporting
#1 = gv_line_cntr
#2 = 1.
call method of gs_excel 'Range' = gs_cells
exporting
#1 = gs_cell1
#2 = gs_cell2.
call method of gs_cells 'Select' .
call method of gs_activesheet 'Paste' .
enddo.
*--Deallocating memory
free: gs_excel, gs_wbooklist, gs_application, gs_wbook,
gs_activesheet,gs_sheets, gs_newsheet, gs_cell1,
gs_cell2, gs_cells, gs_range, gs_font, gs_interior,
gs_columns, gs_charts, gs_chart, gs_charttitle,
gs_charttitlechar, gs_chartobjects .
Rgds,
Jothi.P
**reward pts for helpful answers.

Similar Messages

  • How do I create brick graph in Excel?

    Marcie

    Hi Marcie,
    I suggest you post your question to the Microsoft Excel community forum:
    http://answers.microsoft.com/en-us/office/forum/excel
    Regards,
    Brian

  • How to create different Graphs in SharePoint 2013 without using Excel service?

    Hi All,
    I want to create different graphs in SharePoint without using Excel Service.
    I do not want to create excel and then upload that to SharePoint.
    Any one knows how to do that? Isthere any option to do that?
    Thanks in Advance

    Hi Darsh,
    You can use
    SharePoint chart webpart to display charts. Or you can use any jQuery charting library and feed data using JSOM or REST. Ex. high charts:
    http://www.highcharts.com/products/highcharts
    http://office.microsoft.com/en-us/sharepoint-server-help/sharepoint-lists-vi-exciting-ways-to-display-your-list-data-RZ102425636.aspx?section=3
    Best Regards,
    Brij K

  • How to create 2 plots xy graph in excel

    Hi,
    I need help!
    I am trying to create a XY graph in excel which has 2 Plots with a bit different X and Y scales and i am not able to understand how to do it, It should be easy
    basicly i have a table already imported into labview but i cant understand how to create a graph similar to the graph in the attached xls.
    Please see attached xls file with an example for the graph i need which is created from the table inside the xls. 
    Thanks!
    Attachments:
    machs.xls ‏25 KB

    Create clusters of the different sets of x and y data and then build them into an array and feed into the graph. For example....

  • I want to create three graphs in web template

    dear all
    I want to create three graphs in web template
    the graphs's type is lines
    top 1 and worst 3 will display in graph
    first is seven days data
    second is seven weeks data
    last is six months data
    how to create those
    pls give me some advice
    thanks

    Lemine,
    Basically you have two major steps:
    1.you need to create the corresponding queries (with conditions on the key figures) in the Query Designer.
    2. Open the Web Application designer and create three charts, set their properties, then drag them to the template , and finally link them to the corresponding queries/views.
    More information on WAD can be found at: http://help.sap.com/saphelp_nw04/helpdata/en/a9/71563c3f65b318e10000000a114084/content.htm
    Hope it helps,
    Xibi

  • How to create a report in excel format having two tab

    Hi All,
    I have Business requirement where customer wants to create a report in excel format having two tab.
    Please let me know if it is possible?
    I am using 10.1.4.3.2 version of BIP.
    Thanks & Regards,
    Edited by: 862749 on May 20, 2013 7:36 PM

    I have Business requirement where customer wants to create a report in excel format having two tab.
    Can anybody suggest if it is possible in BI Publisher or not?yes
    look at excel template
    also you can use xsl-xml or xsl-fo template
    check it for your requirements

  • How to create ONE graph with a growth trend ($ and %)?

    I would like to create a graph with a growth trend.
    The graph should have figures on one side reflecting $ values and on the other % growth.
    I cannot make a trend on the same graph and usually spend ages adding another graph to show the trend. I end up making 2 graphs instead of one.
    Please refer to the following really basic graph that will give you an idea.
    ex : http://www.tellurideareahomes.com/images/graph1.jpg
    Can anyone show how to do that?

    What you want requires a bit of trickery.
    Chart the bar graph
    Chart the trend
    then move the trend one above the bar one after setting its background to none.
    If this workaround is not OK for you,
    _Go to "Provide Numbers Feedback" in the "Numbers" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'09 (possibly for iWork '99)
    Yvan KOENIG (from FRANCE mercredi 19 novembre 2008 11:18:45)

  • How to create weighted graph using as 3.0

    Hello Frnds,
    I want to create weighted graph using AS. Using
    flash.graphics.* package I can create edges and nodes but I dont
    knw how to assign weight to the edges. I am also facing one issue,
    our client has created some legacy classes for graph generation,
    how can I create a similar class in AS.
    Regards,
    FlexBee...

    Hi,
    can anyone tell me about weighted graph...??

  • Changing the Size of generated graph in excel report generation toolkit

    Hi, i am trying to build a report generation vi for my Structural health monitoring system in which i need to export 3 graphs in to an excel report. The idea is to have the report on a single page, but when i paste them along with the ceiling and pillar deviation percentages, the report just exceeds the page limit. I wanted to know whether one can change the size of the graphs in excel? One can do it in word(tried that), but i dont want to use the bookmark option as it intend to put this up as a webservice in the next step. I am using LabVIEW 2009 Thanks.
    LabVIEW 8.2,8.6,2009...still learning
    Attachments:
    Report Generation SHM.vi ‏30 KB

    Hi,
    I haven't tried this myself, but looking through the report generation toolkit the "Excel format image VI" (in the Excel specific tab of the Report Genertaion window) looks to be the one you are after. The help entry for the VI says to: "Use this VI to format any type of image in a worksheet, including front panel images, images from a file, and graphs"
    Hopefully this will help.
    -CC 
    "If anyone needs me, I'll be in the Angry Dome!"

  • When Creating a universe using excel, universe is blank.

    Hi,
    I want to create a universe using excel sheet, my server is 64bit windows, and business objects is 3.1 SP 3 FP 2.6,
    I created an ODBC connection; these are the steps I followed
    1)  I Navigated to C:, windows, syswow64 and ran the application odbcad32
    (Windows server 2008 64 bit) and created a ODBC connection using a Excel sheet 2003.
    2) Then i did the following change
    <Parameter Name="Transactional Available">No</Parameter> is set to Yes under the Generic ODBC Data Source in below location
    ...\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\dataAccess\connectionServer\odbc\odbc.sbo
    3) Then went to universe created connection using under database middle ware as microsoft -MS Excel 2003 - Odbc drivers- and selected the data source connection, test the connection server is working fine.
    4) i created a universe using the connection.
    But the problem is i canu2019t see the values, dimensions and measures in my universe it blank.
    Please help me to overcome the issue.
    Regards
    Aflal

    Hi,
    i went to table browser and created the universe, and exported it to the BO server, when i run the report in webi i am getting the following error.
    "Microsoft Odbc driver manager data source not found and no default driver specified"
    Please help.
    Regards
    Aflal

  • How to create a Macro in excel to store the excel data to Oracle Database

    Hi All
    Does anyone has created a macro in excel which on being run stores the excel data to Oracle database. In my project I need to create one such macro for updating oracle database with excel data and another for inserting excel records.
    I tried doing this using a macro in MS access but Client wants its to be done using Excel Macro only.
    Any help would be highly appreciated.
    Thanks in advance..
    Shikha

    Please read Chapter 19.7 Creating Selection Lists (http://download.oracle.com/docs/html/B25947_01/web_complex007.htm#CEGFJFED) of the Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers 10g Release 3 (10.1.3.0)
    Cheers,
    Mick.

  • Error when adding a Title to a Graph in Excel

    I am trying to automate adding a graph to Excel.  The Easy Graph.vi is too simple for what I would like to do.
    I recorded a macro of what I wanted to do, and then I copied it in LabVIEW basically.
    My program is erroring out every time I try to modify anything on the chart (title, series values, series names, etc).
    I cannot figure out why it will allow me to add a sheet, add the chart, rename the sheet, and then error out when I continue to use the Excel._Chart properties and methods.
    I attached a sample file and my code.
    Thanks
    Kenny
    Attachments:
    My Source Distribution.zip ‏128 KB
    test.xls ‏16 KB

    Kenny K wrote:
    Ok, I figured out my issue.
    It seems that you have to graph the data, before you can change any graph attributes, even though I have done that before.
    Once I put the axis, title, etc after the graphing, then it worked.  Well, I also had specified my range wrong, so that errored out too.
    Thank you for the help.
    Also, how to you get a reference to the Chart Wizard through the excel activex?
    I posted a snippet. You can take it from there. I do not remember how I got it before. I have not had to change it in six to seven years. I remember going through the MSDN and found the function. I think I made it from scratch to match the MSDN..
    Tim
    Johnson Controls
    Holland Michigan

  • Error while making a graph in excel

    I can create an excel file + worksheet + inserting data. But when i try to make a graph i get the error:
    Error accessing the OLE registry.
    in Excel Import Module.vi->Excel Insert Graph.vi->Excel Easy Graph.vi->excelreport.vi
    i searched the forum but couldn't find the answer, i am using the functions 'report generation'.
    I got my information from the tutorial :
    http://zone.ni.com/devzone/conceptd.nsf/webmain/410C4F687126E4C786256B920072A197?OpenDocument
    Attachments:
    excelreport.vi ‏73 KB

    you most have eather a simple problem or your registry is flawed anyways did you try this found it on web.
    Make sure that you are logged into the computer as local Administrator, or are part of the local Administrator group.
    To identify which registry key is causing the problem use Regmon (a freeware tool published by SysInternals). Use Regmon to capture all registry access when regsvr32 is run. If an �OpenKey� request fails with �Access Denied� (which is listed by Regmon as �ACCDENIED�) then run regedt32 and check the permissions on that registry key. If necessary change the permissions on the key to grant local Administrators �Full Control�.

  • How to create new Sheet in Excel file and write into it

    Hi to all, my requirement is this:
    I have an excel file (.xls) with multiple sheets (three sheets for precision: sheet1, sheet2 and sheet3).
    I must create in the same excel file new sheet, say sheet4, read data from sheet1, sheet2 and sheet3 and write them into sheet4.
    How to realize this in SSIS?
    Expecially, Is it possible to realize this in SSIS?
    thanks in advance.

    You need to create the sheet with the required metadata. There's no use creating blank sheet.
    Also metadata has to be fixed using a sample sheet prior to start of the package for setting the mapping. You may create a excel template for this purpose to just set the mapping at design time.
    At runtime pass actual excel sheet path for ExcelFilePath property of the source to point to correct file.
    Also the create table statement should include the same metadata info (columns)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    Hi, well it works fine! I have used a sample sheet prior to start of the package for setting the mapping.
    Next at run time  pass actual excel sheet path for ExcelFilePath property of the source to point to correct file.
    However I have set also ValidateExternalMetadata properties of the Excel Destination to false and DelayValidation properties of the package to true.
    Now my problem is the following:
    I stored the three sheets name (sheet1, sheet2, sheet3) in the Object type user variable through a script task and the foreach loop loops through the three sheets stored in the variable.
    Now, I want that at each iteration the CURRENT VALUE of the Object type user variable is mapped into another user variable wich in turn is given in input to the Excel Source.
    Resuming:
    -) I have to copy the content of three sheets (sheet1, sheet2, sheet3) of excel file into another new sheet,   sheet4.
    -) I stored the three sheets name (sheet1, sheet2, sheet3) in the Object type user variable.
    -) With a  foreach loop container I loops the three sheets stored in the Object type user variable.
    -) Within a foreach loop container I have a Data Flow Task that transfer data from source sheet (sheet1, sheet2, sheet3) into destination sheet, sheet4.
    -) PROBLEM: how to change dinamically at each iteration of the foreach loop the name of source sheet? In the destination excel Task the sheet is always the same at each iteration, sheet4. But in the source excel task the name of sheet musts change at each
    iteration. In particular at the first iteration the name of the source sheet must be "sheet1$", at the second iteration "sheet2$", in the last iteration "sheet3$".
    How to change sheet name dinamically at each iteration?
    thanks.

  • Creating a Report from Excel

    I'm trying to create a report from an Excel spreadsheet and am having some issues with how Crystal is reading in the data.  I have 7 fields that are all the same, I want them to be Numeric fields.  However, when I import the Excel sheet as the data source, 4/7 of the fields import as string fields into Crystal.  At first I didn't think this would be an issue, but some of the fields, and it doesn't seem to be consistently the "string" only or the "numeric" only fields, do not seem to be printing to the report at all - the space where they should be ends up blank.  I have gone back to the Excel sheet several times to change the cell format to Numeric, but that has not helped.  I also tried changing the format in Crystal, using ToNumeric(fieldname) or ToText(fieldname), and neither of those functions seem to work either.
    Has anyone had this issue before or know how to fix it?

    Hi Jeremy,
    Which Crystal Report version are you using?
    Have you applied any service pack for Crystal Reports?
    Which Operating system are you using?
    Is the issue is with all the report or single report?
    For testing purpose:
    -Create new excell sheet with two columns one is numeric and other one string.
    -Create report using thie excell sheet.
    -Preview report and export.
    -Now print report
    Are you getting same results?
    Have you tried to print other document through that printer is it working properly.
    Regards,
    Shweta

Maybe you are looking for