Export in excel

Hi…

I need to create a report and export the same in excel file.

Anybody knows??? jst let me knw the steps and code…

As someone replied on your post on Mibuso, search the forums. This has literally been discussed hundreds of times.

Thanks[:^)] but i am looking for the steps…

You’re not going to get someone to tell you step by step

  1. Do this

  2. Do that

It’s not a trivial process to add all of the code and what you have to do depends on your report. There is no How To guide.

Your job is to figure out what to do. Part of being a developer is learning to do things on your own. Again, search the forums. You’ll find information about the Excel Buffer table and reports in the base software that you can look at (Aged Accounts Receivable).

hey, i know how you feel, 'm a beginer too:)

Create the Report Data Model,

  1. In the Object Designer’s Report List, click the New button. The New
    Report window opens. In this demonstration, do not use the Report
    Wizard.

  2. Select Create a Blank Report and then click the OK button. The
    Report Designer opens.

  3. Click the first empty line in the Report Designer, and type or select
    the number or name of table 13, Salesperson/Purchaser in the
    DataItem column. By the default, the Name column is set to the table
    name.

  4. Click the next line, and add the table 18, Customer.

  5. While the Customer data item is still selected, click the right arrow
    button at the bottom of the Report Designer to indent the Customer
    data item.

  6. Open the Properties window for the Customer data item.

  7. Locate the DataItemLinkReference property, and verify that it is set
    to Salesperson/Purchaser.

  8. Locate the DataItemLink property and click the Assist-Edit button
    on the DataItemLink property. The DataItem Link window opens.

  9. Type the following in the DataItem Link window:

Field Reference Field
SalespersonCode Code

  1. Click OK to close the DataItem Link window. Notice that the
    DataItemLink property is set to Salesperson Code=FIELD(Code).
  2. Locate the DataItemTableView property and then click the Assist-
    Edit button on the DataItemTableView property. The Table View
    window opens.
  3. In the Key field, select Salesperson Code, and then click OK to
    close the Table View window. Notice that the DataItemTableView
    property is set to Sorting(Salesperson Code). This sorts the indented
    data item by the indicated field. This is a good practice when linking
    two data items.
  4. Close the Properties window.
  5. Compile and save the report by clicking File, Save As. The Save As
    dialog box opens.
  6. Type 90000 in the ID and Customer by Salesperson in the Name,
    ensure that the Compiled check box is selected, and then click OK.
    This compiles and saves the report.
    The report data model is now completed. The next step is to degisn the section

go to design press alt+v+n and degisn it accordingly

this way you will learn it easyly:) you can also create it by using the report wizard:)

To send to excel, press alt+f +d:)

hi,

check out the Excel Buffer table in designer, there are all of function what are need for you!

a

Yes. I know how to do that.

Look through the Report objects in the standard Navision system until you find one that does a job like the one you want to complete. In Object Designer apply a Field FIlter to Name Field like Excel.
You should see a list of Report Objects.

Browse through a selection of the objects to undertand the source data and how the data is exported; then copy the functions of the report into a new report.

It’s not so difficult.

Good luck.

[:)]

Hi Arnav,

you can follow these steps in order to create the report

  1. Go to Object Designer’s Report List, click the New button. The New
    Report window opens.

  2. Select Create a Blank Report .

  3. Click the first empty line in the Report Designer, and type or select
    the number or name of table By the default, the Name column is set to the table
    name.

  4. Click the next line, and add the table 18, Customer.

  5. While the Customer data item is still selected, click the right arrow
    button at the bottom of the Report Designer to indent the Customer
    data item.

  6. Open the Properties window for the Customer data item.

  7. Locate the DataItemLinkReference property, and verify that it is set
    to Salesperson/Purchaser.

  8. Locate the DataItemLink property and click the Assist-Edit button
    on the DataItemLink property. The DataItem Link window opens.

  9. Type the following in the DataItem Link window:

Field Reference Field
SalespersonCode Code

  1. Click OK to close the DataItem Link window. Notice that the
    DataItemLink property is set to Salesperson Code=FIELD(Code).
  2. Locate the DataItemTableView property and then click the Assist-
    Edit button on the DataItemTableView property. The Table View
    window opens.
  3. In the Key field, select Salesperson Code, and then click OK to
    close the Table View window. Notice that the DataItemTableView
    property is set to Sorting(Salesperson Code). This sorts the indented
    data item by the indicated field. This is a good practice when linking
    two data items.
  4. Close the Properties window.
  5. Compile and save the report by clicking File, Save As. The Save As
    dialog box opens.
  6. Type 90000 in the ID and Customer by Salesperson in the Name,
    ensure that the Compiled check box is selected, and then click OK.
    This compiles and saves the report.
    The report data model is now completed. The next step is to degisn the section

go to design press alt+v+n and degisn it accordingly

this way you will learn it easyly:) you can also create it by using the report wizard:)

To send to excel, press alt+f +d:) . if you have any queries please free to contact me at kgulati@paragyte.com.

Thanks,

Kamal Gulati,

Paragyte technologies

web- www.paragyte.com

Hi Its not an risky one.I Ill just show you the basic steps.it ill export all the customer to Excel.

for this you need to create some automation variables

Variales you need

Name Data Type SubType

1.Excel Automation ‘Microsoft Excel 12.0 Object Library’.Application

2.Book Automation ‘Microsoft Excel 12.0 Object Library’.Workbook

3.Range Automation ‘Microsoft Excel 12.0 Object Library’.Range

4.Sheet Automation ‘Microsoft Excel 12.0 Object Library’.Worksheet

5.I Integer

6.J Integer

Now place the following code at respective triggers

OnPreDataItem() {To Create work sheet}

CREATE(Excel);
Excel.Visible(TRUE);
Book:=Excel.Workbooks.Add(-4167);
Sheet:=Excel.ActiveSheet;
Sheet.Name := ‘Customer List’;

OnAfterGetRecord() {To assign Values to the excel cells}
Sheet.Range(‘A’+j).Value := Customer.“No.”;
Sheet.Range(‘B’+j).Value := Customer.Name;
j:=INCSTR(j);

OnInitReport();

j:=‘1’;

Now Design your report and run.Thanks

Jerome Marshal.J

Thank you so much Marshall.[:D] , that’s what I m looking for…

Hi Shona

By presing Alt + F+D also Export the data to excel file.But it can sends from forms to excel only not from report.

Thanks

Jerome Marshal.J

Hai, i am trying this

OnAfterGetRecord() {To assign Values to the excel cells}
Sheet.Range(‘A’+j).Value := Customer.“No.”;
Sheet.Range(‘B’+j).Value := Customer.Name;
j:=INCSTR(j);

here we have A,B what these are, and here i am getting errors . can you give me a clear view for this .

Thanking you in advance

What error you are getting ?

Here A refers to the column name and j refers to row number (which should be a integer) in excel…

The error is

This message is for c/al programmers:

An exception was raised in method Range. The OLE control or Automation server has returned error (hresult)-2147352567.

The component did not provide the exception description.

Thanks

you just change the type of the variable j to text(sub type

Hi Marshal,

Can u tell me what is ‘Add’ Here.

Should i need to define ‘Add’ in variables.

Thank U

If you look in the excel buffer table there should be information in there up to the point it bombed off.

Look at the last entry in the table.

http://dynamicsuser.net/forums/p/25998/140880.aspx