rajendratambat
-
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
-
-
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");
-
possible.
pass one parameter to report preview=y/n
if y then show (by adding conditional print when expression)
Rajendra Tambat
http://rajendratambat.blogspot.com/
-
It is possible, programmatic. before that you should be knowing that in which case your report is going to extend or some indication to main report to know that its
sub report will get extend so that it will change its layout.
from your code get jrxml object before compiling it. modify its layout and then pass that object to compile>>fill>>runRajendra Tambat
-
as far as I knows ireport 3.1 prior version supports jdk 1.4Rajendra Tambat
http://rajendratambat.blogspot.com/
-
yes it is,please checked attached image
Rajendra Tambat
Code: | type1 | type2 | |------------------------ | v1| v2| t2v1|t2v2_________________________
Post Edited by rajendratambat at 04/01/2011 05:59 -
use crosstab feature of ireport
please visit my blog post if required
http://rajendratambat.blogspot.com/2010/10/creating-crosstab-report-with-jasper.html
Rajendra Tambat
Post Edited by rajendratambat at 03/23/2011 04:45 -
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
-
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
-
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
-
can you elaborate it in greater detail what is expected if possible with input sample and jrxml also with expected output sample...along with explanation.
Rajendra Tambat
-
in jasperreport you can set text field markup property as "styled/html" which will treat your html code as data appropriately... have you tried this?Rajendra Tambat
-
first you gave jrxml which has static query.
are you replacing this query at run time and then generating .jasper file?
if so try to sop what query it is generating.
Rajendra Tambat
-
there is a property called markup you set it as "RTF" it will treat your data as rtf and will try to apply same.
Rajendra Tambat
-
I can just give you a quick hint if you are generating report programatically there is "JRHtmlExporterParameter.PAGE_INDEX" that you can use to export upto specific pages. find more...
-
create a variable say totbal
and on field txtype add printwhen expression give expression to check value of txtype if its deposit then add amount field value to totbal and if txtype is withdrawal then deduct amount value from totbal.
-
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
-
It is possible, provided your hosted myslq ip address/hostname is avilable and port is open to access from your workstation
-
cool.
-
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 "
-
Well I too have worked on it... but I can not share the code... as per company policy. if any specific help required please do post
Rajendra Tambat
-
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>
-
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.
-
please elaborate more...
-
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.
Issues while exporting reports as Pdf and Xls in firefox
in Products
Posted
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/