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

rajendratambat

Members
  • Posts

    35
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Posts posted by rajendratambat

  1. You did not explained properly did you get either of output atleast in FF or not.

     

    well I see problem here with using jasperprint object from session. just want to make you aware that

    if you use same object from session for first time it will work but if you try to use same object

    second time with other type of report it will not work because. jasperprint object gets modified

    when you export(convert to pdf/xls) report.

    I hope if you are facing this problem that it is working for one export and not for 2nd with same session

    object I will suggest to make copy of jasperprint object and send for export.

     

    Rajendra Tambat

    http://rajendratambat.blogspot.com/

     


  2. I have tried using ArrayList object.

    you need to put this list object in JRBeanCollectionDataSource

    here is code sample how i did

    MyBean  is my pojo class with getters and setters

     

     

    Rajendra Tambat

    http://rajendratambat.blogspot.com/

     

    Code:
    ArrayList beans = new ArrayList();MyBean row211 =new MyBean("Header3452345","subheader1","row21","VALU23 ");MyBean row212 = new MyBean("header1234","subheader1","row21","VAL2");beans.add(row211);beans.add(row212);Map parameters = new HashMap();// prepare report and dataFileInputStream is = new FileInputStream(new File("C:\\data\\mytest\\test.jrxml"));JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(beans);// generate pdf fileJasperDesign jasperDesign = JRXmlLoader.load(is);JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters,ds);JasperExportManager.exportReportToPdfFile(jasperPrint, "C:\\data\\mytest\\mytest.pdf");            
  3.  

    I assume that you may be fireing a query and getting a data... in that sense,

    you can wirte a query which will be unioin of different criteria and give output in a group

    like

    select 'A', c1,c2,c3 where ValueA > 0

    union

    select 'B', c1,c2,c3 where ValueB == 10

     

    and use grouping to show data on diff pages when group changes.

    hope this will help you.

    good luck


  4. It is possible...it is complex yet.... provided you are generating reports programatically.

    follow these steps.

    create your component which will take input string as html table code parse it and convert it as jasper reable jrxml code output as  JRDesignElement object .

    design report add a dummy comonent( eg. static text) where you want to see actual table.

    assuming that you are calling report from java application... in that section you need to add following flow.

    load jrxml   (jaspermanager/jrxmlloader  will load your jrxml and return you jasperdesign object.)

    JasperDesign jasperDesign = JRXmlLoader.load(FileInputStream)

    get jasperdesign object... this will gives all apis to get all components inside...

    call apis to locate dummy component from jasperdesign remove that element and replace your new element.

    then follow next steps of compiling..filling... exporting to desired output...

     

    Rajendra Tambat

     

  5. are you adding multiple reports as one... or its a single report and in that you are adding pagefooter ?

    well, if you want pdf output of multiple report... I hope you might have added multiple reports as a sub report in a main report after every subreport you add a pagebreak... I hope this will work as same you expected.

     

    Rajendra Tambat

     

     

  6. Hi,

    It is possible,

    open ireport

    tools>>option>>

    main tab is iReport

    under that go to tab jasperreports properties

    it will show you all properties of jasper  look for  "net.sf.jasperreports.compiler.classpath"

    try to modify path as you want for your classpath of jdk and jre. thats it!

     

    if you are using latest version of ireport it provides you backword compactibility as well to generate jrxml

    you may also want to look into

    find tab general>>compatibility>> and set required version compatibility level

     

     

  7. Good,

    Still to achieive the same effect you can use textfield to draw a onle line of paragraph or a whole paragraph itself

    and in expression of it you can simply use $F{Field1} which will automatically get replaced.

     

    try below code in your text field expression replace values of field1 and filed2 appropriately

    Code:
    "The heaven called "+$F{Field1} +" where I had the best days of my life with some of the most wonderful people of " + $F{Field2} +" batch. My heartiest thank you to my friends whom I spent most of my time with be it arguing on some topic to pulling each other’s leg "
  8. do you mean that you have a static text in your detail band?

    if so it is very simple

    add static text field and text fields combined together check following code...

    I hope I am getting you in right direction. if not please share your jrxml and more details

    Code:
    			<textField>				<reportElement x="147" y="0" width="69" height="20"/>				<textElement/>				<textFieldExpression class="java.lang.String"><![CDATA[$F{field1}]]></textFieldExpression>			</textField>			<staticText>				<reportElement x="16" y="0" width="131" height="20"/>				<textElement/>				<text><![CDATA[The first parameterized is ]]></text>			</staticText>			<textField>				<reportElement x="306" y="0" width="100" height="20"/>				<textElement/>				<textFieldExpression class="java.lang.String"><![CDATA[$F{field2}]]></textFieldExpression>			</textField>			<staticText>				<reportElement x="216" y="0" width="100" height="20"/>				<textElement/>				<text><![CDATA[and the second is ]]></text>			</staticText>
  9. What you are asking is changing the report design at run time...

    that too is possible just look in to jasper API for same...

    from jasper manager you can get inner objects like JRBand, JRQuery etc. and you can modify them on the fly create new JRXML  as well. you need to digg more in API.

    there is another library available which allow you to create report  programatically i.e. creating design at run time. by hiding api's internally.

    http://dynamicjasper.sourceforge.net/

    have a look at this site.

     

  10. there are 2 possibilites of generating report

    1. you have two different jrxml files and you call them from java code depending on user made choice to see chart or table.

    2. create 2 sub reports one for chart ande one for table. both add in a main report. add one parameter to main report. paramter value can be set to  "chart"/"table"  and provide a "printwhencondition" for subreport to get called  based on this value.

    I hope you get it.

     

    if you are new to jasper report try to see how to call jasperreport from java code also how to use printwhen expression.

×
×
  • Create New...