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

Problem with CSV


imams

Recommended Posts

Hi,
I exported the report data in the CSV format and then tried to open that. However, I find that there is column shift. This means the data is not displayed under proper coulmn names. Can this be avoided? Please help.

Link to comment
Share on other sites

  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

Hi Lucian,

I too face the same issue while exporting the reports to csv format. I gone through the FAQ you have mentioned and rearranged the elements of the report according to that. But still am facing the issue with lot of commas between the two values.

I am attaching the .jrxml file and csv output of that report in zip format. Please suggest me a solution. [file name=samplereps.zip size=1990]

Link to comment
Share on other sites

slaguduv wrote:

I am attaching the .jrxml file and csv output of that report in zip format. Please suggest me a solution.

 

I don't understand how the JRXML that you've attached could produce (by its own) the CSV output. The CSV contains text/labels like "Health and Utilization Monitor" that are not present in the JRXML.

 

Are you using this JRXML as a subreport? If so, please attach the master JRXML as well.

 

Regards,

Lucian

Link to comment
Share on other sites

I'm even more confused now.

 

How does the header "from a jsp file" shows up in the JasperReports CSV export? Are you passing it as a parameter to the report?

 

And if the JRMXL is the subreport only, could you post the master JRXML as well as I've asked in my previous message?

 

Regards,

Lucian

Link to comment
Share on other sites

Hi Lucian,

We are calling the reports dynamically from a jsp file which have been already generated and kept in a folder.

I am attaching the Master.jrxml file which contains three subreports. In that one of the subreport only I have given already for your reference.

Expecting your suggestion on this.

Regards,
slaguduv. [file name=Master.jrxml size=7280]

Link to comment
Share on other sites

Hi Lucian,

 

I'm not getting this point "have to pay attention whether elements from different subreports are aligned in the master report". In the master report, we are calling the subreports and in that only it contains the elements. So, how to see that elements from subreport are aligned in the master report ? Could you please explain more on these which will help in debugging the issue.

 

For your information , I have upgraded to the jasper 3.0.0 version. But still I could see no change in the reports.

 

Thanks,

Slaguduv.

Link to comment
Share on other sites

When you have subreports in a master report, the generated/filled document contains elements from the subreports along with elements from the master report. This document is then exported to CSV and other formats, so if you want to have a properly formatted CSV export you will need to make sure that all the elements in the filled document (including the ones coming from different subreports) are properly aligned.

 

So, for instance, if you have an element in a subreport at x=20, and an element from another subreport at x=30 (and the subreport elements in the master report have the same position on the x axis), the two elements will not be exported on the same column in CSV because they will not be aligned at the same x position in the generated/filled document.

 

Regards,

Lucian

Link to comment
Share on other sites

Hi Lucian,

 

My question is in the same subreport itself, I could see lot of commas in between two elements.

 

eg:

 

Generation Time:,,,,"Thu, May 29 2008, 11:20 IST",,,,,,,,,,,

Start Time:,,,,"Wed, May 28 2008, 11:19 IST",,,,,,,,,,,

End Time:,,,,"Thu, May 29 2008, 11:19 IST",,,,,,,,,,,

 

In the above e.g. , elements are all present in the same subreport only. You can check that subreport which I have attached initially.

Link to comment
Share on other sites

Elements coming from a specific subreport are not exported separately, but along with the rest of the elements in the filled report. Elements coming from other subreports can introduce breaks in fille report layout, and this can result in CSV columns.

 

Subreports are relevant at report fill time only. When a filled report is exported to CSV or any other format, it makes no difference whether some elements came from a subreport or not. The layout of the filled report (containing elements from the master report and all subreport) is the only thing that matters at export time.

 

Regards,

Lucian

Link to comment
Share on other sites

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...