Demo of Excel buffer usage
This small report shows the easy usage of the excel buffer table to create excel exports.
This report can be modified by end users who have the report and dataport designer granule.
http://www.mibuso.com/dlinfo.asp?FileID=596
Discuss this download here.
Comments
Honestly, it's the best reporting solution out there, because it's free (as compared to Jet Reports), it's 200% customizable, and it's faster and a lot more trustable than f***ing around with SQL queries into Excel, which I usually did.
If we use OpenWorkbook instead of CreateWorkbook (code can nicely copied from Accounting Schedule / Export to Excel), the Excel file preserves all Excel functions, formatting and whatever. It means we will never ever will write all those stupid reports that always plagued my life, but tell clients to design themselves whatever report they want it Excel with all the SUMs and conditional formatting and whatever, and we just populate it with data.
Actually, I currently have a client that needs a real cash-flow, adding together everything from bank accounts to open orders, with different percentage weights. I wanted to do it with SQL queries in Excel, but know will just use this. Hell, it's even faster than writing reports the normal way, because I don't have to mess around with field sizes anymore.
Thanks a lot. I just don't understand why didn't it occur to me
http://www.BiloBeauty.com
http://www.autismspeaks.org
Down loaded the example not bad at all do you know if there are plans to include this on a wizard in a later release as i belive that it could be simplified but as i am a new user i believe this is a relatievely new option?
thanks,
BMCK
the excel buffer is not that new, if that's what you're talking about, but documentation on how to use it wisely hasn't exactly been great
http://www.BiloBeauty.com
http://www.autismspeaks.org
RIS Plus, LLC
To choose Excel file, FileName := FileOpenDialog.OpenFile('Excel file','',2,'*.xls',0); in the OnLookUp of a text field where FileOpenDialiog is an instance of CU Common Dialog Management. To open Sheet,
SheetName := TempExcelBuffer.SelectSheetsName(FileName); in another textbox - OnLookUp.
Then it's the same, and the OnPostDataItem is:
TempExcelBuffer.OpenBook(FileName,SheetName);
TempExcelBuffer.CreateSheet(SheetName,'Inventory List',COMPANYNAME,USERID);
TempExcelBuffer.GiveUserControl;
This saves you the trouble of defining the COMDLG ocx yourself with having the risk of recompiling on a non-visuals studio pc without the apropriate license.
Must be my jetlag
At least we follow the same path
Spade
If you want to export other information, just make a report like you do for normal reports and instead of creating secions you export the information to excel. If you use the excel code in groupfooters you can even use the grouping functionality for your excelexport.
It may sound stupid but where exactly do I place the FORMAT?
This is a snippet of the concerning code:
Row := Row + 1;
EnterCell(Row, 1, "No.", FALSE, FALSE, FALSE);
EnterCell(Row, 2, Name, FALSE, FALSE, FALSE);
EnterCell(Row, 3, Address, FALSE, FALSE, FALSE);
EnterCell(Row, 4, Amount, FALSE, FALSE, FALSE);
The last line has to be formatted to decimal
This is my code:
Row := Row + 1;
EnterCell(Row, 1, "No.", FALSE, FALSE, FALSE);
EnterCell(Row, 2, Name, FALSE, FALSE, FALSE);
EnterCell(Row, 3, Address, FALSE, FALSE, FALSE);
EnterCell(Row, 4, FORMAT(Payments), FALSE, FALSE, FALSE);
EnterCell(Row, 5, FORMAT(Amount), FALSE, FALSE, FALSE);
Try adding this code before the export
=D>
Not with this example, but you can do it with NAV. I think there are examples in the download section for this.
I have just tested You tool in NAV 4.0 SP2 and NAV 5.0 Beta using Office 2007. I get this error:
"Could not invoke the member Add. The OLE control or Automation server returned an unknown error code."
Any ideas?
Alex
Hanen TALBI