Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6798817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:46:32+00:00 2026-05-26T18:46:32+00:00

I have problem related to file protection when changed the Jasper Report output from

  • 0

I have problem related to file protection when changed the Jasper Report output from xls to xlsx.

The changes is needed since XLSX could support greater row (Up to 1.000.000) compared to XLS.

The problem is the report need to be protected. This is an easy task since Jasper Configuration support this by using

<property name="net.sf.jasperreports.export.xls.password" value="password" />

http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/config.reference.html#net.sf.jasperreports.export.xls.password

But This doesn’t work when the output is XLSX, i try to use trivial such as change from xls to xlsx and the result is remain the same.

<property name="net.sf.jasperreports.export.xlsx.password" value="password" />

How to protect Jasper Generated Report when using XLSX as output?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:46:32+00:00Added an answer on May 26, 2026 at 6:46 pm

    As you can make yourself (after digging in JR sourcecode) only JExcelApiExporter and JExcelApiMetadataExporter classes use net.sf.jasperreports.export.xls.password property. And only this two exporters (not JRXlsxExporter and not even JRXlsExporter) can set password.

    The snippet from net.sf.jasperreports.engine.export.JExcelApiExporter:

    protected void setParameters()
    {
        super.setParameters();
    
        if (createCustomPalette)
        {
            initCustomPalette();
        }
    
        password = 
            getStringParameter(
                JExcelApiExporterParameter.PASSWORD,
                JExcelApiExporterParameter.PROPERTY_PASSWORD
                );
    
    ...
    
    }
    
    private final void setSheetSettings(WritableSheet sheet)
    {
        PageOrientation po;
        PaperSize ps;
    
        if (jasperPrint.getOrientationValue() == OrientationEnum.PORTRAIT)
        {
            po = PageOrientation.PORTRAIT;
        }
        else
        {
            po = PageOrientation.LANDSCAPE;
        }
        if ((ps = getSuitablePaperSize(jasperPrint)) != null)
        {
            sheet.setPageSetup(po, ps, 0, 0);
        }
        else
        {
            sheet.setPageSetup(po);
        }
        SheetSettings sheets = sheet.getSettings();
        ...
        if(password != null)
        {
            sheets.setPassword(password);
            sheets.setProtected(true);
        }
    ...
    }
    

    You can write your own XlsxExporter.

    The JRXLSExporter uses POI library and the JExcelApiExporter uses the JExcelApi.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem related to graph. I am not a computer science grad
I have a problem related to the subset sum problem and am wondering if
I have a performance problem related to string comparison (in Java). I'm working on
I have a problem which I think is related to forward declarations, but perhaps
I have a serious performance problem. I have a database with (related to this
This is basically a math problem, but very programing related: if I have 1
I have a problem related to Memory Leak. In my app I have to
everybody, I have some problem related to the jenkins and git. I created a
I have a problem related to creating an instance of a WCF ServiceHost withing
I have problem with forms on one file. The problem is that when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.