Jump to content
We've recently updated our Privacy Statement, available here ×

How to set Relative Path for Jasper Report


aj_angel60

Recommended Posts

Hello Everyone,

My small Swing Project is ready to deploy. Now I realised that i had used absolute path for Jasper Report which will create problem on client side I guess.

So I want to use relative path for that i searched but didnot get any appropriate answer.

Here is code 

             DefaultTableModel jtm2 = (DefaultTableModel) jTable2.getModel();
            JRDataSource dataSource = new JRTableModelDataSource(jtm2);
            JasperPrint jprint = JasperFillManager.fillReport("E:\Swing Project\SCMPayBoard\src\scmpayboard\EmpReport.jasper", null, dataSource);
            JasperViewer.viewReport(jprint, false);

How do i change the path E: drive into relative so where ever user install, it wont create problem.

I searched the syntax (.) (..) single dot and double dot and tried various variation but no result.

Please guide me 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...