Vous êtes sur la page 1sur 5

JasperForge: JasperReports Project Forums

http://jasperforge.org/plugins/espforum/view.php?group_id=102&foru...

Join now to
ABOUT

JASPERSOFT.COM STORE LOGIN contribute. Click here.

|
PROJECTS

|
BLOGS

|
NEWS

JasperReports | |

SITE RSS GADGETS

|
ACTIVITY Proje ct Hom e | Forum s | Ne w s | Docs | Tracke r | Source | List | RSS

Forums

>

JasperReports Discussion/Help

> Reg:RTF fromat in Icefaces >

Search Forum
Advanced Search

Page: 1

JasperReports Discussion/Help Topic:

Forum Tools #59388

Reg:RTF fromat in Icefaces

07/02/2009 13:59

yogarajkhanal

Project Roles Posts: 39 Karma: -1

1 of 5

04/12/2009 8:15 AM

JasperForge: JasperReports Project Forums

http://jasperforge.org/plugins/espforum/view.php?group_id=102&foru...

JasperReports Discussion/Help Topic:

Forum Tools

Hi, I am able to integrate icefaces and jasper report to open the word report template with popup option to open save and cancel. I have now two problems and need suggestion from you. 1)For the collection data type I am getting [.....] two square brackets around the data. 2)Also I am getting Text box surrounded for each label and value i don't want this please let me know how shold i remove. I am using iReport 3.0.0 as jrxml design tool and jasper reports 3.1.2 jar also i integarted it wih icefaces 1.7.2 using <ice:outputResource resource="#{iraTemplateBackingBean.downloadRtfForIra}" label="Generate Template" styleClass="squarebutton" fileName="ccmtemplate.rtf" mimeType="application/rtf" /> and invoking following method in backing bean

public Resource getDownloadRtfForIra() throws JRException, FileNotFoundException, IOException { logger.debug("IRATemplateBackingBean->getDownloadRtfForIra"); FacesContext context = FacesContext.getCurrentInstance(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { InputStream reportStream = context.getExternalContext().getResourceAsStream("/WEB-INF/report /CCM_IRA_TEMP.jasper"); this.iraCommunicationBackingBean = (IRACommunicationBackingBean) this.getManagedBean("iraCommunicationBackingBean"); Communication comm = iraCommunicationBackingBean.getCommDetails(); Telecon tel = (Telecon) comm; String submissionType = comm.getSubmission().getSubmissionType(); String submissionID = comm.getSubmission().getSubmissionID(); String reviewOffice = comm.getSubmission().getReviewOffice(); String iraTitle = comm.getSubmission().getProduct().getTitle(); String sponsorName = comm.getSubmission().getSponsor().getName(); Date teleconDateTime = tel.getTeleconDateTime(); String fdaInitiated = tel.getFdaOriginated(); String telNo = comm.getSubmission().getSponsor().getContactPhone(); String author = comm.getAuthor().getFirstName() + " " + comm.getAuthor().getLastName(); String teleconSummary = comm.getSummary(); List fdaParticipants = new ArrayList(); List<Participant> listNonFdaPart=tel.getFdaParticipants(); for(Iterator<Participant> iter=listNonFdaPart.iterator();iter.hasNext();){ Participant participant=iter.next(); String tmpString=null; tmpString=participant.getFirstName()+" "+participant.getLastName(); logger.debug("IRATemplateBackingBean->getDownloadRtfForIra->fda participant:\t"+tmpString); fdaParticipants.add(tmpString); }

List nonFda = new ArrayList(); List<Participant> listFdaPart=tel.getNonFdaParticipants(); for(Iterator<Participant> iter=listFdaPart.iterator();iter.hasNext();){ Participant participant=iter.next(); String tmpString=null; tmpString=participant.getFirstName()+" "+participant.getLastName(); logger.debug("IRATemplateBackingBean->getDownloadRtfForIra->non fda participant:\t"+tmpString); nonFda.add(tmpString); }

2 of 5

04/12/2009 8:15 AM

JasperForge: JasperReports Project Forums

http://jasperforge.org/plugins/espforum/view.php?group_id=102&foru...

JasperReports Discussion/Help Topic:


Attachments:

Forum Tools

ccmtemplate.rtf

#59543

RE:Reg:RTF fromat in Icefaces

07/06/2009 14:35

teodord

Hi,

For the #1 problem, we would need to see the report template. Maybe the brackets come from your data? As for #2, what would you want instead of text boxes? Simple paragraphs? How would you position simple paragraphs at precise X and Y position within a page? For more details, please see this: http://jasperforge.org/projects/jasperreports/tracker/view.php?id=4090

Project Roles Project Owner,Project Admin Posts: 2032 Karma: 202

Thank you, Teodor

#59560

RE:Reg:RTF fromat in Icefaces

07/06/2009 18:03

yogarajkhanal

Thanks Teodor, I have attached my jrxml that i am using. I am getting [..] in all type of collection that i am printing. Also i would want text just to remain like we designed in jrxml and user can do anything with that after exporting i mean they can change key or value we don't care after we give them data in word format. I would appriciate your idea to achieve this. Again I appreciate your feedback. Yogaraj Project Roles Posts: 39 Karma: -1

Attachments:

ccm_ira_temp.jrxml

#59563

RE:Reg:RTF fromat in Icefaces

07/06/2009 18:22

yogarajkhanal

Teodor, Just curious if u guys have any email mechanism to notify the users that someone commented on their thread? If yes then I didn't get an email about your reply. Thanks, Yogaraj
Project Roles Posts: 39 Karma: -1

#59606

3 of 5

04/12/2009 8:15 AM

JasperForge: JasperReports Project Forums

http://jasperforge.org/plugins/espforum/view.php?group_id=102&foru...

JasperReports Discussion/Help Topic:


RE:Reg:RTF fromat in Icefaces
07/07/2009 08:51

Forum Tools teodord

Hi,

As I suspected, for #1, the brackets come from your data. If you are familiar with Java, you should know that this is the kind of String you get when you call the toString() method on a Collection object. And this is what you do when you put the collection parameter inside of a text field displaying Strings. If you don't like the brackets, you have to remove them yourself with subtring(), or iterate the collection and concatenate the values the way you want, using some coding. Another solution would be to use the new List component, which was shipped in JR 3.5.1.

Project Roles Project Owner,Project Admin Posts: 2032 Karma: 202

As for #2, I gave you the link to a tracker which explains why the RTF exporter works this way. Basically, we use text boxes because we want the output to be pixel perfect, not necesarily to be editable later on. And also because using tables was not succesfull due to unicode limitations we encountered when we tried it, a long time ago.

When you reply to a thred, you have two buttons: Save and Save&Monitor. Click Save&Monitor if you want to be notified of subsequent replies on your thread. If you experience problems with this button, let us know.

Thanks, Teodor

#59678

RE:Reg:RTF fromat in Icefaces

07/07/2009 21:39

yogarajkhanal

Ok Finally got it working using below code .Let me know if anyone has any problems with this approach Jsp: Project Roles <ice:outputResource resource="#{iraTemplateBackingBean.downloadRtfForIra}" label="Generate Template" styleClass="squarebutton" fileName="ccmtemplate.doc" mimeType="application/txt" /> Posts: 39 Karma: -1

Jasper :

JRTextExporter exporter = new JRTextExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos); exporter.setParameter(JRTextExporterParameter.CHARACTER_WIDTH, new Integer(10)); exporter.setParameter(JRTextExporterParameter.CHARACTER_HEIGHT, new Integer(10)); exporter.exportReport();

Page: 1

JasperForge Quotes "Building PDFs and Word docs and whatnot can eat up a lot of CPU cycles on a loaded server, so I started using JasperServer on a separate box, and just talk to it through the web service it provides."

4 of 5

04/12/2009 8:15 AM

JasperForge: JasperReports Project Forums

http://jasperforge.org/plugins/espforum/view.php?group_id=102&foru...

Copyright 2000 - 2009 Jaspersoft Corporation |

Terms of Use

Legal Notices

Feedback

Privacy Policy

Site Map

Contact Us

5 of 5

04/12/2009 8:15 AM

Vous aimerez peut-être aussi