Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
anoopvj

Veteran
Registered:
Posts: 130
Reply with quote  #1 
Hi,

My aplication has a portion for reporting. Is there any way to do so?

Im planning to have the report in Gridview and export it to Excel.
Can anyone help in this?
I also like to export it to PDF.

PLease help me.

Thanks
0
bigfootger

Veteran
Registered:
Posts: 139
Reply with quote  #2 
Hi,

we use SQL Server Reporting for those things. You could open up the sql server report with passing the parameters (same you specified to get your grid results) into it by clicking a button.

There the user can decide to open it as pdf  or xls. I really prefer this instead of reading out the griddata with a script.

Maybe that helps.




__________________
Metastorm BPM Remote Expert Help & Web Consultations - http://connect.convedo.com/free-1-hour-web-consultation
0
anoopvj

Veteran
Registered:
Posts: 130
Reply with quote  #3 
Thanks friend,

But how can I do this from the Metastorm form? My requirement is to get the report in grid first and then export it to excel and pdf.
0
anoopvj

Veteran
Registered:
Posts: 130
Reply with quote  #4 
Could you please provide me with sopme piece of code or sample?

Thanks
VJ
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #5 
We sell a set of libraries that do many things, and copying data from a grid to HTML (in many different ways) is one of them. You can see the details here:
Table from Grid Library

For obvious reasons, I cannot give you the code from that, and it is deeply embedded in other code that provides all the functionality.

I can give you the simple code required to copy the data to the clipboard. It works in v6:
Quote:
function GridToClipboardData( sGridName )
{
    var iRowCount = eworkGetRowCount( sGridName );
    var c = 0;
    var r = 0;
    var sTable = "";
   
    if ( sGridName == undefined || sGridName == "" )
        sGridName = "Grid1";
       
    // get the header row (NB this can be done using -1 as the row, but number columns return NaN even for row 0)
    var LGrid = eworkData.FieldByName(sGridName);
    var LRow = LGrid.HTMLfield.rows(0);

    for ( c = 0; eworkGetCell( sGridName, c, -1 ) != ""; c++ )
    {
        var LCell = LRow.cells(c);
        var LCurrentCell = LCell.children[0];
       
        sTable += LCurrentCell.innerText + "\t";
    }
   
    sTable += "\r\n";
   
    var iColumnCount = c;
   
    for ( r = 0; r < iRowCount && eworkGetCell( sGridName, 0, r ) != ""; r++ )
    {
        for ( c = 0; c < iColumnCount; c++ )
            sTable += eworkGetCell( sGridName, c, r ) + "\t";
           
        sTable += "\r\n";
    }
   
    return sTable;
}
I am pretty certain this no longer works in v7, BTW, but that may only be the title bit.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
sam2000

Member
Registered:
Posts: 35
Reply with quote  #6 
Manipulated a bit and below client script code works with v7.5:

function ExcelIt(aGridField,colCount)

{
/* Create Excel Object */
var objXL = new ActiveXObject("Excel.Application");

/* Show it to the user */
objXL.Visible = true;

/* Add a workbook */
objXL.WorkBooks.Add();

/* Add a worksheet */
objXL.Sheets.Add();

// get the header row
var LGrid = eworkData.FieldByName(aGridField);
var LRow = LGrid.HTMLfield.rows(0);

// I need 1st to 5th column names from grid (skipping 0th column)
for ( c = 1; c<=5; c++ )
{
var LCell = LRow.cells(c);
objXL.Cells(1, c).Value= LCell.innerHTML;
}

//insert data of grid
var row = 0;

for ( row = 0; row < eworkGetRowCount(aGridField); row++)
{
var field = 1;
for ( field = 1; field < colCount; field++)
objXL.Cells(row+2, field).Value = eworkGetCell(aGridField,field,row);
}
}

0
ash2010

New Member
Registered:
Posts: 7
Reply with quote  #7 
Above code works fine for considerable rows in the Grid to export. I faced a performance issue when the number of rows in the Grid exceeds 4000 rows (approx)
There was a message in the background " Stop running this scrupt? A script on this page causing Internet explorer to run slowly. If you continue to run your computer might become unresponsive"  

I think the best way to export is get the data from the SQL via server script and then export it instead of iterating through each cell in the Grid 
0
sam2000

Member
Registered:
Posts: 35
Reply with quote  #8 
But you want to generate excel on client side, how to call SQL functions from client side script? Thats why iterating through grid.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #9 
You can't call SQL functions from a Client script.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
mohnshine

Avatar / Picture

Senior Veteran
Registered:
Posts: 270
Reply with quote  #10 
You could speed the script up by changing how the rows in the grid are iterated, replace everything after the //insert data of grid comment with the following code

// get the number of rows (gets it once instead of every row)
var rowCount = eworkGetRowCount(aGridField);
// iterate the rows
for ( var row = 0; row < rowCount; row++)
{
    for ( var field = 1; field < colCount; field++)
        objXL.Cells(row+2, field).Value = eworkGetCell(aGridField,field,row);
}

This saves about a dozen lines of script per row by not running eworkGetRowCount for every row when checking if the row for loop should quit processing

__________________
Your best practice does not conform with my best practice.
0
Rafeea

Avatar / Picture

Member
Registered:
Posts: 22
Reply with quote  #11 

Currently, in my organisation the way how we are exporting BPM data into excel is by creating a report in .Net. I was trying to find another way to export the data into excel without the need to integrate with a .Net page, and I reached to this topic. Nice information and input from everyone!

This topic provided me with another option to export the data into excel by using ActiveXObject in JavaScript.

Just wondering, why Metastorm BPM does not provide a reporting tool? Is there any challenge behind that?

Thank you.

Regards,
Rafeea


__________________
"Tough Times Never Last. But Tough People Do!" Robert H. Schuller
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #12 
MBPM V9 does provide reporting, along with exporting to various formats.  (There is also an RTF field which if you build an HTML report can be exported, but its not as strong.)  V7 does not have any built in reporting capabilities.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!