Progress export to excel

Hello,
Is there any way to export data from a character based Progress application to Excel (along with formatting cells)? Originally I took the xml code of the destination Excel file, and created a program which generates the same xml code. At the end I only had to rename the xml file to xls and it can be opened by Excel. But the newest version of Excel (2007) gives a warning message when opening that xls, and it’s not acceptable for the customer. (Though the file is opened after just clicking on the message.) I know that Excel structure has been changed, maybe I should add some other files as well to the xml? Or I could generate an xls (xlsx) file in a simple way?

Thanks in advance.

Probably something like this?? The below code exports some fields from customer table in the sportsdatabase.

DEF VAR vchExcel AS COM-HANDLE NO-UNDO.
DEF VAR vchWorkBook AS COM-HANDLE NO-UNDO.
DEF VAR vchWorkSheet AS COM-HANDLE NO-UNDO.
DEF VAR vRow AS INT NO-UNDO.
CREATE «Excel.Application»:U vchExcel.

ASSIGN
vchExcel:VISIBLE = false
vchWorkBook = vchExcel:WorkBooks:ADD()
vchWorkSheet = vchExcel:Sheets:ITEM(1).

FOR EACH Customer Where Customer.CustNum < 100 NO-LOCK:
ASSIGN
vRow = vRow + 1
vchWorkSheet:Range(«A»:U + STRING(vRow)):VALUE = Customer.CustNum
vchWorkSheet:Range(«B»:U + STRING(vRow)):VALUE = Customer.Name
vchWorkSheet:Range(«C»:U + STRING(vRow)):VALUE = Customer.CreditLimit
vchWorkSheet:Range(«D»:U + STRING(vRow)):VALUE = Customer.Balance.
END.
vchWorkBook:SaveAs(«c:tempsample.xlsx»,,,,,,,).

/* RELEASE OBJECT vchWorkSheet. */
/* RELEASE OBJECT vchWorkBook. */
/* RELEASE OBJECT vchExcel. */

vchWorkBook:CLOSE.
RELEASE OBJECT vchWorkSheet.
RELEASE OBJECT vchWorkBook.
vchExcel:QUIT.
RELEASE OBJECT vchExcel.

How do you export from progress to excel with merged cell in the middle? when i try to export, it unmerged itself.
example expected output:

merged cell with value 1 (3 cells) other value 1 other value 1

merged cell with value 2 (3 cells) other value 2 other value 2

merged cell with value 3 (3 cells) other value 3 other value 3

what my output is:

unmerged cell value 1 other value 1 other value 1

unmerged cell value 2 other value 2 other value 2

unmerged cell value 3 other value 3 other value 3

my export to excel code:

DEFINE VARIABLE h-excel AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE h-sheet AS COM-HANDLE.
DEFINE VAR w-invname AS CHAR INITIAL "insert excel fill here".
CREATE "Excel.Application" h-excel.

h-sheet = h-excel:Workbooks:OPEN (w-invname,,FALSE,,,,,,,,,,FALSE) NO-ERROR.
h-excel:visible = true.

h-excel:Cells:Select.
/*h-excel:Selection:ClearContents.*/

h-excel:Run("loading").  /* Run the Macro, up to 31 optional   */
                           /* parameters can be passed           */
/*h-excel:Quit().*/            /* Tell Excel to quit                 */

/*h-excel:Range("A" + STRING(5)):VALUE = "Date Covered " + STRING(fifr) + " - " + STRING(fito).*/
h-excel:Range("A" + STRING(6)):VALUE = "As of " + cbMon + STRING(fiyear).

h-excel:Range("A12"):Select.
/*h-excel:Workbooks:SaveAs("c:hckiv9crdformsKMCDAT1.xls",43,,,,,).*/

RELEASE OBJECT h-sheet.
RELEASE OBJECT h-excel.

END PROCEDURE.

Code.org Professional Learning Community

Loading

  • Remove From My Forums
  • Question

  • Hi all

    In a winform I export a DGV to an excel workbook. using  MyExcel As Excel.Application

    In the DGV I use a progress bar.

    I use this code to set progressbar properies 

     ExcelProgressBar.Minimum = 1
            ExcelProgressBar.Maximum = DGV.Rows.Count
            ExcelProgressBar.Value = 1
            ExcelProgressBar.Style = ProgressBarStyle.Continuous
            ExcelProgressBar.Step = 1
            ExcelProgressBar.Visible = True

    Then I loop thru DGV rows to fill Excel row and for each DGV row I Perfom a step(+1)  for the progressbar.

    At the end of DGV a set  MyExcel.Visible = True

    The strange thing is that the Excel program is displayed on the screen before the progress bar reachs grahically its maximun (even if it reachs the maximun value).

    How to avoid this behavior ? 

Answers

  • Hi

    Happy New Year too — may all your applications be bug free!.

    *

    I have reported these issues to Developer Community to see if it invokes any response. See

    HERE


    Regards Les, Livingston, Scotland

    • Marked as answer by

      Wednesday, January 2, 2019 9:43 PM

Using the below Java Script to show the loader once the Export To Excel button is clicked.


function showProgress() {
var updateProgress = $get("");
updateProgress.style.display = "block";
}

<asp:Button ID="btntoExcel" runat="server" Text="Export to Excel" onclick="btntoExcel_Click" OnClientClick="showProgress()" Width="115px"
CssClass="styleShowData" Font-Size="Smaller" />

Everything is working fine but the loader keeps on loading after saving the file in system also.

Don’t know how to stop the loader since in JS it is mentioned as

updateProgress.style.display = "block"

updateProgress.style.display = "block"

Any suggestion will be highly helpful.

Thanks in advance.

Adding Whole Code Below

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="ViewReport.aspx.vb" Inherits="ViewReport" %>

Status Report


function showProgress() {
var updateProgress = $get("");
updateProgress.style.display = "block";
}

function hideProgress() {
var updateProgress = $get("");
updateProgress.style.display = "none";
}

Like this post? Please share to your friends:
  • Progress bar for excel vba
  • Proficient in word excel and powerpoint
  • Programs word processor email etc
  • Proficient in microsoft excel
  • Programs used for word processing