Comments (9)
Fastexcel generates xlsx
files (aka Excel 2007 format), not xls
files. Please try to change the file extension.
from fastexcel.
Hi,
Thanks for your reply.
After changed the file format ".xlsx". It throws following dialogue message. Kindly suggest to stop this error.
from fastexcel.
There must be something wrong indeed in the generated file. Can you post a code snippet to reproduce the issue?
from fastexcel.
Workbook wb = new Workbook(response.getOutputStream(), "MyApplication", "1.0");
Worksheet ws = wb.newWorksheet("Current Portfolio");
short rowIndex = 0;
ws.value(0, 0, company_name);
ws.style(0, 0).bold().fontColor(Color.RED).set();
ws.range(0, 0, 0, 9).merge();
ws.value(1, 0, "Mutual Fund Family Portfolio");
ws.range(1, 0, 1, 9).merge();
ws.range(1, 0, 1, 9).style().horizontalAlignment("center").set();
ws.style(1, 0).bold().fontSize(20).fontColor(Color.RED).set();
ws.value(2, 0, "Name: "+salutation+" "+name+" ["+ pan +"]");
ws.style(2, 0).bold().fontColor(Color.RED).fontSize(16).set();
ws.range(2, 0, 2, 8).merge();
ws.value(2, 9, "Valuation as on: " + sdf.format(new Date()) + "\n Report Date: " + sdf.format(new Date()));
ws.style(2, 9).fontColor(Color.RED).bold().set();
int i = 3;
int j = 0;
for(j = 0; j < 10; j++) {
ws.style(i, j).fillColor("07A3F7").verticalAlignment("bottom").set();
}
ws.value(i, 0, "Scheme Name");
ws.value(i, 1, "Folio Number");
ws.value(i, 2, "Start Date");
ws.value(i, 3, "Units");
ws.value(i, 4, "Average NAV");
ws.value(i, 5, "Current Cost");
ws.value(i, 6, "Current Value");
ws.value(i, 7, "Unrealised Gain/Loss");
ws.value(i, 8, "Realised Gain/Loss");
ws.value(i++, 9, "Annualized Return(%)");
int kkk = 0;
for (List<InvestorSchemeWisePortfolioResponse> list : master_scheme_list)
{
ws.value(i, 0, name_list.get(kkk));
ws.style(i, 0).bold().fontColor(Color.RED).fontSize(16).set();
ws.range(i, 0, i++, 9).merge();
for (InvestorSchemeWisePortfolioResponse investorSchemeWisePortfolioResponse : list)
{
String scheme_name = investorSchemeWisePortfolioResponse.getScheme();
String folio = investorSchemeWisePortfolioResponse.getFoliono();
Date start_date = investorSchemeWisePortfolioResponse.getInvestmentStartDate();
Double total_units = investorSchemeWisePortfolioResponse.getTotalUnits();
Double purchase_nav = investorSchemeWisePortfolioResponse.getPurchaseNav();
Double current_cost = 0.0;
if(!investorSchemeWisePortfolioResponse.getIsNegativeTransaction())
{
current_cost = investorSchemeWisePortfolioResponse.getTotalInflow();
}else{
current_cost = investorSchemeWisePortfolioResponse.getCurrentCostOfInvestment();
}
Double current_value = investorSchemeWisePortfolioResponse.getTotalCurrentValue();
Double unlealised_profit = investorSchemeWisePortfolioResponse.getUnrealisedProfitLoss();
Double realised_profit = investorSchemeWisePortfolioResponse.getRealisedProfitLoss();
Double annualized_return = investorSchemeWisePortfolioResponse.getCagr();
total_units = Double.parseDouble(dcf.format(total_units));
purchase_nav = Double.parseDouble(dcf.format(purchase_nav));
current_cost = Double.parseDouble(dcf2.format(current_cost));
current_value = Double.parseDouble(dcf2.format(current_value));
unlealised_profit = Double.parseDouble(dcf2.format(unlealised_profit));
realised_profit = Double.parseDouble(dcf2.format(realised_profit));
annualized_return = Double.parseDouble(dcf1.format(annualized_return));
ws.value(i, 0, scheme_name);
ws.value(i, 1, folio);
ws.value(i, 2, sdf.format(start_date));
ws.value(i, 3, total_units);
ws.value(i, 4, purchase_nav);
ws.value(i, 5, current_cost);
ws.value(i, 6, current_value);
ws.value(i, 7, unlealised_profit);
ws.value(i, 8, realised_profit);
ws.value(i++, 9, annualized_return);
}
for(j = 0; j < 10; j++) {
ws.style(i, j).bold().fillColor("07A3F7").set();
}
ws.range(i, 0, i, 4).merge();
ws.value(i, 0, "Total");
ws.value(i, 5, current_cost_list.get(kkk));
ws.value(i, 6, current_value_list.get(kkk));
ws.value(i, 7, unrealised_list.get(kkk));
ws.value(i, 8, realised_list.get(kkk));
ws.value(i++, 9, cagr_list.get(kkk));
kkk++;
}
for(j = 0; j < 10; j++) {
ws.style(i, j).bold().fillColor("07A3F7").set();
}
ws.range(i, 0, i, 4).merge();
ws.value(i, 0, "Grand Total:");
ws.value(i, 5, grand_fund_invested_value);
ws.value(i, 6, grand_fund_current_value);
ws.value(i, 7, grand_fund_unrealised);
ws.value(i, 8, grand_fund_realised);
ws.value(i++, 9, grand_fund_cagr);
ws.range(i, 0, i+2, 9).merge();
ws.value(i, 0, "Disclaimer : This statement is based on the information available with us, and is only for your reference. The statement from the resp. fund reflects the exact information for the respective folio. Any discrepancy may please be reported to us. All investments in Mutual Funds carry risk of loss of Principal. No returns are guaranteed, any projections are indicative and subject to market fluctuations. Tax is payable on your capital gain as per Income Tax Act. Please contact your CA/Accountant for the same. You can contact us for any further assistance.");
ws.style(i, 0).bold().wrapText(true).fillColor("D5F5E3").horizontalAlignment("justify").set();
wb.finish();
from fastexcel.
Thank you. I would also be interested in getting the repair xml file generated by Excel: see link "Click to view log file listing repairs" in the error box.
BTW, looks like your screenshots exhibit sensitive data: you should probably blur them or remove them.
from fastexcel.
-
error232440_01.xml
-
Removed Records: Merge cells from /xl/worksheets/sheet1.xml part
from fastexcel.
-
error232440_01.xml
-
Removed Records: Merge cells from /xl/worksheets/sheet1.xml part
from fastexcel.
This looks like the issue is related to merged cells. The code snippet is obviously for generating another worksheet: it does not match the failing example ("investor list").
from fastexcel.
Hi,
Excel is working fine by your support. Thank you very much.
from fastexcel.
Related Issues (20)
- Column width is not updated automatically
- how to set charset encoding HOT 1
- Writing files using predefined dataformat strings
- Comments vs Notes HOT 2
- Ability to get rich Text formatting on cell value HOT 1
- Corrupt Excel file generated HOT 2
- Why is fastexcel not modularized (Java 9 module system) yet? HOT 5
- getCellAsNumber as is misleading
- xlsx with new Lines (CR+LF) : Parsing error HOT 5
- Security vulnerability in 0.17.0 HOT 2
- Adding information about the author of the comment. HOT 2
- Test case 'CorrectnessTest#testForAllFeatures' is broken HOT 1
- Create a new module 'fastexcel-base'/'fastexcel-common' HOT 1
- does fastexcel works in android?
- Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/stream/XMLInputFactory
- How can I read existing style from existing row?
- how to add a cell to a row when using the the reader HOT 1
- Proposal: add a note that this library is GraalVM-friednly
- Corrupt Excel file when using an ampersand in a table header HOT 6
- Preserve spaces
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastexcel.