GithubHelp home page GithubHelp logo

Issue when open xls file about fastexcel HOT 9 CLOSED

dhatim avatar dhatim commented on August 12, 2024
Issue when open xls file

from fastexcel.

Comments (9)

ochedru avatar ochedru commented on August 12, 2024 1

Fastexcel generates xlsx files (aka Excel 2007 format), not xlsfiles. Please try to change the file extension.

from fastexcel.

shajahan86 avatar shajahan86 commented on August 12, 2024

Hi,
Thanks for your reply.
After changed the file format ".xlsx". It throws following dialogue message. Kindly suggest to stop this error.

errordialogue1
errordialogue2

from fastexcel.

ochedru avatar ochedru commented on August 12, 2024

There must be something wrong indeed in the generated file. Can you post a code snippet to reproduce the issue?

from fastexcel.

shajahan86 avatar shajahan86 commented on August 12, 2024

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.

ochedru avatar ochedru commented on August 12, 2024

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.

shajahan86 avatar shajahan86 commented on August 12, 2024

-

error232440_01.xml

Errors were detected in file 'C:\Users\user\Downloads\Transactions (5).xlsx'

-

Removed Records: Merge cells from /xl/worksheets/sheet1.xml part

from fastexcel.

shajahan86 avatar shajahan86 commented on August 12, 2024

-

error232440_01.xml

Errors were detected in file 'C:\Users\user\Downloads\Transactions (5).xlsx'

-

Removed Records: Merge cells from /xl/worksheets/sheet1.xml part

from fastexcel.

ochedru avatar ochedru commented on August 12, 2024

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.

shajahan86 avatar shajahan86 commented on August 12, 2024

Hi,
Excel is working fine by your support. Thank you very much.

from fastexcel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.